From jamie@bishopston.net  Mon May 31 11:23:05 2010
Return-Path: <jamie@bishopston.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 5FC301065676
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 31 May 2010 11:23:05 +0000 (UTC)
	(envelope-from jamie@bishopston.net)
Received: from pacha.mail.bishopston.net (pacha.mail.bishopston.net [66.148.74.41])
	by mx1.freebsd.org (Postfix) with ESMTP id 08DFE8FC29
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 31 May 2010 11:23:03 +0000 (UTC)
Received: from catflap.bishopston.net (jamie@localhost [127.0.0.1])
	by catflap.bishopston.net (8.14.4/8.14.3) with ESMTP id o4VBLmcJ050507
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 31 May 2010 12:21:48 +0100 (BST)
	(envelope-from jamie@catflap.bishopston.net)
Received: (from jamie@localhost)
	by catflap.bishopston.net (8.14.4/8.12.9/Submit) id o4VBLmGc050506;
	Mon, 31 May 2010 12:21:48 +0100 (BST)
Message-Id: <201005311121.o4VBLmGc050506@catflap.bishopston.net>
Date: Mon, 31 May 2010 12:21:48 +0100 (BST)
From: Jamie Landeg Jones <jamie@bishopston.net>
Reply-To: Jamie Landeg Jones <jamie@bishopston.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: ld-elf.so.1 not being updated on buildworld/installworld 
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         147244
>Category:       misc
>Synopsis:       [build] ld-elf.so.1 not being updated on buildworld/installworld
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    vwe
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon May 31 11:30:05 UTC 2010
>Closed-Date:    Sun Aug 15 20:53:08 UTC 2010
>Last-Modified:  Sun Aug 15 20:53:08 UTC 2010
>Originator:     Jamie Landeg Jones
>Release:        FreeBSD 8.1-PRERELEASE i386
>Organization:
http://www.bishopston.com/jamie/
>Environment:
System: FreeBSD catflap.bishopston.net 8.1-PRERELEASE FreeBSD 8.1-PRERELEASE #0: Thu May 27 18:14:26 BST 2010 root@catflap.bishopston.net:/usr/obj/usr/src/sys/CATFLAP i386


	
>Description:

I track RELENG_8 (8 Stable) and buildworld on my server every few months.

However, on doing so today, I noticed that ld-elf.so.1 had not been updated for some time:

total 452
      2 drwxr-xr-x   2 root  wheel     512 May 27 18:21 .
      2 drwxr-xr-x  28 root  wheel     512 May 27 19:17 ..
    224 -r-xr-xr-x   1 root  wheel  211616 Feb 13 14:54 ld-elf.so.1
    224 -r-xr-xr-x   1 root  wheel  211668 Dec  1 17:13 ld-elf.so.1.old

Doing the following:

cd /usr/src/libexec/rtld-elf
make
make install

Now gives:

total 452
      2 drwxr-xr-x   2 root  wheel     512 May 27 20:05 .
      2 drwxr-xr-x  28 root  wheel     512 May 27 19:17 ..
    224 -r-xr-xr-x   1 root  wheel  208352 May 27 20:05 ld-elf.so.1
    224 -r-xr-xr-x   1 root  wheel  211616 Feb 13 14:54 ld-elf.so.1.old

	
>How-To-Repeat:
	

cd /usr/src
mergemaster -p
rm -r /usr/obj/usr
make buildworld
....
.
.
make installworld

>Fix:

	


>Release-Note:
>Audit-Trail:

From: Riccardo Torrini <riccardo@torrini.org>
To: "mailto:bug-followup"@FreeBSD.org, jamie@bishopston.net
Cc:  
Subject: Re: conf/147244: ld-elf.so.1 not being updated on
 buildworld/installworld (potential fix)
Date: Sun, 6 Jun 2010 11:53:03 +0200

 Yesterday I rebuilded an 8.0 machine (last installed on feb.28)
 and got the source (and the solution, I think):
 
 # ls -log /libexec/
 total 424
 -r-xr-xr-x  1 root  wheel  schg 220020 Feb 28 14:18 ld-elf.so.1
 -r-xr-xr-x  1 root  wheel  -    188096 Feb 28 09:14 ld-elf.so.1.old
 
 # ls -log /usr/libexec/ld-elf*
 lrwxr-xr-x  1 root  wheel  - 20 Jun  6 10:20 \
         /usr/libexec/ld-elf.so.1 -> /libexec/ld-elf.so.1
 
 I also checked the build dir and it was updated:
 
 # ls -log /usr/obj/usr/src/libexec/rtld-elf/ld-elf.so.1
 -rwxr-xr-x  1 root  wheel  - 275642 Jun  5 20:01 \
         /usr/obj/usr/src/libexec/rtld-elf/ld-elf.so.1
 
 All others files in /*bin, /usr/*bin e /usr/lib* seems right.
 Here the installworld log (extract):
 
 ===> libexec/rtld-elf (install)
 chflags noschg /usr/libexec/ld-elf.so.1
 install -s -o root -g wheel -m 555  -C -b -fschg -S ld-elf.so.1 /libexec
 install -o root -g wheel -m 444 rtld.1.gz  /usr/share/man/man1
 /usr/share/man/man1/ld-elf.so.1.1.gz -> /usr/share/man/man1/rtld.1.gz
 /usr/share/man/man1/ld.so.1.gz -> /usr/share/man/man1/rtld.1.gz
 /usr/libexec/ld-elf.so.1 -> /libexec/ld-elf.so.1
 
 The problem is "chflags noschg" to a soft-link in /usr/libexec but
 then install over the protected one in /libexec.
 
 Potential fix (remove "/usr" on two lines):
 
 # diff -u4 Makefile.orig Makefile
 --- Makefile.orig       2009-08-03 10:13:06.000000000 +0200
 +++ Makefile    2010-06-06 11:47:00.000000000 +0200
 @@ -46,10 +46,10 @@
  
  # Since moving rtld-elf to /libexec, we need to create a symlink.
  # Fixup the existing binary that's there so we can symlink over it.
  beforeinstall:
 -.if exists(${DESTDIR}/usr/libexec/${PROG})
 -       -chflags noschg ${DESTDIR}/usr/libexec/${PROG}
 +.if exists(${DESTDIR}/libexec/${PROG})
 +       -chflags noschg ${DESTDIR}/libexec/${PROG}
  .endif
  
  .PATH: ${.CURDIR}/${MACHINE_ARCH}
 
 
 -- 
 Riccardo. ( http://www.GUFI.org/~vic/ )

From: Riccardo Torrini <riccardo@torrini.org>
To: bug-followup@FreeBSD.org, jamie@bishopston.net
Cc:  
Subject: Re: conf/147244: ld-elf.so.1 not being updated on
 buildworld/installworld (potential fix)
Date: Sun, 6 Jun 2010 12:13:51 +0200

 On Sun, Jun 06, 2010 at 11:53:03AM +0200, Riccardo Torrini wrote:
 
 > # diff -u4 Makefile.orig Makefile
 
 Obviously Makefile means /usr/src/libexec/rtld-elf/Makefile
 You can also check that fix works using:
 
 # make beforeinstall
 chflags noschg /libexec/ld-elf.so.1
 
 # ls -log /libexec/
 total 424
 -r-xr-xr-x  1 root  wheel  - 220020 Feb 28 14:18 ld-elf.so.1
 -r-xr-xr-x  1 root  wheel  - 188096 Feb 28 09:14 ld-elf.so.1.old
 
 
 -- 
 Riccardo. ( http://www.GUFI.org/~vic/ )

From: Riccardo Torrini <riccardo@torrini.org>
To: bug-followup@FreeBSD.org, jamie@bishopston.net
Cc:  
Subject: Re: conf/147244: ld-elf.so.1 not being updated on
 buildworld/installworld (solved)
Date: Sun, 6 Jun 2010 14:16:16 +0200

 On Sun, Jun 06, 2010 at 11:53:03AM +0200, Riccardo Torrini wrote:
 
 > # ls -log /libexec/
 > total 424
 > -r-xr-xr-x  1 root  wheel  schg 220020 Feb 28 14:18 ld-elf.so.1
 > -r-xr-xr-x  1 root  wheel  -    188096 Feb 28 09:14 ld-elf.so.1.old
 
 Me again.  Sorry for wasting time and bandwidth, notice that
 "install -S" doesn't change file when is the same, so target
 remain with old timestamp.  Anyway it can confuse  :-)
 
 # cp /usr/obj/usr/src/libexec/rtld-elf/ld-elf.so.1 /tmp/ && \
 	strip /tmp/ld-elf.so.1 && \
 	md5 -r /tmp/ld-elf.so.1 /libexec/ld-elf.so.1
 7328a72be1e4991c1461a197492539dc /tmp/ld-elf.so.1
 7328a72be1e4991c1461a197492539dc /libexec/ld-elf.so.1
 
 # ls -log /tmp/ld-elf.so.1 /libexec/ld-elf.so.1
 -r-xr-xr-x  1 root  wheel  - 220020 Feb 21 01:11 /libexec/ld-elf.so.1
 -rwxr-xr-x  1 root  wheel  - 220020 Jun  6 14:05 /tmp/ld-elf.so.1
 
 
 Patch is not needed because chflasg can go through soft-link
 but (imho) a touch (or a FAQ) can help us to stop opening PR.
 Sorry again.
 
 
 -- 
 Riccardo. ( http://www.GUFI.org/~vic/ )
State-Changed-From-To: open->closed 
State-Changed-By: vwe 
State-Changed-When: Sun Aug 15 20:46:45 UTC 2010 
State-Changed-Why:  
Jamie, I've tested your observations but was not able to get ld-elf.so.1 not being updated when it had to. 
I think your observations can be reduced to not getting a timestamp update if ld-elf.so.1 does not change. 
Please use hash tools like sha256 or md5 for testing binary files for correctness. We're closing this report as we don't think there's a problem. If you disagree, please attach more detailed information. 


Responsible-Changed-From-To: freebsd-bugs->vwe 
Responsible-Changed-By: vwe 
Responsible-Changed-When: Sun Aug 15 20:46:45 UTC 2010 
Responsible-Changed-Why:  
track 

http://www.freebsd.org/cgi/query-pr.cgi?pr=147244 
>Unformatted:
