[Monetdb-developers] dlclose() segfault
While learning about dlopen() and dynamic
libraries, I found that calling dlclose() on
libbat.so segfaults.
Is this a known behavior or a symptom of
some problem?
Thanks,
m
$ cat bad.c
#include
It works on my machine. Can you run it with gdb and send us the trace?
Thank you,
lefteris
On Tue, Mar 23, 2010 at 4:24 PM, Mark Bucciarelli
While learning about dlopen() and dynamic libraries, I found that calling dlclose() on libbat.so segfaults.
Is this a known behavior or a symptom of some problem?
Thanks,
m
$ cat bad.c #include
int main(void) { void *handle; char *fn = "libbat.so";
handle = dlopen(fn, RTLD_NOW); dlclose(handle);
return 0; } $ gcc bad.c && ./a.out Segmentation fault (core dumped) $
------------------------------------------------------------------------------ Download Intel® Parallel Studio Eval Try the new software tools for yourself. Speed compiling, find bugs proactively, and fine-tune applications for parallel performance. See why Intel Parallel Studio got high marks during beta. http://p.sf.net/sfu/intel-sw-dev _______________________________________________ Monetdb-developers mailing list Monetdb-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/monetdb-developers
On Tue, Mar 23, 2010 at 11:34 AM, Lefteris
It works on my machine. Can you run it with gdb and send us the trace?
I guess it's something about threads. $ gcc -g bad.c && ./a.out Segmentation fault (core dumped) $ gdb a.out a.out.core GNU gdb 6.3 Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-unknown-openbsd4.6"... Core was generated by `a.out'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/lib/libc.so.51.0...done. Loaded symbols for /usr/lib/libc.so.51.0 Reading symbols from /usr/libexec/ld.so...done. Loaded symbols for /usr/libexec/ld.so #0 0x0f77ff14 in ?? () (gdb) where #0 0x0f77ff14 in ?? () #1 0x0adce36b in _dl_thread_kern_go () from /usr/libexec/ld.so #2 0x0adcde4b in dlclose () from /usr/libexec/ld.so #3 0x1c0007c5 in main () at bad.c:10 (gdb) quit $ head -10 bad.c | tail -1 dlclose(handle); $ grep -A 4 ^_dl_thread_kern_go /usr/src/libexec/ld.so/dlfcn.c _dl_thread_kern_go(void) { if (_dl_thread_fnc != NULL) (*_dl_thread_fnc)(1); } $
participants (2)
-
Lefteris
-
Mark Bucciarelli