GNOME Bugzilla – Bug 661914
Gstreamer/Totem locks up
Last modified: 2012-03-09 12:18:47 UTC
This happens with Totem 3.2.0 and Gstreamer 0.10.35 running with glib git-master Starting program: /usr/bin/totem [Thread debugging using libthread_db enabled] [New Thread 0x7fffe2704700 (LWP 2862)] [New Thread 0x7fffe1579700 (LWP 2863)] [New Thread 0x7fffd5d0a700 (LWP 2864)] [Thread 0x7fffd5d0a700 (LWP 2864) exited] [New Thread 0x7fffd5d0a700 (LWP 2865)] [New Thread 0x7fffd3d3a700 (LWP 2868)] [New Thread 0x7fffd3539700 (LWP 2869)] [New Thread 0x7fffd2d38700 (LWP 2870)] [New Thread 0x7fffd2537700 (LWP 2871)] [New Thread 0x7fffd1d36700 (LWP 2872)] [New Thread 0x7fffd1535700 (LWP 2873)] [New Thread 0x7fffd0d34700 (LWP 2874)] [New Thread 0x7fffcbfff700 (LWP 2875)] [Thread 0x7fffd5d0a700 (LWP 2865) exited] [Thread 0x7fffd2537700 (LWP 2871) exited] [Thread 0x7fffd0d34700 (LWP 2874) exited] [Thread 0x7fffd1535700 (LWP 2873) exited] [Thread 0x7fffd1d36700 (LWP 2872) exited] [Thread 0x7fffd2d38700 (LWP 2870) exited] [Thread 0x7fffcbfff700 (LWP 2875) exited] [Thread 0x7fffd3539700 (LWP 2869) exited] [New Thread 0x7fffd3539700 (LWP 2878)] [New Thread 0x7fffcbfff700 (LWP 2879)] [Thread 0x7fffd3539700 (LWP 2878) exited] [Thread 0x7fffd3d3a700 (LWP 2868) exited] [New Thread 0x7fffd3d3a700 (LWP 2881)] [Thread 0x7fffcbfff700 (LWP 2879) exited] [New Thread 0x7fffcbfff700 (LWP 2882)] [New Thread 0x7fffd3539700 (LWP 2883)] [New Thread 0x7fffd2d38700 (LWP 2884)] [New Thread 0x7fffd1d36700 (LWP 2885)] [New Thread 0x7fffc4247700 (LWP 2886)] [New Thread 0x7fffc3a46700 (LWP 2887)] [Thread 0x7fffc3a46700 (LWP 2887) exited] [New Thread 0x7fffc3a46700 (LWP 3220)] GStreamer-WARNING **: wrong STREAM_LOCK count 0 GStreamer-WARNING **: wrong STREAM_LOCK count 0 GStreamer-WARNING **: wrong STREAM_LOCK count 0 [Thread 0x7fffc3a46700 (LWP 3220) exited] Program received signal SIGQUIT, Quit. __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136 136 ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S: Datei oder Verzeichnis nicht gefunden. in ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S (gdb) info thread Id Target Id Frame 21 Thread 0x7fffc4247700 (LWP 2886) "aqueue:src" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 20 Thread 0x7fffd1d36700 (LWP 2885) "vqueue:src" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 19 Thread 0x7fffd2d38700 (LWP 2884) "multiqueue0:src" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 18 Thread 0x7fffd3539700 (LWP 2883) "matroskademux0:" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 17 Thread 0x7fffcbfff700 (LWP 2882) "threaded-ml" 0x00007ffff5fa1773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87 16 Thread 0x7fffd3d3a700 (LWP 2881) "multiqueue0:src" pthread_cond_wait@@GLIBC_2.3.2 () at ../nptl/sysdeps/unix/sysv/linux/x86_64/pthread_cond_wait.S:162 3 Thread 0x7fffe1579700 (LWP 2863) "totem" 0x00007ffff5fa1773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87 2 Thread 0x7fffe2704700 (LWP 2862) "gdbus" 0x00007ffff5fa1773 in __GI___poll (fds=<optimized out>, nfds=<optimized out>, timeout=<optimized out>) at ../sysdeps/unix/sysv/linux/poll.c:87 * 1 Thread 0x7ffff7f909e0 (LWP 2859) "totem" __lll_lock_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/lowlevellock.S:136 (gdb) t a a bt
+ Trace 228818
Thread 1 (Thread 0x7ffff7f909e0 (LWP 2859))
Run of "make check" with gstreamer 0.10.35 make check-TESTS make[3]: Betrete Verzeichnis '/home/rico/sources/buildtmp/gstreamer-0.10.35/tests/check' Running suite(s): GstABI 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstabi Running suite(s): GstBuffer 100%: Checks: 9, Failures: 0, Errors: 0 PASS: gst/gstbuffer Running suite(s): GstBufferList 100%: Checks: 9, Failures: 0, Errors: 0 PASS: gst/gstbufferlist Running suite(s): GstBus 100%: Checks: 10, Failures: 0, Errors: 0 PASS: gst/gstbus Running suite(s): GstCaps 100%: Checks: 17, Failures: 0, Errors: 0 PASS: gst/gstcaps Running suite(s): Gst 100%: Checks: 6, Failures: 0, Errors: 0 PASS: gst/gstcpp Running suite(s): GstLibsCpp 100%: Checks: 1, Failures: 0, Errors: 0 PASS: libs/gstlibscpp Running suite(s): GstDateTime 100%: Checks: 11, Failures: 0, Errors: 0 PASS: gst/gstdatetime Running suite(s): GstInfo 100%: Checks: 5, Failures: 0, Errors: 0 PASS: gst/gstinfo Running suite(s): GstIterator 100%: Checks: 4, Failures: 0, Errors: 0 PASS: gst/gstiterator Running suite(s): GstMessage 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstmessage Running suite(s): GstMiniObject 100%: Checks: 8, Failures: 0, Errors: 0 PASS: gst/gstminiobject Running suite(s): GstObject 100%: Checks: 8, Failures: 0, Errors: 0 PASS: gst/gstobject Running suite(s): GstPad 100%: Checks: 17, Failures: 0, Errors: 0 PASS: gst/gstpad Running suite(s): GstParamSpec 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstparamspecs Running suite(s): GstPoll 100%: Checks: 6, Failures: 0, Errors: 0 PASS: gst/gstpoll Running suite(s): GstSegment 100%: Checks: 14, Failures: 0, Errors: 0 PASS: gst/gstsegment Running suite(s): GstSystemClock 100%: Checks: 10, Failures: 0, Errors: 0 PASS: gst/gstsystemclock Running suite(s): GstClock 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstclock Running suite(s): GstStructure 100%: Checks: 13, Failures: 0, Errors: 0 PASS: gst/gststructure Running suite(s): GstTag 100%: Checks: 10, Failures: 0, Errors: 0 PASS: gst/gsttag Running suite(s): GstTagSetter 100%: Checks: 4, Failures: 0, Errors: 0 PASS: gst/gsttagsetter Running suite(s): GstTask 100%: Checks: 5, Failures: 0, Errors: 0 PASS: gst/gsttask Running suite(s): GstValue 100%: Checks: 33, Failures: 0, Errors: 0 PASS: gst/gstvalue Running suite(s): states 100%: Checks: 3, Failures: 0, Errors: 0 PASS: generic/states Running suite(s): Pipelines 100%: Checks: 3, Failures: 0, Errors: 0 PASS: pipelines/simple-launch-lines Running suite(s): Pipeline cleanup 100%: Checks: 1, Failures: 0, Errors: 0 PASS: pipelines/cleanup Running suite(s): Parse Launch syntax 100%: Checks: 8, Failures: 0, Errors: 0 PASS: pipelines/parse-launch Running suite(s): Gst 100%: Checks: 6, Failures: 0, Errors: 0 PASS: gst/gst Running suite(s): GstBin 100%: Checks: 14, Failures: 0, Errors: 0 PASS: gst/gstbin Running suite(s): GstChildProxy 100%: Checks: 2, Failures: 0, Errors: 0 PASS: gst/gstchildproxy Running suite(s): GstElement 100%: Checks: 5, Failures: 0, Errors: 0 PASS: gst/gstelement Running suite(s): GstElementFactory 100%: Checks: 4, Failures: 0, Errors: 0 PASS: gst/gstelementfactory Running suite(s): GstEvent 100%: Checks: 2, Failures: 0, Errors: 0 PASS: gst/gstevent Running suite(s): GstGhostPad 100%: Checks: 15, Failures: 0, Errors: 0 PASS: gst/gstghostpad Running suite(s): GstIndex 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstindex Running suite(s): GstImplementsInterface 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstinterface Running suite(s): GstPlugin 100%: Checks: 9, Failures: 0, Errors: 0 PASS: gst/gstplugin Running suite(s): GstPreset 100%: Checks: 5, Failures: 0, Errors: 0 PASS: gst/gstpreset Running suite(s): GstQuery 100%: Checks: 2, Failures: 0, Errors: 0 PASS: gst/gstquery Running suite(s): registry 100%: Checks: 1, Failures: 0, Errors: 0 PASS: gst/gstregistry Running suite(s): GstURI 100%: Checks: 2, Failures: 0, Errors: 0 PASS: gst/gsturi Running suite(s): GstUtils 100%: Checks: 16, Failures: 0, Errors: 0 PASS: gst/gstutils Running suite(s): Sinks Unexpected critical/warning: wrong STREAM_LOCK count 0 Unexpected critical/warning: wrong STREAM_LOCK count 0 90%: Checks: 20, Failures: 2, Errors: 0 gstcheck.c:72:F:general:test_async_false_seek:0: Unexpected critical/warning: wrong STREAM_LOCK count 0 gstcheck.c:72:F:general:test_async_false_seek_in_playing:0: Unexpected critical/warning: wrong STREAM_LOCK count 0 FAIL: generic/sinks Running suite(s): capsfilter 100%: Checks: 1, Failures: 0, Errors: 0 PASS: elements/capsfilter Running suite(s): fakesink 100%: Checks: 6, Failures: 0, Errors: 0 PASS: elements/fakesink Running suite(s): fakesrc 100%: Checks: 5, Failures: 0, Errors: 0 PASS: elements/fakesrc Running suite(s): fdsrc 100%: Checks: 3, Failures: 0, Errors: 0 PASS: elements/fdsrc Running suite(s): filesink 100%: Checks: 3, Failures: 0, Errors: 0 PASS: elements/filesink Running suite(s): filesrc 100%: Checks: 6, Failures: 0, Errors: 0 PASS: elements/filesrc Running suite(s): funnel 100%: Checks: 1, Failures: 0, Errors: 0 PASS: elements/funnel Running suite(s): identity 100%: Checks: 1, Failures: 0, Errors: 0 PASS: elements/identity Running suite(s): multiqueue 100%: Checks: 7, Failures: 0, Errors: 0 PASS: elements/multiqueue Running suite(s): selector 100%: Checks: 6, Failures: 0, Errors: 0 PASS: elements/selector Running suite(s): tee 100%: Checks: 6, Failures: 0, Errors: 0 PASS: elements/tee Running suite(s): queue 100%: Checks: 7, Failures: 0, Errors: 0 PASS: elements/queue Running suite(s): queue2 100%: Checks: 5, Failures: 0, Errors: 0 PASS: elements/queue2 Running suite(s): valve 100%: Checks: 1, Failures: 0, Errors: 0 PASS: elements/valve Running suite(s): GstBaseSrc 100%: Checks: 7, Failures: 0, Errors: 0 PASS: libs/basesrc Running suite(s): GstBaseSink 100%: Checks: 2, Failures: 0, Errors: 0 PASS: libs/basesink Running suite(s): Controller 100%: Checks: 38, Failures: 0, Errors: 0 PASS: libs/controller Running suite(s): typefindhelper 100%: Checks: 1, Failures: 0, Errors: 0 PASS: libs/typefindhelper Running suite(s): stress Unexpected critical/warning: wrong STREAM_LOCK count 0 Unexpected critical/warning: wrong STREAM_LOCK count 0 0%: Checks: 2, Failures: 2, Errors: 0 gstcheck.c:72:F:linear:test_stress:0: Unexpected critical/warning: wrong STREAM_LOCK count 0 gstcheck.c:72:F:linear:test_stress_preroll:0: Unexpected critical/warning: wrong STREAM_LOCK count 0 FAIL: pipelines/stress Running suite(s): queue 100%: Checks: 1, Failures: 0, Errors: 0 PASS: pipelines/queue-error Running suite(s): LibsABI 100%: Checks: 1, Failures: 0, Errors: 0 PASS: libs/libsabi Running suite(s): data protocol 100%: Checks: 5, Failures: 0, Errors: 0 PASS: libs/gdp Running suite(s): adapter 100%: Checks: 11, Failures: 0, Errors: 0 PASS: libs/adapter Running suite(s): GstBitReader 100%: Checks: 3, Failures: 0, Errors: 0 PASS: libs/bitreader Running suite(s): GstByteReader 100%: Checks: 11, Failures: 0, Errors: 0 PASS: libs/bytereader Running suite(s): GstByteWriter 100%: Checks: 6, Failures: 0, Errors: 0 PASS: libs/bytewriter Running suite(s): GstNetClientClock 100%: Checks: 2, Failures: 0, Errors: 0 PASS: libs/gstnetclientclock Running suite(s): GstNetTimeProvider 100%: Checks: 2, Failures: 0, Errors: 0 PASS: libs/gstnettimeprovider Running suite(s): GstBaseTransform 100%: Checks: 7, Failures: 0, Errors: 0 PASS: libs/transform1 ========================================================================== 2 of 73 tests failed Please report to http://bugzilla.gnome.org/enter_bug.cgi?product=GStreamer ==========================================================================
Created attachment 199393 [details] [review] Fix bug in g_static_rec_mutex_unlock_full() pthreads doesn't implement the _lock_full() and _unlock_full() calls on recursive mutexes so we don't have it on GRecMutex either. Now that we're using GRecMutex to implement GStaticRecMutex, we have to fake it by keeping an internal counter of the number of locks and calling g_rec_mutex_unlock() the appropriate number of times. The code to do this looked like: depth = mutex->depth; while (mutex->depth--) g_rec_mutex_unlock (rm); return depth; which unfortunately did one last decrement after mutex->depth was already zero (leaving it equal to -1). When locked the next time, the count would then increase from -1 to 0 and then the next _unlock_full() call would not do any calls to g_rec_mutex_unlock(), leading to a deadlock.
The patch still leaves a race condition in the code, see <a href="show_bug.cgi?id=670846" title="deadlock: GStreamer-WARNING **: wrong STREAM_LOCK count 0">bug 670846</a>