JDK-4093577 : LD_LIBRARY_PATH got munched executing javac script (not the wrapper)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.1.4,1.1.5,1.2.0
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_2.5.1,solaris_2.6
  • CPU: sparc
  • Submitted: 1997-11-18
  • Updated: 2012-10-08
  • Resolved: 1998-01-27
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
1.2.0 1.2beta3Fixed
Related Reports
Duplicate :  
Duplicate :  
Duplicate :  
Description
From timsia@single Mon Nov 17 12:42:26 1997
Date: Mon, 17 Nov 1997 12:42:24 -0800
From: timsia@single (Tim Sia)
To: anandp@single
Cc: dbowen@single, rkarim@single, sgw@single, timsia@single
Subject: A bug in JDK1.2 javac.sh

Hi Anand,

I sent out an email late last week regarding the problem I have in the process
building the javaos on top of jdk1.2.

The problem happened while I was trying to make the filizer.

It turned out that the problem was caused by this script

/usr/local/java/jdk1.2beta1/solaris/bin/sparc/green_threads/javac

If I take version 1.15 of that file then my build will continue.

I came up with a simpler scenario to reproduce the problem as follows:

set the LD_LIBRARY_PATH variable 

arjuna<home/timsia>$ LD_LIBRARY_PATH=/usr/local/java/jdk1.2beta1/solaris/lib/sparc/green_threads:/usr/local/java/jdk1.2beta1/solaris/lib/sparc:/opt/SUNWspro/lib:/usr/openwin/lib
arjuna<home/timsia>$ export LD_LIBRARY_PATH
arjuna<home/timsia>$ echo $LD_LIBRARY_PATH
/usr/local/java/jdk1.2beta1/solaris/lib/sparc/green_threads:/usr/local/java/jdk1.2beta1/solaris/lib/sparc:/opt/SUNWspro/lib:/usr/openwin/lib


then run the /usr/local/java/jdk1.2beta1/solaris/bin/sparc/green_threads/javac

arjuna<home/timsia>$ /usr/local/java/jdk1.2beta1/solaris/bin/sparc/green_threads/javac
ld.so.1: /usr/local/java/jdk1.2beta1/solaris/bin/sparc/green_threads/java: fatal: libjvm.so: can't open file: errno=2
/usr/local/java/jdk1.2beta1/solaris/bin/sparc/green_threads/javac[11]: 28197 Killed


Somehow the LD_LIBRARY_PATH got munched not to include the 
/usr/local/java/jdk1.2beta1/solaris/lib/sparc/green_threads

arjuna<home/timsia>$ ls -l /usr/local/java/jdk1.2beta1/solaris/lib/sparc/green_threads/libjvm.so
-rwxr-xr-x   1 drumm    green     674596 Oct 21 02:21 /usr/local/java/jdk1.2beta1/solaris/lib/sparc/green_threads/libjvm.so




If I use version 1.15 of javac.sh and version 1.1.1.1 of .extract_args
the javac runs all right.

Do you want me to file a bug or has there been a bug opened against jdk 1.2 javac
already ?

Thanks.

-Tim



========================
Tom,  

	is it really the case that 1.2 is "useless" on a sparc?

imustafa
	why is this bug so critical?

roger.calnan@Eng 1998-01-23

It appears that for ksh users that set their LD_LIBRARY_PATH in a file which is executed every time ksh runs, the wrapper scripts won't work right, because the LD_LIBRARY_PATH setting keeps getting blown away.  I think this can be fixed by passing the -p option to /bin/ksh at the beginning of all the wrapper scripts.  I tested this using timsia's .files and was able to reproduce the problem and the fix also seemed to fix it.  I'm not really a ksh guru so I don't know what all the ramifications are for this but it's a genuine problem.
tom.rodriguez@Eng 1998-01-23

I'm reopening this because another user reports that it happens in previous versions, i.e. 1.1.7. I was unable to verify this however.
gstone@eng 1999-03-10

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: generic FIXED IN: 1.2beta3 INTEGRATED IN: 1.2beta3
14-06-2004

WORK AROUND get earlier version of the javac script
11-06-2004

PUBLIC COMMENTS Reopened for 1.1.7.
10-06-2004

EVALUATION The wrapper scripts use ksh which for users of ksh may cause problems because it may end up sourcing arbitrary files during it's startup. Our wrappers rely on things like the LD_LBIRARY_PATH not getting destroyed for the to work. I think this can be fixed by changing the "#!/bin/ksh" to "#!/bin/ksh -p" so that the users .profile file isn't sourced during startup of ksh. tom.rodriguez@Eng 1998-01-23 I've changed the scripts to use ksh -p so that $ENV isn't read by the shell scripts during startup, which seems to fix the problem. tom.rodriguez@Eng 1998-01-27
23-01-1998