[vlc-devel] segfault in pthread_mutex_lock()

Rafaël Carré funman at videolan.org
Tue Sep 18 01:47:49 CEST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

Due to recent changes in the threading system, i think that can be
useful to some devs (courmisch, to not name him).

steps:

./vlc -I dummy --control dbus /big/dir
Use DBus to make vlc exit, while the subdirectories are still being
opened, and the items being preparsed.
i.e. vlc_object_kill(((vlc_object_t*)p_this)->p_libvlc);

GDB Backtrace:

Program terminated with signal 11, Segmentation fault.
#0  0xb7cb9550 in pthread_mutex_lock () from
/lib/tls/i686/cmov/libpthread.so.0
(gdb) bt
#0  0xb7cb9550 in pthread_mutex_lock () from
/lib/tls/i686/cmov/libpthread.so.0
#1  0xb7dab4c6 in pthread_mutex_lock () from /lib/tls/i686/cmov/libc.so.6
#2  0xb7e56bd6 in __vlc_mutex_lock (
    psz_file=0xb7ef4ff0 "../../trunk/src/playlist/control.c", i_line=181,
    p_mutex=0x1c) at ../../trunk/include/vlc_threads_funcs.h:125
#3  0xb7e56a9f in playlist_PreparseEnqueue (p_playlist=0x8056260,
    p_item=0x81abad8) at ../../trunk/src/playlist/control.c:181
#4  0xb7e5f53e in GoAndPreparse (p_playlist=0x8056260, i_mode=42,
    p_item_cat=0x81954c0, p_item_one=0x81b4ed0)
    at ../../trunk/src/playlist/item.c:668
#5  0xb7e5ea26 in playlist_BothAddInput (p_playlist=0x8056260,
    p_input=0x81abad8, p_direct_parent=0x81ae960, i_mode=42, i_pos=-666,
    i_cat=0x0, i_one=0x0, b_locked=0) at ../../trunk/src/playlist/item.c:375
#6  0xb1009649 in ReadDir (p_playlist=0x8056260,
    psz_name=0xb2020df0 "/media/mp3/Thougher Than Tough - The Story of
Jamaican Music", i_mode=0, p_parent=0x81ae960, p_parent_category=0x81ae960,
    p_current_input=0x81ad778, handle=0x831b5f8, stparent=0xb2020ea0)
    at ../../../trunk/modules/access/directory.c:523
#7  0xb100947c in ReadDir (p_playlist=0x8056260,
    psz_name=0x81bdf48 "/media/mp3", i_mode=0, p_parent=0x80559a8,
    p_parent_category=0x8055a88, p_current_input=0x81ad778,
handle=0x81c6850,
    stparent=0x0) at ../../../trunk/modules/access/directory.c:484
#8  0xb1008a4c in Read (p_access=0x81bcd20, p_buffer=0xb03c4008 "",
    i_len=32767) at ../../../trunk/modules/access/directory.c:249
#9  0xb7e807c6 in AReadStream (s=0x81bdd10, p_read=0xb03c4008, i_read=32767)
    at ../../trunk/src/input/stream.c:1637
#10 0xb7e7fd60 in AStreamPrebufferStream (s=0x81bdd10)
    at ../../trunk/src/input/stream.c:1359
#11 0xb7e7d071 in stream_AccessNew (p_access=0x81bcd20, b_quick=0)
    at ../../trunk/src/input/stream.c:369
#12 0xb7e783cc in InputSourceInit (p_input=0x81b4db8, in=0x81b3730,
    psz_mrl=0x81ad910 "/media/mp3", psz_forced_demux=0x0)
    at ../../trunk/src/input/input.c:2274
#13 0xb7e73c82 in Init (p_input=0x81b4db8) at
../../trunk/src/input/input.c:859
#14 0xb7e72a4c in Run (p_input=0x81b4db8) at
../../trunk/src/input/input.c:482
#15 0xb7cb746b in start_thread () from /lib/tls/i686/cmov/libpthread.so.0
#16 0xb7d9e6be in clone () from /lib/tls/i686/cmov/libc.so.6
(gdb)

Valgrind log:

[00000001] main libvlc debug: removing playlist
[00000343] main private debug: thread 169175952 joined
(../../trunk/src/playlist/thread.c:147)
[00000344] main private debug: thread 177568656 joined
(../../trunk/src/playlist/thread.c:157)
[00000342] access_directory playlist debug: opening directory
`/big/dir/subdir/file.mp3'
[00000342] access_directory playlist debug: skipping non-directory
`/big/dir/subdir/file.mp3'
==7862==
==7862== Thread 12:
==7862== Invalid read of size 4
==7862==    at 0x426C550: pthread_mutex_lock (in
/lib/tls/i686/cmov/libpthread-2.6.1.so)
==7862==    by 0x41FA4C5: pthread_mutex_lock (in
/lib/tls/i686/cmov/libc-2.6.1.so)
==7862==    by 0x4053BD5: __vlc_mutex_lock (vlc_threads_funcs.h:125)
==7862==    by 0x4053A9E: playlist_PreparseEnqueue (control.c:181)
==7862==    by 0x405C53D: GoAndPreparse (item.c:668)
==7862==    by 0x405BA25: playlist_BothAddInput (item.c:375)
==7862==    by 0x92B6648: ReadDir (directory.c:523)
==7862==    by 0x92B647B: ReadDir (directory.c:484)
==7862==    by 0x92B5A4B: Read (directory.c:249)
==7862==    by 0x407D7C5: AReadStream (stream.c:1637)
==7862==    by 0x407CD5F: AStreamPrebufferStream (stream.c:1359)
==7862==    by 0x407A070: stream_AccessNew (stream.c:369)
==7862==  Address 0x28 is not stack'd, malloc'd or (recently) free'd
==7862==
==7862== Process terminating with default action of signal 11 (SIGSEGV):
dumping core
==7862==  Access not within mapped region at address 0x28
==7862==    at 0x426C550: pthread_mutex_lock (in
/lib/tls/i686/cmov/libpthread-2.6.1.so)
==7862==    by 0x41FA4C5: pthread_mutex_lock (in
/lib/tls/i686/cmov/libc-2.6.1.so)
==7862==    by 0x4053BD5: __vlc_mutex_lock (vlc_threads_funcs.h:125)
==7862==    by 0x4053A9E: playlist_PreparseEnqueue (control.c:181)
==7862==    by 0x405C53D: GoAndPreparse (item.c:668)
==7862==    by 0x405BA25: playlist_BothAddInput (item.c:375)
==7862==    by 0x92B6648: ReadDir (directory.c:523)
==7862==    by 0x92B647B: ReadDir (directory.c:484)
==7862==    by 0x92B5A4B: Read (directory.c:249)
==7862==    by 0x407D7C5: AReadStream (stream.c:1637)
==7862==    by 0x407CD5F: AStreamPrebufferStream (stream.c:1359)
==7862==    by 0x407A070: stream_AccessNew (stream.c:369)
==7862==

- --
Rafaël Carré
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG7xIlYWCeGMCv8Q8RAqzaAKCRMknMzV76hStDG2d5mSvmB7LtKACgy4tW
gjm8MBiSoCGmx6mMs891CcU=
=iylE
-----END PGP SIGNATURE-----



More information about the vlc-devel mailing list