[vlc-devel] [HELP] audioscrobbler deadlock

Rafaël Carré funman at videolan.org
Mon Jan 14 19:48:07 CET 2008


audioscrobbler deadlocks at exit:

(gdb) thread apply all bt

Thread 11 (Thread 0x28601100 (LWP 100095)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830aa8d in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x28306390 in pthread_mutex_getprioceiling () from /lib/libthr.so.3
#3  0x2812b465 in __vlc_object_kill (p_this=0x2866a528)
    at vlc_threads_funcs.h:141
#4  0x2809bed5 in intf_StopThread (p_intf=0x2866a528)
    at ../../trunk/src/interface/interface.c:166
#5  0x2808e0ef in libvlc_InternalCleanup (p_libvlc=0x28638028)
    at ../../trunk/src/libvlc-common.c:922
#6  0x2808dc88 in VLC_CleanUp (i_object=0)
at ../../trunk/src/libvlc.c:169 #7  0x08048f4a in main (i_argc=3,
ppsz_argv=0xbfbfea00) at ../trunk/src/vlc.c:214

Thread 10 (Thread 0x28601200 (LWP 100090)):
#0  0x283538bb in sigwait () from /lib/libc.so.7
#1  0x28304e64 in sigwait () from /lib/libthr.so.3
#2  0x0804912c in SigHandler (data=0x28601200) at ../trunk/src/vlc.c:256
#3  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#4  0x00000000 in ?? ()

Thread 9 (Thread 0x28601e00 (LWP 100141)):
---Type <return> to continue, or q <return> to quit---
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
#3  0x280a35ca in playlist_PreparseLoop (p_obj=0x2877f728)
    at vlc_threads_funcs.h:543
#4  0x2809ec1a in RunPreparse (p_obj=0x2877f728)
    at ../../trunk/src/playlist/thread.c:218
#5  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()

Thread 8 (Thread 0x28601f00 (LWP 100142)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
#3  0x280a2664 in playlist_FetcherLoop (p_obj=0x28617bc8)
    at vlc_threads_funcs.h:543
#4  0x2809ebda in RunFetcher (p_obj=0x28617bc8)
    at ../../trunk/src/playlist/thread.c:225
#5  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()

Thread 7 (Thread 0x28602000 (LWP 100143)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
---Type <return> to continue, or q <return> to quit---
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
#3  0x2809eba1 in RunControlThread (p_playlist=0x287ffe00)
    at vlc_threads_funcs.h:543
#4  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#5  0x00000000 in ?? ()

Thread 6 (Thread 0x28602100 (LWP 100144)):
#0  0x28391b3f in poll () from /lib/libc.so.7
#1  0x283017c2 in poll () from /lib/libthr.so.3
#2  0x281e72eb in dbus_malloc () from /usr/local/lib/libdbus-1.so.3
#3  0x281dfd97 in dbus_threads_init ()
from /usr/local/lib/libdbus-1.so.3 #4  0x281de48c in dbus_threads_init
() from /usr/local/lib/libdbus-1.so.3 #5  0x281cadbd in
dbus_connection_set_watch_functions ()
from /usr/local/lib/libdbus-1.so.3 #6  0x281cb987 in
dbus_connection_borrow_message () from /usr/local/lib/libdbus-1.so.3
#7  0x285a5837 in Run (p_sd=0x2866a168)
    at ../../../trunk/modules/services_discovery/hal.c:370
#8  0x280abd52 in RunSD (p_sd=0x2866a168)
    at ../../trunk/src/playlist/services_discovery.c:192
#9  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#10 0x00000000 in ?? ()
---Type <return> to continue, or q <return> to quit---

Thread 5 (Thread 0x28602200 (LWP 100146)):
#0  0x283c810f in nanosleep () from /lib/libc.so.7
#1  0x2830188b in nanosleep () from /lib/libthr.so.3
#2  0x2811279c in msleep (delay=50000)
at ../../trunk/src/misc/mtime.c:348 #3  0x285a8ef2 in Run
(p_intf=0x2866a3a8) at ../../../trunk/modules/control/dbus.c:730
#4  0x2809c43f in RunInterface (p_intf=0x2866a3a8)
    at ../../trunk/src/interface/interface.c:273
#5  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()

Thread 4 (Thread 0x28602300 (LWP 100158)):
#0  0x283e5633 in read () from /lib/libc.so.7
#1  0x283016f2 in read () from /lib/libthr.so.3
#2  0x2812ab74 in __vlc_object_wait (obj=0x2866a528)
    at ../../trunk/src/misc/objects.c:570
#3  0x285b13b1 in Run (p_intf=0x2866a528)
    at ../../../trunk/modules/misc/audioscrobbler.c:270
#4  0x2809c43f in RunInterface (p_intf=0x2866a528)
    at ../../trunk/src/interface/interface.c:273
#5  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()
---Type <return> to continue, or q <return> to quit---

Thread 3 (Thread 0x28604400 (LWP 100197)):
#0  0x283c810f in nanosleep () from /lib/libc.so.7
#1  0x2830188b in nanosleep () from /lib/libthr.so.3
#2  0x2811279c in msleep (delay=311364)
at ../../trunk/src/misc/mtime.c:348 #3  0x281128d1 in mwait
(date=1200335778110648) at ../../trunk/src/misc/mtime.c:303
#4  0x280aee6c in input_ClockSetPCR (p_input=0x28e3d2c8, cl=0x28dba7bc, 
    i_clock=63528344) at ../../trunk/src/input/clock.c:192
#5  0x280bf736 in EsOutControl (out=0x2880f5a0, i_query=10, 
    args=0xbebf0dd8 "\230]�\003") at ../../trunk/src/input/es_out.c:1762
#6  0x29b15a30 in es_out_Control (out=0x2880f5a0, i_query=10)
    at vlc_es_out.h:123
#7  0x29b1be30 in Demux (p_demux=0x28656898)
    at ../../../trunk/modules/demux/ogg.c:355
#8  0x280c9db9 in MainLoop (p_input=0x28e3d2c8)
    at ../../trunk/src/input/input.c:599
#9  0x280cb739 in Run (p_input=0x28e3d2c8)
at ../../trunk/src/input/input.c:503 #10 0x28302a7f in pthread_getprio
() from /lib/libthr.so.3 #11 0x00000000 in ?? ()

Thread 2 (Thread 0x28604600 (LWP 100198)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
---Type <return> to continue, or q <return> to quit---
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
#3  0x281134b2 in block_FifoGet (p_fifo=0x2880cee0) at
vlc_threads_funcs.h:532 #4  0x280b6622 in DecoderThread
(p_dec=0x28787828) at ../../trunk/src/input/decoder.c:578
#5  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#6  0x00000000 in ?? ()

Thread 1 (Thread 0x2982c400 (LWP 100199)):
#0  0x283e5613 in write () from /lib/libc.so.7
#1  0x28301152 in write () from /lib/libthr.so.3
#2  0x2856f2c1 in OSSThread (p_aout=0x28610928)
    at ../../../trunk/modules/audio_output/oss.c:670
#3  0x28302a7f in pthread_getprio () from /lib/libthr.so.3
#4  0x00000000 in ?? ()
(gdb) 


Interesting threads are #4 and #11

#11 is stuck in vlc_mutex_lock() (from vlc_object_lock() ) so that means
the object mutex is already locked.

#4 is stuck in vlc_object_wait() and will return when #11 will have
finished executing intf_StopThread().

So the problem is to know why the object is locked, so thread #11 can
terminate its execution.



When the input has finished, vlc deadlocks in an other state:

(gdb) thread apply all bt

Thread 8 (Thread 0x28601100 (LWP 100095)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830aa8d in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x28306390 in pthread_mutex_getprioceiling () from /lib/libthr.so.3
#3  0x2812b465 in __vlc_object_kill (p_this=0x2866a528) at
vlc_threads_funcs.h:141 #4  0x2809bed5 in intf_StopThread
(p_intf=0x2866a528) at ../../trunk/src/interface/interface.c:166 #5
0x2808e0ef in libvlc_InternalCleanup (p_libvlc=0x28638028)
at ../../trunk/src/libvlc-common.c:922 #6  0x2808dc88 in VLC_CleanUp
(i_object=0) at ../../trunk/src/libvlc.c:169 #7  0x08048f4a in main
(i_argc=3, ppsz_argv=0xbfbfea00) at ../trunk/src/vlc.c:214

Thread 7 (Thread 0x28601200 (LWP 100090)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830aa8d in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x28306390 in pthread_mutex_getprioceiling () from /lib/libthr.so.3
#3  0x2812b465 in __vlc_object_kill (p_this=0x2866a528) at
vlc_threads_funcs.h:141 #4  0x2812b5d2 in __vlc_object_kill
(p_this=0x28638028) at ../../trunk/src/misc/objects.c:661 #5
0x2808dce8 in VLC_Die (i_object=0) at ../../trunk/src/libvlc.c:157 #6
0x080490e2 in KillOnce () at ../trunk/src/vlc.c:300 #7  0x28305d12 in
pthread_once () from /lib/libthr.so.3 #8  0x08048bab in Kill ()
at ../trunk/src/vlc.c:306 #9  0x080491c2 in SigHandler
(data=0xbfbfe9a4) at ../trunk/src/vlc.c:282 #10 0x28302a7f in
pthread_getprio () from /lib/libthr.so.3 #11 0x00000000 in ?? ()

Thread 6 (Thread 0x28601e00 (LWP 100141)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
#3  0x280a35ca in playlist_PreparseLoop (p_obj=0x2877f728) at
vlc_threads_funcs.h:543 #4  0x2809ec1a in RunPreparse
(p_obj=0x2877f728) at ../../trunk/src/playlist/thread.c:218 #5
0x28302a7f in pthread_getprio () from /lib/libthr.so.3 #6  0x00000000
in ?? ()

Thread 5 (Thread 0x28601f00 (LWP 100142)):
#0  0x2835359b in _umtx_op () from /lib/libc.so.7
#1  0x2830a9b8 in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x283091be in pthread_cond_init () from /lib/libthr.so.3
---Type <return> to continue, or q <return> to quit---
#3  0x280a2664 in playlist_FetcherLoop (p_obj=0x28617bc8) at
vlc_threads_funcs.h:543 #4  0x2809ebda in RunFetcher (p_obj=0x28617bc8)
at ../../trunk/src/playlist/thread.c:225 #5  0x28302a7f in
pthread_getprio () from /lib/libthr.so.3 #6  0x00000000 in ?? ()

Thread 4 (Thread 0x28602000 (LWP 100143)):
#0  0x283c810f in nanosleep () from /lib/libc.so.7
#1  0x2830188b in nanosleep () from /lib/libthr.so.3
#2  0x2811279c in msleep (delay=50000)
at ../../trunk/src/misc/mtime.c:348 #3  0x280a166c in playlist_LastLoop
(p_playlist=0x28672328) at ../../trunk/src/playlist/engine.c:409 #4
0x2809ea5c in RunControlThread (p_playlist=0x28672328)
at ../../trunk/src/playlist/thread.c:208 #5  0x28302a7f in
pthread_getprio () from /lib/libthr.so.3 #6  0x00000000 in ?? ()

Thread 3 (Thread 0x28602100 (LWP 100144)):
#0  0x28391b3f in poll () from /lib/libc.so.7
#1  0x283017c2 in poll () from /lib/libthr.so.3
#2  0x281e72eb in dbus_malloc () from /usr/local/lib/libdbus-1.so.3
#3  0x281dfd97 in dbus_threads_init ()
from /usr/local/lib/libdbus-1.so.3 #4  0x281de48c in dbus_threads_init
() from /usr/local/lib/libdbus-1.so.3 #5  0x281cadbd in
dbus_connection_set_watch_functions ()
from /usr/local/lib/libdbus-1.so.3 #6  0x281cb987 in
dbus_connection_borrow_message () from /usr/local/lib/libdbus-1.so.3
#7  0x285a5837 in Run (p_sd=0x2866a168)
at ../../../trunk/modules/services_discovery/hal.c:370 #8  0x280abd52
in RunSD (p_sd=0x2866a168)
at ../../trunk/src/playlist/services_discovery.c:192 #9  0x28302a7f in
pthread_getprio () from /lib/libthr.so.3 #10 0x00000000 in ?? ()

Thread 2 (Thread 0x28602300 (LWP 100158)):
#0  0x283e5633 in read () from /lib/libc.so.7
#1  0x283016f2 in read () from /lib/libthr.so.3
#2  0x2812ab74 in __vlc_object_wait (obj=0x2866a528)
at ../../trunk/src/misc/objects.c:570 #3  0x285b13b1 in Run
(p_intf=0x2866a528) at ../../../trunk/modules/misc/audioscrobbler.c:270
#4  0x2809c43f in RunInterface (p_intf=0x2866a528)
at ../../trunk/src/interface/interface.c:273 #5  0x28302a7f in
pthread_getprio () from /lib/libthr.so.3 #6  0x00000000 in ?? ()

Thread 1 (Thread 0x28604400 (LWP 100197)):
#0  0x28353599 in _umtx_op () from /lib/libc.so.7
---Type <return> to continue, or q <return> to quit---
#1  0x2830aa8d in pthread_cleanup_push () from /lib/libthr.so.3
#2  0x28306390 in pthread_mutex_getprioceiling () from /lib/libthr.so.3
#3  0x2812b0e8 in __vlc_object_lock (obj=0x2866a528) at
vlc_threads_funcs.h:141 #4  0x285b3202 in PlayingChange
(p_this=0x28e3d2c8, psz_var=0x2814c9ca "state", oldval= {i_int = 3,
b_bool = 3, f_float = 4.20389539e-45, psz_string = 0x3 <Error reading
address 0x3: Bad address>, p_address = 0x3, p_object = 0x3, p_list =
0x3, i_time = 3, var = {psz_name = 0x3 <Error reading address 0x3: Bad
address>, i_object_id = 0}, padding = {a = 3 '\003', b = 0 '\0', c = 0
address>'\0', d = 0 '\0', e = 0 '\0', f = 0 '\0', g = 0 '\0', h = 0
address>'\0'}}, newval= {i_int = 5, b_bool = 5, f_float =
address>7.00649232e-45, psz_string = 0x5 <Error reading address 0x5:
address>Bad address>, p_address = 0x5, p_object = 0x5, p_list = 0x5,
address>i_time = 5, var = {psz_name = 0x5 <Error reading address 0x5:
address>Bad address>, i_object_id = 0}, padding = {a = 5 '\005', b = 0
address>'\0', c = 0 '\0', d = 0 '\0', e = 0 '\0', f = 0 '\0', g = 0
address>'\0', h = 0 '\0'}}, p_data=0x2866a528)
address>at ../../../trunk/modules/misc/audioscrobbler.c:626 #5
address>0x28132205 in __var_Set (p_this=0x28e3d2c8, psz_name=0x2814c9ca
address>"state", val=Variable "val" is not available. )
    at ../../trunk/src/misc/variables.c:792
#6  0x280c9ea4 in MainLoop (p_input=0x28e3d2c8) at vlc_variables.h:205
#7  0x280cb739 in Run (p_input=0x28e3d2c8)
at ../../trunk/src/input/input.c:503 #8  0x28302a7f in pthread_getprio
() from /lib/libthr.so.3 #9  0x00000000 in ?? ()
(gdb) 


Here the new locked thread is #1, stuck on vlc_object_lock() too.

thread #2 is old #4 and #8 is old #11



I'm not used to condition variables & threads so help is welcome.

-- 
Rafaël Carré
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
URL: <http://mailman.videolan.org/pipermail/vlc-devel/attachments/20080114/17618078/attachment.sig>


More information about the vlc-devel mailing list