Operating System - HP-UX
1851856 Members
4128 Online
104062 Solutions
New Discussion

Re: SHLIB_PATH ignored and chatr

 
SOLVED
Go to solution
Roberto Martinez_6
Frequent Advisor

SHLIB_PATH ignored and chatr

Hi, I've an old executable which has been migrated to a new server. the executable (32 bit) has references to an external library, which in the new system is in other directory. the output of ldd is (I have replaced the real names by examples):
ldd
/usr/lib/libc.2 => /usr/lib/libc.2
/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/libnss_dns.1 => /usr/lib/libnss_dns.1
/usr/lib/libdld.2 => /usr/lib/libdld.2
/usr/lib/libpthread.1 => /usr/lib/libpthread.1
/usr/lib/librt.2 => /usr/lib/librt.2
/usr/lib/dld.sl: Can't open shared library: /path/to/old/oracle/installation/lib//libclntsh.sl.8.0
/usr/lib/dld.sl: No such file or directory

I've tried with

chat +s enable and defined and exported SHLIB_PATH.
The output of the chatr command is:

chatr(error): dl_header_ext.size != sizeof(dl_header_ext). Please update your version of the chatr tool.
serverSQL:
current values:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled first
embedded path disabled second Not Defined
shared library list:
static /path/to/old/oracle/installation/lib//libclntsh.sl.8.0
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libnss_dns.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libc.2
shared library binding:
immediate
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)
new values:
shared executable
shared library dynamic path search:
SHLIB_PATH enabled second
embedded path disabled first Not Defined
shared library list:
static /logiciel/oracle/oracle_817/lib//libclntsh.sl.8.0
dynamic /usr/lib/librt.2
dynamic /usr/lib/libpthread.1
dynamic /usr/lib/libnss_dns.1
dynamic /usr/lib/libdld.2
dynamic /usr/lib/libc.2
shared library binding:
immediate
global hash table disabled
plabel caching disabled
global hash array size:1103
global hash array nbuckets:3
shared vtable support disabled
static branch prediction disabled
executable from stack: D (default)
kernel assisted branch prediction enabled
lazy swap allocation disabled
text segment locking disabled
data segment locking disabled
third quadrant private data space disabled
fourth quadrant private data space disabled
data page size: D (default)
instruction page size: D (default)


There are some things I've seen:

First, chatr returns an error asking to update chatr version. The system is factory preinstalled with B.11.11 version. Second, it seems that the old executable has an absolute path recorded. there's a double slash on the path to the oracle lib. Third, in the "current values", there's SHLIB_PATH enabled first, and in "new values", SHLIB_PATH enabled second.(??)

Has anyone had this problem before? have you got any hints? Thanks in advance.
It wasn't me
6 REPLIES 6
Eric Antunes
Honored Contributor

Re: SHLIB_PATH ignored and chatr

Roberto Martinez_6
Frequent Advisor

Re: SHLIB_PATH ignored and chatr

I've had already read them, but apparently they got to work with the chatr +s. My problem is that even with the rigth enable/disable schema (see chatr output), ld still does not find the offending library...
It wasn't me
Eric Antunes
Honored Contributor

Re: SHLIB_PATH ignored and chatr

Hi again,

Post the following (with Oracle user):

$echo $SHLIB_PATH
$echo $LD_LIBRARY_PATH (or $LIBRARY_PATH)
$echo $PATH

Regards,

Eric Antunes
Each and every day is a good day to learn.
Dave Hutton
Honored Contributor

Re: SHLIB_PATH ignored and chatr

Do you have this patch installed?
# PHSS_30970 ld(1) and linker tools cumulative patch

I've had some really odd things happening with this patch installed on 11.11 servers (and 11.0 with it's equiv patch). It tends to happen with old applications (probably 32 bit ones at that).
Where I noticed it is if the suid bit is on the file it tends to break, making it seem like the the SHLIB_PATH is getting ignored. You didn't state anything about that. But the symptoms are kind of what your describing.

I've seen it where we moved one application from an older server to a new one, where it's broken on the move. Removing this patch cleared it up. In the other instance it was an exsisting server with app where I applied this patch (11.0 server eqiv of the patch) and it broke it too.

Ermin Borovac
Honored Contributor
Solution

Re: SHLIB_PATH ignored and chatr

SHLIB_PATH is ignored because libclntsh.sl.8.0 is specified using absolute pathwhen program was linked.

static /path/to/old/oracle/installation/lib//libclntsh.sl.8.0

Keyword "static" indicates this library is not subject to run-time path lookup,so SHLIB_PATH is ignored.

# chatr -l /path/to/old/oracle/installation/lib//libclntsh.sl.8.0

This will enable run-time path lookup for libclntsh.sl.8.0, so SHLIB_PATH should work.
Roberto Martinez_6
Frequent Advisor

Re: SHLIB_PATH ignored and chatr

Ermin hit right on the spot. after the chatr -l, the library is stated as dynamic, and SHLIB_PATH lookups works ok.
Thank you all for your help.
It wasn't me