GNOME Bugzilla – Bug 683782
Segfault in pulsesink.c:2077 gst_pulsesink_pad_acceptcaps()
Last modified: 2012-10-19 14:15:44 UTC
When repeatedly setting up and removing a pipeline which plays an mp3 file using pulsesink I sometimes get a segfault. I'm running Ubuntu 12.04 and have the following version of gstreamer0.10-pulseaudio, 0.10.31-1ubuntu1. Backtrace:
+ Trace 230838
Could you provide a simple test program, preferably in C, that reproduces this?
Created attachment 226722 [details] [review] pulsesink: in accept_caps() check if ring buffer is NULL before de-referencing Line 2077 from 0.10.31 was: /* Either template caps didn't match, or we're still in NULL state */ if (!ret || !pbuf->context) goto done; So a crash here could only be caused by pbuf being NULL. GstPulseRingBuffer *pbuf = GST_PULSERING_BUFFER_CAST (GST_BASE_AUDIO_SINK (psink)->ringbuffer); Not sure why/when this would happen though, but it might be possible during shutdown I guess. Code looks similar in 1.0. Attached patch might help.
(In reply to comment #2) > Code looks similar in 1.0. Attached patch might help. Yes, that did the trick, thanks!
Thanks! Pushed a slightly different version of the patch, with additional locking for the pbuf->context access. Would be great if you could re-test that as well. http://cgit.freedesktop.org/gstreamer/gst-plugins-good/commit/?id=d2fdc26c38acc243ba7912f4db17f63fe0d54632 commit d2fdc26c38acc243ba7912f4db17f63fe0d54632 Author: Tim-Philipp Müller <tim.muller@collabora.co.uk> Date: Thu Oct 18 11:32:10 2012 +0100 pulsesink: in accept_caps() check if ring buffer is NULL before de-referencing And sprinkle some thread-safety (take object lock for accessing ring buffer, and pa main loop lock for the context). https://bugzilla.gnome.org/show_bug.cgi?id=683782