From wcolburn@userhost.nmt.edu  Fri Aug  8 09:23:35 2003
Return-Path: <wcolburn@userhost.nmt.edu>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id CD17737B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Aug 2003 09:23:35 -0700 (PDT)
Received: from userhost.nmt.edu (userhost.NMT.EDU [129.138.4.64])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 3A76043FDD
	for <FreeBSD-gnats-submit@freebsd.org>; Fri,  8 Aug 2003 09:23:35 -0700 (PDT)
	(envelope-from wcolburn@userhost.nmt.edu)
Received: (from root@localhost)
	by userhost.nmt.edu (8.12.9/8.11.3) id h78GNX0f001376;
	Fri, 8 Aug 2003 10:23:33 -0600 (MDT)
	(envelope-from wcolburn)
Message-Id: <200308081623.h78GNX0f001376@userhost.nmt.edu>
Date: Fri, 8 Aug 2003 10:23:33 -0600 (MDT)
From: "William D. Colburn (aka Schlake)" <wcolburn@mailhost.nmt.edu>
Reply-To: "William D. Colburn (aka Schlake)" <wcolburn@mailhost.nmt.edu>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: users LD_LIBRARY_PATH can interfere with mail buildworld
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         55387
>Category:       misc
>Synopsis:       [build] [patch] users LD_LIBRARY_PATH can interfere with mail buildworld
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Aug 08 09:30:16 PDT 2003
>Closed-Date:    
>Last-Modified:  Tue Nov 13 20:50:38 UTC 2012
>Originator:     William D. Colburn (aka Schlake)
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
New Mexico Institute of Mining and Technology
>Environment:
System: FreeBSD userhost 4.8-STABLE FreeBSD 4.8-STABLE #0: Thu Aug 7 13:02:12 MDT 2003 wcolburn@userhost:/usr/obj/usr/src/sys/USERHOST i386


>Description:

If I have built/installed openldap from /usr/ports/ and my
LD_LIBRARY_PATH has /usr/local/lib in front, then make buildworld will
die on compiling scp because it cannot find certain encyption symbols.
Sadly, I'm reporting this after-the-fact and I didn't save the errors.

My System at the time was as above, but it was 4.6-STABLE, and a GENERIC
kernel.

>How-To-Repeat:

Go to /usr/ports and install openldap22.  Set LD_LIBRARY_PATH to have
/usr/local/lib in front.  Then go to /usr/src and try "make buildworld".
It will fail on scp.

>Fix:

Not having /usr/local/lib in your LD_LIBRARY_PATH is one fix, but I
think that the /usr/src/ build tree shouldn't get confused by things in
/usr/local/lib.  It probably shouldn't be using the users
LD_LIBRARY_PATH at all.

>Release-Note:
>Audit-Trail:

From: Peter Pentchev <roam@ringlet.net>
To: "William D. Colburn (aka Schlake)" <wcolburn@mailhost.nmt.edu>
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/55387: users LD_LIBRARY_PATH can interfere with mail buildworld
Date: Thu, 28 Aug 2003 17:18:10 +0300

 On Fri, Aug 08, 2003 at 10:23:33AM -0600, William D. Colburn (aka Schlake) wrote:
 > 
 > >Number:         55387
 > >Category:       misc
 > >Synopsis:       users LD_LIBRARY_PATH can interfere with mail buildworld
 > >Arrival-Date:   Fri Aug 08 09:30:16 PDT 2003
 > >Originator:     William D. Colburn (aka Schlake)
 > >Release:        FreeBSD 4.8-STABLE i386
 [snip]
 > >Fix:
 > 
 > Not having /usr/local/lib in your LD_LIBRARY_PATH is one fix, but I
 > think that the /usr/src/ build tree shouldn't get confused by things in
 > /usr/local/lib.  It probably shouldn't be using the users
 > LD_LIBRARY_PATH at all.
 
 Could you try the attached patch?  The first one is for -STABLE (the one
 referencing Makefile.inc1 rev. 1.141.2.63), the second one is for
 -CURRENT (Makefile.inc1 rev. 1.385).
 
 Offhand, I can't think of any reason for actually using the LD_LIBRARY_PATH
 value in the environment.  Of course, once we go down that road, there
 is LD_PRELOAD next, and then lots and lots of other environment variables
 influencing the compiler, the linker, make(1) itself, and whatnot, but
 still, IMHO LD_LIBRARY_PATH is indeed one variable that should be cleared.
 
 G'luck,
 Peter
 
 -- 
 Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
 PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 I've heard that this sentence is a rumor.
 
 ============== cut here for the patch to -STABLE
 
 Index: src/Makefile.inc1
 ===================================================================
 RCS file: /home/ncvs/src/Makefile.inc1,v
 retrieving revision 1.141.2.63
 diff -u -r1.141.2.63 Makefile.inc1
 --- src/Makefile.inc1	12 Jul 2003 23:25:29 -0000	1.141.2.63
 +++ src/Makefile.inc1	28 Aug 2003 13:42:59 -0000
 @@ -181,12 +181,14 @@
  		PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
  		GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
  		GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
 -		GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
 +		GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac \
 +		LD_LIBRARY_PATH=
  
  # bootstrap-tool stage
  BMAKEENV=	MAKEOBJDIRPREFIX=${WORLDTMP} \
  		DESTDIR= \
 -		INSTALL="sh ${.CURDIR}/tools/install.sh"
 +		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 +		LD_LIBRARY_PATH=
  BMAKE=		${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
  		-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
  		-DNO_WERROR
 @@ -194,7 +196,8 @@
  # build-tool stage
  TMAKEENV=	MAKEOBJDIRPREFIX=${OBJTREE} \
  		DESTDIR= \
 -		INSTALL="sh ${.CURDIR}/tools/install.sh"
 +		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 +		LD_LIBRARY_PATH=
  TMAKE=		${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
  
  # cross-tool stage
 
 ====================== end of the patch for -STABLE
 
 ====================== cut here for the patch for -CURRENT
 
 Index: src/Makefile.inc1
 ===================================================================
 RCS file: /home/ncvs/src/Makefile.inc1,v
 retrieving revision 1.385
 diff -u -r1.385 Makefile.inc1
 --- src/Makefile.inc1	25 Aug 2003 18:30:06 -0000	1.385
 +++ src/Makefile.inc1	28 Aug 2003 13:51:26 -0000
 @@ -202,14 +202,16 @@
  		CPUTYPE=${TARGET_CPUTYPE} \
  		GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
  		GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
 -		GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
 +		GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac \
 +		LD_LIBRARY_PATH=
  
  # bootstrap-tools stage
  BMAKEENV=	DESTDIR= \
  		INSTALL="sh ${.CURDIR}/tools/install.sh" \
  		PATH=${BPATH}:${PATH} \
  		WORLDTMP=${WORLDTMP} \
 -		MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
 +		MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
 +		LD_LIBRARY_PATH=
  BMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
  		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
  		BOOTSTRAPPING=${OSRELDATE} \
 
 =========================== end of the patch for -CURRENT

From: "William D. Colburn (aka Schlake)" <wcolburn@nmt.edu>
To: Peter Pentchev <roam@ringlet.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: misc/55387: users LD_LIBRARY_PATH can interfere with mail buildworld
Date: Tue, 26 Aug 2003 08:16:14 -0600

 It is the first day of classes, and over the weekend our dorms filled up
 with computers that had both worms and viruses.  So um, honestly, I
 probably can't try this patch out any time soon.  Sorry.
 
 On Thu, Aug 28, 2003 at 05:18:10PM +0300, Peter Pentchev wrote:
 >Could you try the attached patch?  The first one is for -STABLE (the one
 >referencing Makefile.inc1 rev. 1.141.2.63), the second one is for
 >-CURRENT (Makefile.inc1 rev. 1.385).
 >
 >Offhand, I can't think of any reason for actually using the LD_LIBRARY_PATH
 >value in the environment.  Of course, once we go down that road, there
 >is LD_PRELOAD next, and then lots and lots of other environment variables
 >influencing the compiler, the linker, make(1) itself, and whatnot, but
 >still, IMHO LD_LIBRARY_PATH is indeed one variable that should be cleared.
 >
 >G'luck,
 >Peter
 >
 >-- 
 >Peter Pentchev	roam@ringlet.net    roam@sbnd.net    roam@FreeBSD.org
 >PGP key:	http://people.FreeBSD.org/~roam/roam.key.asc
 >Key fingerprint	FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553
 >I've heard that this sentence is a rumor.
 >
 >============== cut here for the patch to -STABLE
 >
 >Index: src/Makefile.inc1
 >===================================================================
 >RCS file: /home/ncvs/src/Makefile.inc1,v
 >retrieving revision 1.141.2.63
 >diff -u -r1.141.2.63 Makefile.inc1
 >--- src/Makefile.inc1	12 Jul 2003 23:25:29 -0000	1.141.2.63
 >+++ src/Makefile.inc1	28 Aug 2003 13:42:59 -0000
 >@@ -181,12 +181,14 @@
 > 		PERL5LIB=${WORLDTMP}/usr/libdata/perl/5.00503 \
 > 		GROFF_BIN_PATH=${WORLDTMP}/usr/bin \
 > 		GROFF_FONT_PATH=${WORLDTMP}/usr/share/groff_font \
 >-		GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac
 >+		GROFF_TMAC_PATH=${WORLDTMP}/usr/share/tmac \
 >+		LD_LIBRARY_PATH=
 > 
 > # bootstrap-tool stage
 > BMAKEENV=	MAKEOBJDIRPREFIX=${WORLDTMP} \
 > 		DESTDIR= \
 >-		INSTALL="sh ${.CURDIR}/tools/install.sh"
 >+		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 >+		LD_LIBRARY_PATH=
 > BMAKE=		${BMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING \
 > 		-DNOHTML -DNOINFO -DNOMAN -DNOPIC -DNOPROFILE -DNOSHARED \
 > 		-DNO_WERROR
 >@@ -194,7 +196,8 @@
 > # build-tool stage
 > TMAKEENV=	MAKEOBJDIRPREFIX=${OBJTREE} \
 > 		DESTDIR= \
 >-		INSTALL="sh ${.CURDIR}/tools/install.sh"
 >+		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 >+		LD_LIBRARY_PATH=
 > TMAKE=		${TMAKEENV} ${MAKE} -f Makefile.inc1 -DBOOTSTRAPPING
 > 
 > # cross-tool stage
 >
 >====================== end of the patch for -STABLE
 >
 >====================== cut here for the patch for -CURRENT
 >
 >Index: src/Makefile.inc1
 >===================================================================
 >RCS file: /home/ncvs/src/Makefile.inc1,v
 >retrieving revision 1.385
 >diff -u -r1.385 Makefile.inc1
 >--- src/Makefile.inc1	25 Aug 2003 18:30:06 -0000	1.385
 >+++ src/Makefile.inc1	28 Aug 2003 13:51:26 -0000
 >@@ -202,14 +202,16 @@
 > 		CPUTYPE=${TARGET_CPUTYPE} \
 > 		GROFF_BIN_PATH=${WORLDTMP}/legacy/usr/bin \
 > 		GROFF_FONT_PATH=${WORLDTMP}/legacy/usr/share/groff_font \
 >-		GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac
 >+		GROFF_TMAC_PATH=${WORLDTMP}/legacy/usr/share/tmac \
 >+		LD_LIBRARY_PATH=
 > 
 > # bootstrap-tools stage
 > BMAKEENV=	DESTDIR= \
 > 		INSTALL="sh ${.CURDIR}/tools/install.sh" \
 > 		PATH=${BPATH}:${PATH} \
 > 		WORLDTMP=${WORLDTMP} \
 >-		MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}"
 >+		MAKEFLAGS="-m ${.CURDIR}/tools/build/mk ${.MAKEFLAGS}" \
 >+		LD_LIBRARY_PATH=
 > BMAKE=		MAKEOBJDIRPREFIX=${WORLDTMP} \
 > 		${BMAKEENV} ${MAKE} -f Makefile.inc1 \
 > 		BOOTSTRAPPING=${OSRELDATE} \
 >
 >=========================== end of the patch for -CURRENT
 
 --
 William Colburn, "Sysprog" <wcolburn@nmt.edu>
 Computer Center, New Mexico Institute of Mining and Technology
 http://www.nmt.edu/tcc/     http://www.nmt.edu/~wcolburn
State-Changed-From-To: open->feedback 
State-Changed-By: arundel 
State-Changed-When: Wed Nov 24 01:39:59 UTC 2010 
State-Changed-Why:  
We need to check whether LD_LIBRARY_PATH (and maybe LD_PRELOAD too) can still 
have an effect on TARGETS in /usr/src. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=55387 
State-Changed-From-To: feedback->open 
State-Changed-By: eadler 
State-Changed-When: Tue Nov 13 20:50:37 UTC 2012 
State-Changed-Why:  
feedback is the wrong state 

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