Operating System - HP-UX
1753808 Members
8437 Online
108805 Solutions
New Discussion юеВ

Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

 
Yunshu
New Member

Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi,

I am writing a native application that loads jvm library dynamically. It is working for jdk.1.4.2. However, when I try to port to java1.5, I got the following error even after I set the LD_PRELOAD (following the advice from: http://www.hp.com/products1/unix/java/java2/jdkjre5_0/infolibrary/jdk_rnotes_5.0.html#TLS)

>set LD_PRELOAD=/export/home/root/java1.5/jre/lib/PA_RISC20/server/libjvm.sl

>
.aCC runtime: Error 215 from shl_findsym(/export/home/root/java1.5/jre/lib/PA_RISC20/server/libjvm.sl,_shlInit)
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /export/home/root/java1.5/jre/lib/PA_RISC20/server/libjvm.sl
/usr/lib/dld.sl: Exec format error
Abort(coredump)

Another even more strange thing is, after I set the LD_PRELOAD, I will get the following error even for simple commands like ls:
/usr/lib/dld.sl: Unresolved symbol: _edata (data) from /export/home/root/java1.5/jre/lib/PA_RISC20/server/libjvm.sl
/usr/lib/dld.sl: Unresolved module for symbol: __shlinit (code) from /usr/lib/libCsup.2


When I run >ldd -r ./libjvm.sl
I got the following result:
/usr/lib/libCsup.2 => /usr/lib/libCsup.2
/usr/lib/libcl.2 => /usr/lib/libcl.2
/usr/lib/libisamstub.1 => /usr/lib/libisamstub.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libc.2 => /usr/lib/libc.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/librt.2 => /usr/lib/librt.2
/usr/lib/libm.2 => /usr/lib/libm.2
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
symbol not found: _SYSTEM_ID (/usr/lib/libc.2)
symbol not found: _end (/usr/lib/libc.2)
symbol not found: _SYSTEM_ID (/usr/lib/libCsup.2)
symbol not found: _SYSTEM_ID (/usr/lib/libcl.2)
symbol not found: __dld_loc (/usr/lib/libcl.2)
symbol not found: __dld_loc (/usr/lib/libdld.2)
symbol not found: _edata (./libjvm.sl)

>uname -a
HP-UX pompeii B.11.11 U 9000/785 2015658734 unlimited-user license

Any idea why this is happening?

Thanks in advance!

Yunshu
8 REPLIES 8
Eric Antunes
Honored Contributor

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi Yunshu,

There's lot of stories like yours on ITRC:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=749817

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=150094

And so one...

Eric
Each and every day is a good day to learn.
Yunshu
New Member

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi Eric,

Thanks for the reply. In fact, I have no problem to load libjvm.sl for jdk1.4.2 and below. The problem only occured for java1.5.

Today, I tried to simplify the problem by using the sample problem and env setting provided by HP in:
http://www.hp.com/products1/unix/java/infolibrary/prog_guide/JNI_java2.html#DynamicHotspot

And I got the following error:
pompeii:/export/home/usr/dynlib> echo $LD_PRELOAD
/export/home/usr/java1.5/jre/lib/PA_RISC2.0/hotspot/libjvm.sl
pompeii:/export/home/usr/dynlib> echo $SHLIB_PATH
/export/home/usr/java1.5/jre/lib/PA_RISC2.0/hotspot:/export/home/usr/java1
.5/jre/lib/PA_RISC2.0
pompeii:/export/home/usr/dynlib> ./loadjvm
aCC runtime: Error 215 from shl_findsym(/export/home/usr/java1.5/jre/lib/PA_R
ISC2.0/hotspot/libjvm.sl,_shlInit)
/usr/lib/dld.sl: Can't shl_load() a library containing Thread Local Storage: /ex
port/home/usr/java1.5/jre/lib/PA_RISC2.0/hotspot/libjvm.sl
/usr/lib/dld.sl: Exec format error
Abort(coredump)

pompeii:/export/home/usr/dynlib> ls
/usr/lib/dld.sl: Unresolved symbol: _edata (data) from /export/home/usr/java
1.5/jre/lib/PA_RISC2.0/hotspot/libjvm.sl
/usr/lib/dld.sl: Unresolved module for symbol: __shlinit (code) from /usr/lib/l
ibCsup.2
Abort(coredump)

The error for "ls" only goes away after I unset the LD_PRELOAD.

Thanks!

Yunshu
Eric Antunes
Honored Contributor

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi again,

Did you checked for new patches for this new Java release? There is a new Pthread patch: PHCO_30544...

Regards,

Eric Antunes
Each and every day is a good day to learn.
Yunshu
New Member

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Yes, just checked. We have all the patches installed. :-(
Eric Antunes
Honored Contributor

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi Yunshu,

Check this thread with a "aCC runtime: Error 215 from shl_findsym..." like yours:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=62633

Regards,

Eric Antunes
Each and every day is a good day to learn.
Ermin Borovac
Honored Contributor

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Since you must use LD_PRELOAD to load libjvm.sl, why don't you just link it directly to your program?

$ aCC -z -o prog prog.o -L$JAVA_HOME/jre/lib/PA_RISC2.0/hotspot -ljvm
Eric Antunes
Honored Contributor

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi again,

One more thread with this "aCC runtime: Error 215 from shl_findsym " issue:

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=698024

Regards,

Eric
Each and every day is a good day to learn.
Yunshu
New Member

Re: Java1.5 on HP-UX 11.11: failed to load libjvm.sl even after LD_PRELOAD is defined

Hi,

Received an answer from HP support, it is a bug in java 1.5. They provided a workaround:
->chatr +s enable -B deferred -B nonfatal

I have tested the workaround, it works.

Thanks for the help.