Version: njamd-0.9.3pre2
System: Linux RedHat 7.1, kernel 2.4.9-31, glibc
2.2.4-19.3
A failed dlopen causes subsequent dlopens to fail when
libnjamd.so
is loaded. The fault is reproducible with the following
program;
#include <stdio.h>
#include <dlfcn.h>
int main(int argc, char* argv[])
{
void* lmh;
argc--;
argv++;
while (argc--) {
lmh = dlopen (*argv, RTLD_LAZY);
if (lmh == 0) {
printf("dlopen error: %s [%s]\n",
dlerror(), *argv);
} else {
printf("dlopen OK: [%s]\n", *argv);
}
argv++;
}
return 0;
}
Compiled with: gcc -g -Wall dlopentest.c -ldl
Invoked with: (setenv LD_PRELOAD libnjamd.so ; ./a.out
/12345678901 ./glreflib1.so )
The first file does not exist, and the length of the
path to the non
existing file affects the behavior. The second file is
a legal .so file
and the loading fails. To load a number of valid .so
files works fine,
so does running the program whitout njamd.
I cant say if this is a bug in dlopen or njamd. Here is
a "bt" from gdb when a segv occurs;
(gdb) bt
#0 0x5f8ee838 in ?? ()
#1 0x400255a5 in _init () at eval.c:41
#2 0x4000d0f1 in _dl_init () at eval.c:41
#3 0x40143d49 in dl_open_worker (a=0xbfffd390) at
dl-open.c:361
#4 0x4000ce35 in _dl_catch_error () at eval.c:41
#5 0x401440be in _dl_open (file=0xbffff0f8
"./glreflib1.so",
mode=-2147483647, caller=0x804853b) at
dl-open.c:407
#6 0x4002e363 in dlopen_doit (a=0xbfffd4f0) at
dlopen.c:39
#7 0x4000ce35 in _dl_catch_error () at eval.c:41
#8 0x4002e6b6 in _dlerror_run (operate=0x4002e338
<dlopen_doit>,
args=0xbfffd4f0) at dlerror.c:130
#9 0x4002e323 in __dlopen_check (file=0xbffff0f8
"./glreflib1.so", mode=1)
at dlopen.c:53
#10 0x804853b in main (argc=0, argv=0xbfffd59c) at
dlopen.c:13
#11 0x4004d306 in __libc_start_main (main=0x8048510
<main>, argc=3,
ubp_av=0xbfffd594, init=0x8048374 <_init>,
fini=0x80485e0 <_fini>,
rtld_fini=0x4000d2dc <_dl_fini>,
stack_end=0xbfffd58c)
at ../sysdeps/generic/libc-start.c:129
Logged In: NO
Submitted by; Lars.G.Ekman@uab.ericsson.se
(sorry about the "nobody", I am unfamiliar with this tool)