Operating System - HP-UX
1753797 Members
7317 Online
108799 Solutions
New Discussion юеВ

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

 
AmitNNM
Occasional Advisor

Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

Hello,

On hp-ux 11.11 machine, when i start my application it crashes at the start with error message
aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__shlInit)

But same application runs fine on another hp-ux 11.11 box without any failure.

Is something(patch) missing on first box, which is required for this hp-ux linker & loader calls.

Please advice.

Regards,
Amit
11 REPLIES 11
Suraj K Sankari
Honored Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

Dennis Handly
Acclaimed Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

>Is something (patch) missing on first box, which is required for this hp-ux linker & loader calls.

Most likely. You should install the latest linker/dld patch:
http://www.itrc.hp.com/service/patch/patchDetail.do?patchid=PHSS_39749

It looks like the URL Suraj mentioned except there wasn't a solution.
Typically you don't get errno 22 on shl_findsym nor do you get any error on /usr/lib/libstd.2.

The whole reason I added the error message was to tell you what was going wrong.
AmitNNM
Occasional Advisor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh


Thanks Dennis & Suraj for your responses.

The machine has the patch PHSS_39749 installed on it.I guess this is the latest patch also.

do any existing other patches cause this error ?

Regards,
Amit
Dennis Handly
Acclaimed Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

>do any existing other patches fix this error?

Not sure. Do you have the latest aC++ runtime?
http://itrc.hp.com/service/patch/patchDetail.do?patchid=PHSS_33946

You may have to use tusc to find out where that EINVAL is occurring.
AmitNNM
Occasional Advisor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

Hi,

Following is the tail part of the tusc output. Please advice.

========================================================================================================
stat("/usr/lib/libcl.sl", 0x7f7f3f30) .............................................................................................. = 0
open("/usr/lib/libcl.sl", O_RDONLY, 0) ............................................................................................. = 3
fstat(3, 0x7f7f4188) ............................................................................................................... = 0
read(3, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ................................................................................. = 128
lseek(3, 128, SEEK_SET) ............................................................................................................ = 128
read(3, "10\0\004\0\0\0( \019" < \0\010\0".., 48) .................................................................................. = 48
read(3, "80\0\0\v\0\0\004\0\0\0\0", 12) ............................................................................................ = 12
mmap(NULL, 1650688, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 454656) .......................................................... = 0xc3f00000
mmap(NULL, 40960, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_SHLIB, -1, 0) ...................................... = 0x7af83000
mmap(0x7af67000, 114688, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_FIXED|MAP_SHLIB, 3, 2105344) .............................. = 0x7af67000
mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) ................................................. = 0x7af65000
close(3) ........................................................................................................................... = 0
mmap(NULL, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) ................................................. = 0x7af63000
stat("/usr/lib/libisamstub.1", 0x7f7f40f0) ......................................................................................... = 0
open("/usr/lib/libisamstub.1", O_RDONLY, 0) ........................................................................................ = 3
fstat(3, 0x7f7f4348) ............................................................................................................... = 0
read(3, "0210010e0512@ \0\0\0\0\0\0\0\0\0".., 128) ................................................................................. = 128
lseek(3, 128, SEEK_SET) ............................................................................................................ = 128
read(3, "10\0\004\0\0\0( \0\0\n\f\0\010\0".., 48) .................................................................................. = 48
read(3, "80\0\001\0\0\0 9 2 4 5 ", 12) ............................................................................................ = 12
mmap(NULL, 4096, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 3, 4096) ............................................................... = 0xc0008000
mmap(NULL, 4096, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_SHLIB, 3, 8192) ................................................... = 0x7af62000
close(3) ........................................................................................................................... = 0
stat("/usr/lib/libdld.2", 0x7f7f40f0) .............................................................................................. = 0
open("/usr/lib/libdld.2", O_RDONLY, 0) ............................................................................................. = 3
fstat(3, 0x7f7f4348) ............................................................................................................... = 0
close(3) ........................................................................................................................... = 0
sysconf(_SC_THREAD_THREADS_MAX) .................................................................................................... = 1100
sysconf(_SC_THREAD_KEYS_MAX) ....................................................................................................... = 256
sysconf(_SC_THREAD_STACK_MIN) ...................................................................................................... = 4096
mpctl(MPC_GETNUMSPUS_SYS, 0, 0) .................................................................................................... = 4
getpid() ........................................................................................................................... = 25599 (25598)
sched_get_priority_max(SCHED_HPUX) ................................................................................................. = -129
sched_get_priority_min(SCHED_HPUX) ................................................................................................. = -256
sysconf(0x4c2e) .................................................................................................................... = -1
sysconf(_SC_GANG_SCHED) ............................................................................................................ = 1
sysconf(_SC_CPU_VERSION) ........................................................................................................... = 532
brk(0x40030958) .................................................................................................................... = 0
brk(0x40032940) .................................................................................................................... = 0
brk(0x40040000) .................................................................................................................... = 0
sigprocmask(SIG_BLOCK, 0x7f7f3b88, 0x7f7f3ba8) ..................................................................................... = 0
_lwp_mutex_unlock(0x7f7f3bcc) ...................................................................................................... = EINVAL
sigprocmask(SIG_SETMASK, 0x7f7f3ba8, NULL) ......................................................................................... = 0
sigprocmask(SIG_BLOCK, 0x7f7f3b78, 0x7f7f3b98) ..................................................................................... = 0
_lwp_mutex_init2(0x7f7f3c0c, 0x1, NULL) ............................................................................................ = 0
sigprocmask(SIG_SETMASK, 0x7f7f3b98, NULL) ......................................................................................... = 0
_lwp_self() ........................................................................................................................ = 1016546
sysconf(_SC_PAGE_SIZE) ............................................................................................................. = 4096
getrlimit(RLIMIT_STACK, 0x7f7f3c1c) ................................................................................................ = 0
set_userthreadid(1) ................................................................................................................ = 0
sysconf(_SC_CCNUMA_PM) ............................................................................................................. = 1
mpctl(MPC_GETLWP_BINDVALUE, 0, -4) ................................................................................................. = 104
_lwp_getscheduler(LWP_SCHED_SPECIFIC, 1016546, 0x40033870, 0x40033874) ............................................................. = 0
sigprocmask(SIG_BLOCK, NULL, 0x4003383c) ........................................................................................... = 0
ksleep(0, NULL, NULL, NULL) ........................................................................................................ = EINVAL
sysconf(_SC_THREAD_KEYS_MAX) ....................................................................................................... = 256
sigsetreturn(0x7af8ffbe, 0x6211988, 1392) .......................................................................................... = 0
write(2, "a C C r u n t ", 8) .................................................................................................... = 8
write(2, "i ", 1) .................................................................................................................. = 1
write(2, "m e : E r r o ", 8) .................................................................................................... = 8
write(2, "r ", 1) .................................................................................................................. = 1
write(2, " 2 2 f r o m ", 8) .................................................................................................... = 8
write(2, " ", 1) .................................................................................................................. = 1
write(2, "s h l _ f i n d ", 8) .................................................................................................... = 8
write(2, "s ", 1) .................................................................................................................. = 1
write(2, "y m ( / u s r / ", 8) .................................................................................................... = 8
write(2, "l i b / l i b s ", 8) .................................................................................................... = 8
write(2, "t d . 2 ", 4) ............................................................................................................ = 4
write(2, ", _ s h l I n i ", 8) .................................................................................................... = 8
write(2, "t ", 1) .................................................................................................................. = 1
write(2, ") \n", 2) ................................................................................................................ = 2
sigprocmask(SIG_UNBLOCK, NULL, 0x7f7f1b28) ......................................................................................... = 0
sigsetreturn(0x7af8ffbe, 0x6211988, 1392) .......................................................................................... = 0
sigaction(SIGABRT, NULL, 0x7f7f1b48) ............................................................................................... = 0
close(1) ........................................................................................................................... = 0
sigprocmask(SIG_BLOCK, 0x7f7f1b28, NULL) ........................................................................................... = 0
sigaction(SIGABRT, 0x7f7f1b48, NULL) ............................................................................................... = 0
sigprocmask(SIG_UNBLOCK, 0x7f7f1b28, NULL) ......................................................................................... = 0
getpid() ........................................................................................................................... = 25599 (25598)
Received signal 6, SIGABRT, in kill(), [SIG_DFL], no siginfo
kill(6, SIGABRT) ................................................................................................................... [entry]
exit(6) [implicit (kill failure)] .................................................................................................. WIFSIGNALED(SIGABRT)|WCOREDUMP

=========================================================================================================================
Dennis Handly
Acclaimed Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

>Following is the tail part of the tusc output.

The part you removed is before this? And nothing after?

In my simple test case I got this ordering for opens:
open("/usr/lib/dld.sl", O_RDONLY, 010670) ........ = 4
open("/opt/graphics/OpenGL/lib/libogltls.sl", O_RDONLY, 0200) = 4
open("/usr/lib/libdld.2", O_RDONLY, 0200) ........ = 4
open("/usr/lib/libc.2", O_RDONLY, 0200) .......... = 4
open("/usr/lib/libcl.2", O_RDONLY, 0200) ......... = 4
open("/usr/lib/libisamstub.1", O_RDONLY, 0200) ... = 4
open("/usr/lib/libm.2", O_RDONLY, 0200) .......... = 4
open("/usr/lib/libCsup.2", O_RDONLY, 0200) ....... = 4
open("/usr/lib/libstream.2", O_RDONLY, 0200) ..... = 4
open("/usr/lib/libstd.2", O_RDONLY, 0200) ........ = 4

What does this show:
chatr your-executable

>ksleep(0, NULL, NULL, NULL) ... = EINVAL

This may be where that garbage EINVAL is set.
AmitNNM
Occasional Advisor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

Hello Dennis,

The same binary is present on two different HP-UX machines, One binary crashes before start while the other one runs without any fail.

call "ksleep(0, NULL, NULL, NULL)" is not present in the tusc output of running binary but present in output of crashing binary.

The order of open calls for two binaries are as below:

order of open calls for the running binary.

libdld.sl
libogltls.sl
libov.3
libstd.2
libntl.2
libovsnmp.3
libnsl_s.2
libnsl.1
libxti.2
libov.3
libevent.3
libov.3
libovsnmp.3
libCsup.2
libcl.2
libisamstub.1
libdld.2
libc.2
libdld.2
libm.2
libnsl.1
libstream.2
libiiapi.0
libiiapi.sl
libpthread.1
libc.2
libpthread.1


Order for the crashing binary

libdld.sl
libogltls.sl
libov.3
libstd.2
libntl.2
libovsnmp.3
libnsl_s.2
libnsl.1
libxti.2
libov.3
libevent.3
libov.3
libovsnmp.3
libCsup.2
libm.2
libnsl.1
libstream.2
libm.2
libnsl.1
libstream.2
libiiapi.0
libiiapi.sl
libpthread.1
libc.2
libdld.2
libc.2
libpthread.1
libcl.sl
libisamstub.1
libdld.2


Does the order of these open calls important?
instead of same binary why these orders are little bit differ & also few extra calls like ksleep.

What can be the reason of different behavior of same binary on two different machines?

Please help.
Dennis Handly
Acclaimed Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

>Does the order of these open calls important? instead of same binary why these orders are little bit differ & also few extra calls like ksleep.

Yes. The different order could be due to different patch levels on the two machines, or possibly timing differences?

>What can be the reason of different behavior of same binary on two different machines?

Make sure you have the same linker/dld patch. Do you have the same settings for SHLIB_PATH or LD_PRELOAD?
Dennis Handly
Acclaimed Contributor

Re: Application crahes at start with error aCC runtime: Error 22 from shl_findsym(/usr/lib/libstd.2,__sh

You should also compare the ldd outputs on the two systems.