Operating System - HP-UX
1823250 Members
3279 Online
109648 Solutions
New Discussion юеВ

LD_PRELOAD affect on JVM running pure java code

 
Donald Dylla
New Member

LD_PRELOAD affect on JVM running pure java code

I have been trying to track down a problem that only occurs on hp/ux, where my JVM core dumps when running pure java code (java myapp, where myapp never runs native code). I set LD_PRELOAD=/libjsig.sl even though it did not seem like it was needed based upon the documentation and the problem appears to have gone away. Could this indeed have fixed the problem?
5 REPLIES 5
ranganath ramachandra
Esteemed Contributor

Re: LD_PRELOAD affect on JVM running pure java code

i got the following response from the jvm team. the email address to reach them for further queries is javaguru @ cup.hp.com.

the patch mentioned is the linker / loader patch that supports LD_PRELOAD functionality (which i guess you already have). the latest linker/loader patches are PHSS_28869 for 11.00 and PHSS_28871 for 11.11.

----

The user might be facing a scenario as below :-
1.4 has a new feature for chaining an application's signal handlers behind the JVM's signal handlers. With signal chaining functionality, applications can now use signals that the JVM uses and not interfere with the JVM's functionality. To obtain this functionality, you need to install a patch (described below).

For signal chaining functionality, the application must load the library libjsig.sl before libc.2. libjsig.sl takes care of signal chaining when the application's signal handlers are installed before or after the VM's handlers get installed. libjsig.sl is not needed when the application installs the handlers before the JVM installs its handlers. There are two cases to consider.

1. Native application creates a JVM:
The application can either link in libjsig.sl and ensure that libjsig.sl gets loaded before libc.2 by linking them in the right order or use the LD_PRELOAD functionality provided by the linker to load libjsig.sl first.

2. Normal JAVA application invoked from the command line:
LD_PRELOAD must be used in this case. Linking the native libraries with libjsig will not work because the JVM will load libc.2 before the application's shared libraries get loaded.

For example, to use the LD_PRELOAD environment variable:
export LD_PRELOAD=/libjsig.sl; java_application (k sh)
setenv LD_PRELOAD=/libjsig.sl; java_application (c sh)
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Donald Dylla
New Member

Re: LD_PRELOAD affect on JVM running pure java code

Thanks for your response. My problem is solved.

I am actually fairly surprised that I needed to set this flag just to run pure java code. I did not think that signals could be handled in java code and thought that the release note only applied to applications that utilized some native code.

Any idead what methods cannot be called safely without setting LD_PRELOAD?
ranganath ramachandra
Esteemed Contributor

Re: LD_PRELOAD affect on JVM running pure java code

libjsig.sl needs to be preloaded only in the case of applications which install their own signal handlers.

 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Donald Dylla
New Member

Re: LD_PRELOAD affect on JVM running pure java code

I landed up getting caught off guard with this one. Although my application does not install a signal handler, it uses some Tomcat and Axis jars that must. Do you know of any way of examining a jar to see if any of its classes might install a signal handler?
ranganath ramachandra
Esteemed Contributor

Re: LD_PRELOAD affect on JVM running pure java code

i am not aware of how to check a jar file for this, i guess you will have to check with the vendors.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo