dlclose segfaults on x86_64

Natanael Copa natanael.copa at gmail.com
Fri Oct 5 11:46:09 UTC 2012


Hi,

I have an issue that I suspect is a bug in uclibc, 0.9.33.2 and gcc-4.7

building vlc will end up with a segfaulting ./vlc-cache-gen on x86_64.
On 32bit x86 it works.

I enabled debugging symbols and got a backtrace:
dev64-edge:~/aports/main/vlc/src/vlc-2.0.3/bin$ gdb --core core .libs/lt-vlc-cac
he-gen
GNU gdb (GDB) 7.5
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from
/home/ncopa/aports/main/vlc/src/vlc-2.0.3/bin/.libs/lt-vlc-cache-gen...done.

warning: core file may not match specified executable file.
[New LWP 15590]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/libthread_db.so.1".
Core was generated by
`/home/ncopa/aports/main/vlc/src/vlc-2.0.3/bin/.libs/lt-vlc-cache-gen
../modules'.
Program terminated with signal 11, Segmentation fault.
#0  0x00007f9e5fc53e30 in free (mem=0x7f9e6056a668)
    at libc/stdlib/malloc-standard/free.c:324
324             p->fd = *fb;
(gdb) bt
#0  0x00007f9e5fc53e30 in free (mem=0x7f9e6056a668)
    at libc/stdlib/malloc-standard/free.c:324
#1  0x00007f9e5f0843d6 in do_dlclose (vhandle=0x7f9e60ca7be0, need_fini=1)
    at ldso/libdl/libdl.c:960
#2  0x00007f9e5f084a47 in dlclose (vhandle=0x7f9e60ca7be0)
    at ldso/libdl/libdl.c:1063
#3  0x00007f9e5ff06e1c in module_Unload (handle=<optimized out>)
    at posix/plugin.c:89
#4  0x00007f9e5fef3ac4 in AllocatePluginFile (st=0x7fff6b2237f8,
    relpath=0x7f9e60c7f8a0 "notify/.libs/libnotify_plugin.so",
    abspath=0x7f9e60c79aa0 "../modules/notify/.libs/libnotify_plugin.so",
    bank=0x7fff6b223b00) at modules/bank.c:489
#5  AllocatePluginDir (bank=bank at entry=0x7fff6b223b00, maxdepth=2,
    maxdepth at entry=3, absdir=<optimized out>,
    reldir=0x7f9e60c4bab0 "notify/.libs") at modules/bank.c:440
#6  0x00007f9e5fef3b5a in AllocatePluginDir (bank=bank at entry=0x7fff6b223b00,
    maxdepth=3, maxdepth at entry=4, absdir=<optimized out>,
    reldir=0x7f9e60c76e00 "notify") at modules/bank.c:444
#7  0x00007f9e5fef3b5a in AllocatePluginDir (bank=bank at entry=0x7fff6b223b00,
    maxdepth=4, maxdepth at entry=5,
    absdir=absdir at entry=0x7f9e60db7990 "../modules", reldir=reldir at entry=0x0)
    at modules/bank.c:444
#8  0x00007f9e5fef3ca0 in AllocatePluginPath (
    p_this=p_this at entry=0x7f9e60c311e8, path=0x7f9e60db7990 "../modules",
    mode=mode at entry=CACHE_USE) at modules/bank.c:353
#9  0x00007f9e5fef4081 in AllocateAllPlugins (p_this=0x7f9e60c311e8)
    at modules/bank.c:298
#10 module_LoadPlugins (obj=obj at entry=0x7f9e60c311e8) at modules/bank.c:189
#11 0x00007f9e5fe9f8ef in libvlc_InternalInit (
    p_libvlc=p_libvlc at entry=0x7f9e60c311e8, i_argc=i_argc at entry=3,
    ppsz_argv=ppsz_argv at entry=0x7fff6b223ce0) at libvlc.c:247
#12 0x00007f9e601508be in libvlc_new (argc=argc at entry=2,
    argv=argv at entry=0x7fff6b223d68) at core.c:59
#13 0x00007f9e6056eba9 in main (argc=2, argv=0x7fff6b224008) at cachegen.c:107
(gdb)

I ran the command in valgrind but could not see anything about double free.

I am not sure if another issue with dlopen is related with sdl:
http://git.alpinelinux.org/cgit/aports/commit/main/sdl?id=be91866229a76e73f1ecdbdbfec83b8e69cb6e69

Any ideas?

-- 
Natanael Copa


More information about the uClibc mailing list