JDK-4445172 : Linux: Fatal: JVM can not locate libpthread.so!
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 1.3.1
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2001-04-13
  • Updated: 2012-10-08
  • Resolved: 2001-04-23
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 Other
1.3.1 rc2Fixed 1.4.0Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Description
Name: boT120536                 Date: 04/13/2001


Fatal: JVM can not locate libpthread.so!
Aborted (core dumped)


I cannot run java programs at all!
I have downloaded JDK 1.3.1 for Linux (Redhat 7.0 with updates, eg
kernel-2.2.17-14, glibc-2.2-12) and changed the PATH as shown below. Running
most of the demo applets in Netscape work. However the JFC apps fail, as shown
in the commands and responses below.

Why can libpthread not be found by java or by find?
Thanks in advance. Sorry if its obvious. I have d/l'ed adn followed the
installation instructions in the doco.


$ cd /usr/java/jdk1.3.1/demo/jfc/Notepad
$ ll
total 52
-rw-r--r--    1 root     bin         39908 Apr  2 06:37 Notepad.jar
-r--r--r--    1 root     bin            58 Apr  2 06:37 README.txt
drwxr-xr-x    2 root     bin          4096 Apr 13 10:59 resources
drwxr-xr-x    2 root     bin          4096 Apr 13 10:59 src
$ java -jar Notepad.jar
Fatal: JVM can not locate libpthread.so!
Aborted
$ cd /usr/java
$ find . -name libpthread.so -print
$ echo $PATH
/usr/java/jdk1.3.1/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/bin:/opt/bin:/usr/X11R6/bin

Notes:
java -version gives the same output

I DO have a file
/lib/libpthread-0.9.so

Link
/lib/libpthread.so.0
points to the aboove file

(Review ID: 120725)
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: ladybird-rc2 FIXED IN: ladybird-rc2 merlin-beta merlin-beta2 INTEGRATED IN: ladybird-rc2 merlin-beta merlin-beta2
14-06-2004

SUGGESTED FIX Instead of dlopen("libpthread.so", RTLD_LAZY), use 'dlopen(NULL, RTLD_LAZY)' hui.huang@Eng 2001-04-16
16-04-2001

WORK AROUND 1. find where the real pthread library is, e.g. /lib/libpthread-0.9.so, 2. su root, 3. cd /usr/lib 4. ln -s /lib/libpthread-0.9.so libpthread.so replace "/lib/libpthread-0.9.so" in the above command with the real path you found in step 1. hui.huang@Eng 2001-04-13
13-04-2001

EVALUATION This is the unfortunate result of fix for 4415774. In order to let Java run on floating stack Linux, we have to use a new function (pthread_getattr_np) included in glibc-2.2.3. But the function is not present in libpthread before that glibc version. So we are forced to dlopen("libpthread.so") and dlsym("pthread_getattr_np"). /usr/lib/libpthread.so is normally a symbolic link to the real libpthread library. If the symbolic link is not created during Linux installation, Java will fail with this error message. User can get around the problem using the method suggested in the workaround section. But we will be looking for a better way to dlopen() pthread library. hui.huang@Eng 2001-04-13 ------------------------------------ use "dlopen(NULL, RTLD_LAZY)" to fix the bug. hui.huang@Eng 2001-04-20
13-04-2001