Operating System - HP-UX
1833415 Members
3524 Online
110052 Solutions
New Discussion

dlopen() broken by OS patches required by Java 1.4 ?

 
SOLVED
Go to solution
Harri Pasanen_1
Advisor

dlopen() broken by OS patches required by Java 1.4 ?

We hava some code that was passing various mode flags to dlopen().

This started failing after Java 1.4 was installed to the machines, with subtly different failures for HP-UX 11.11 and HP-UX 11.0 machines.

The former now even refuses mode = RTLD_LAZY | RTLD_NODELETE

The later takes that ok, but was also refusing RTLD_GROUP.

I wonder if this is a known problem?

Regards,

Harri
10 REPLIES 10
ranganath ramachandra
Esteemed Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

what version of dld.sl do you have ? what do "what /usr/lib/dld.sl" and "what /usr/lib/pa20_64/dld.sl" say ?
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Harri Pasanen_1
Advisor

Re: dlopen() broken by OS patches required by Java 1.4 ?

On the HP-UX 11.00 box:

$ what /usr/lib/dld.sl
/usr/lib/dld.sl:
SMART_BIND
92453-07 dld dld dld.sl B.11.36 030403
$ what /usr/lib/pa20_64/dld.sl
/usr/lib/pa20_64/dld.sl:
92453-07 linker command s800.sgs dld PA64 B.11.36 PBO 030403

On HP-UX 11.11 box:

bash-2.05a$ what /usr/lib/dld.sl
/usr/lib/dld.sl:
SMART_BIND
92453-07 dld dld dld.sl B.11.33 020617
bash-2.05a$ what /usr/lib/pa20_64/dld.sl
/usr/lib/pa20_64/dld.sl:
92453-07 linker command s800.sgs dld PA64 B.11.33 REL 020603

Note that the code in question is 32 bit code.
ranganath ramachandra
Esteemed Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

this patch (PHSS_28434/PHSS_28436) breaks the 32-bit dld's dlopen functionality when embedded shared library paths are involved. i think it should be recalled soon.

is there anything specific that made you think its something to do with the modes ?
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

for 11.11, the PHSS_26560 dld.sl also has LD_PRELOAD functionality.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Steven E. Protter
Exalted Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

I'll be honest with you. I don't think java 1.4 is ready for prime time. I installed it on my sand box and had lots of problems and backed it off.

If java 1.3 will work for you, you might want to consider going with that. As of my last check, oracle wasn't certified with java 1.4 anyway.

Just something to consider.

For any version of java you must have all the required patches installed prior to installation of java.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Harri Pasanen_1
Advisor

Re: dlopen() broken by OS patches required by Java 1.4 ?

To ranganath:

Well, the mode proved to be the problem, because the following code started to fail, dlerror() reporting "invalid flags to dlopen()"

int mode = RTLD_LAZY;

#ifdef RTLD_LOCAL
mode |= RTLD_LOCAL;
#endif
#ifdef RTLD_NODELETE
mode |= RTLD_NODELETE;
#endif

void *handle = dlopen (path.chars (), mode);
if(!handle)
{
cerr << dlerror() << endl;
}

Note that the flags above still passed for our HP-UX 11.00 machine with its patches, but failed on HP-UX 11.11.



ranganath ramachandra
Esteemed Contributor
Solution

Re: dlopen() broken by OS patches required by Java 1.4 ?

for those modes you need PHSS_28436 on the 11.11 box.

in the 32-bit dld, RTLD_NODELETE, RTLD_WORLD,RTLD_GROUP,RTLD_PARENT,RTLD_SELF and RTLD_DEFAULT were implemented only recently, for B.11.36 (PHSS_28434 for 11.00 and PHSS_28436 fro 11.11).

i'm sorry i didnt notice this earlier. you have the latest dld.sl on your 11.00 box and not on the 11.11 box.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

ranganath ramachandra
Esteemed Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

well it turns out that among all that i mentioned, its only RTLD_NODELETE that is available in the 32-bit dld even as of the latest 11.36, so i was not entirely correct.
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo

Harri Pasanen_1
Advisor

Re: dlopen() broken by OS patches required by Java 1.4 ?

Ok, I got it. Some patch (how do I find out which?) has updated /usr/include/dlfcn.h and new flags are now available. So even if our code has not changed directly, the conditional defines got new flags available and things started failing on other machines with older patches.

Btw. for some reason the new HP-UX dlopen() does not like RTLD_GROUP | RTLD_WORLD, which is actually the default on Solaris. I guess the meaning of these flags is crystal clear only to few people...
ranganath ramachandra
Esteemed Contributor

Re: dlopen() broken by OS patches required by Java 1.4 ?

RTLD_WORLD,RTLD_GROUP,RTLD_PARENT,RTLD_SELF and RTLD_DEFAULT were implemented for 64-bit for 11.36. thats how they appear in dlfcn.h.

you can post your suggestions/requirements on the hpux-devtools mailing list, where more hpux developers (and the linker/loader team including me) can discuss about them. thanks!
 
--
ranga
hp-ux 11i v3[i work for hpe]

Accept or Kudo