This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
dlsym with RTLD_NEXT and unknown symbol causes segfault on ppc
- To: Franz Sirl <Franz dot Sirl-kernel at lauterbach dot com>
- Subject: dlsym with RTLD_NEXT and unknown symbol causes segfault on ppc
- From: "Kevin B. Hendricks" <kevin dot hendricks at sympatico dot ca>
- Date: Fri, 15 Sep 2000 12:20:09 -0400
- CC: libc-alpha at sourceware dot cygnus dot com
- References: <5.0.0.19.2.20000908165930.0200b010@mail.lauterbach.com> <5.0.0.19.2.20000908172119.02ec2030@mail.lauterbach.com> <5.0.0.19.2.20000908180030.01cc1e10@mail.lauterbach.com> <5.0.0.19.2.20000908185016.02c254a0@mail.lauterbach.com> <39C2296F.A2937C67@sympatico.ca>
- Reply-To: khendricks at ivey dot uwo dot ca
Hi Franz,
When the jdk under green threads fails instantly with a segfault under glibc 2.2
cvs because whenever dlsym (using RTLD_NEXT) is used to lookup a nonexistent
symbol it segfaults.
I have no idea if this is a ppc specific problem or not.
Here is a stripped down piece of test code:
[root@khendricksmac jdk]# gcc -o bug1 -D_GNU_SOURCE -ldl -lc bug1.c
[root@khendricksmac jdk]# ./bug1
Segmentation fault
[root@khendricksmac jdk]#
[root@khendricksmac jdk]# cat bug1.c
#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
#include <dlfcn.h>
typedef int (*sysfunc_t)();
int
main(int argc, char** argv)
{
char *sym="_filbuf";
sysfunc_t addr;
addr = (sysfunc_t) dlsym(RTLD_NEXT,sym);
fprintf(stdout, "All is well\n");
fflush(stdout);
exit(0);
}
Program received signal SIGSEGV, Segmentation fault.
0x30009ebc in _dl_lookup_symbol_skip () from /lib/ld.so.1
(gdb) bt
#0 0x30009ebc in _dl_lookup_symbol_skip () from /lib/ld.so.1
#1 0xff9fa78 in _dl_sym () from /lib/libc.so.6
#2 0xffde4e0 in dlsym_doit () from /lib/libdl.so.2
#3 0x3000e6ec in _dl_catch_error () from /lib/ld.so.1
#4 0xffde898 in _dlerror_run () from /lib/libdl.so.2
#5 0xffde53c in dlsym () from /lib/libdl.so.2
#6 0x10000580 in main ()
#7 0xfebe7c8 in __libc_start_main () from /lib/libc.so.6
#8 0x0 in ?? ()
(gdb)