GNOME Bugzilla – Bug 314076
Playbin segfault when switching from READY to PAUSED state
Last modified: 2005-09-24 17:02:55 UTC
Steps to reproduce: 1. Modify the media filename in the test case 2. Compile using: gcc $(pkg-config --libs --cflags gstreamer-0.8 ) gst-test.c -o gst-test 3. Run gst-test I manage to crash it at attempt 3 most of he time, other people report 10 or 2à attempts, while thomasvs didn't got any crash. I think it's a race condition, given these random reproducability problems. Stack trace: Program received signal SIGSEGV, Segmentation fault.
+ Trace 62571
Thread 16384 (LWP 24145)
Other information: Valgrind's output: http://pastebin.ca/raw/20422
Created attachment 51058 [details] Test case The simple testcase, a playbin with a bin as audio sink, which in turn contains a tee giving the output to both alsa and a tcpserversink. The serversink is causing a segfault in g_hash_table_destroy
unique stack trace
Created attachment 51259 [details] Simplified Test Case Same one, but remove unnecessary cruft, same backtrace
Created attachment 51260 [details] Updated valgrind output This is the valgrind --trace-children output
Hmm...I don't think multifdsink should be calling g_hash_table_destroy in its _close method. Or if it should be, it should be doing the g_hash_table_new in its init_send method. It seems to me that currently if multifdsink transitions to NULL->READY->NULL->READY, you'll get a double-free of the hash.
Created attachment 51265 [details] [review] Multifdsink patch This fixes the problem. I love Colin.
yes, indeed, but also the CLIENTS_LOCK_FREE in the stop method is not correctly INITED again.
also the bufqueue is leaked...
Is it ok to introduce a gst_multifdsink_finalize, where you can free the bufqueue ? I moved CLIENTS_LOCK_INIT(this) to the init_send function
Created attachment 51607 [details] [review] gst-multi.patch This one fixes the lock init and hashtable double free. I don't know how to fix the leak, though.
Created attachment 52547 [details] [review] add a finalize function Add a finalize function to the previous patch so we can free the array
committed. thanks!