GNOME Bugzilla – Bug 656641
Segfault using ofa element
Last modified: 2011-08-18 09:12:48 UTC
Created attachment 193928 [details] stacktrace Pipeline: playbin -> bin[ tee -> -> queue -> ofa -> fakesink -> queue -> chromaprint -> fakesink] Right before the segfault I get: CRITICAL **: gst_adapter_take_buffer: assertion `nbytes > 0' failed I can reproduce it somewhat (it sometimes takes a few hundred files) Failing line: http://cgit.freedesktop.org/gstreamer/gst-plugins-bad/tree/ext/ofa/gstofa.c#n128 stack trace attached
Found a file that constantly triggers it for me: http://hotfile.com/dl/126964934/1804ef5/test_song_656641.mp3.html
Worked for me with this file a dozen times or so. However, the bug is evident, and I could get it with: gst-launch audiotestsrc num-buffers=0 ! ofa ! fakesink Though just why no data flowed through in your case is another problem. You may want to enable logs (GST_DEBUG=3 to start with) to see if the pipeline fails to start properly. In any case, the crash on no data is fixed by...
Created attachment 193981 [details] [review] ofa: warn when no data, instead of trying to use it Fixes a crash when no data flowed through.
Thanks for the quick response. You're right, I can't reproduce it with gst-launch either. I've checked some more files that fail and it seems they all have long silence (for ofa to trigger > 135 sec) at the beginning aka 'hidden' tracks. I'll try to come up with a minimal python example.
Comment on attachment 193981 [details] [review] ofa: warn when no data, instead of trying to use it Pushed with a minor change (to avoid gst-indent ping-pong on the endianness line): commit 5a0a0aac192e732e248d6b15343643d01a297817 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Tue Aug 16 18:34:59 2011 +0100 ofa: don't crash when there's no data to create a fingerprint from Fixes a crash when no data flowed through. https://bugzilla.gnome.org/show_bug.cgi?id=656641
Created attachment 193996 [details] gst-python testcase
Vincent's patch fixes it for me (see previous attached test case) But, I would still like to know what triggered it in the case of using an actual file. With my limited knowledge I can't see how the adapter could be empty in such a case. If it's really a silence problem, I'm going to use cutter to stop the pipeline before a segfault kicks in.
Created attachment 193998 [details] silent mp3 A small silent mp3 file which also triggers the error.
Created attachment 194019 [details] [review] ofa: cleanup Avoid repeating casting to GstAudioFilter when one will do Use object related logging to make it easier to get just the logs we want
Created attachment 194020 [details] [review] ofa: fingerprint creation can fail There does not seem to be a way to retrieve information about why failure occured, unfortunately. When failure occurs, do not post a NULL fingerprint tag.
Created attachment 194021 [details] [review] ofa: do not create fingerprint on EOS if record is FALSE
It seems libofa can fail to create a fingerprint, unfortunately, so I've added code to cater for this. There's no way to know why it failed, but adding traces to libofa (which needed help to even build here), the failure on the file you sent was an exception (it's c++ code inside) with message "Signal has silence only". It appears to skip silence first, then fingerprint the remainder.
Ah, so it failed, did nothing until EOS and then tried again with the now empty buffer. Thanks for investigating.
commit 57ae8c4bf5bd8653f87f62b81a6531f812ee24a6 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed Aug 17 11:02:12 2011 +0100 ofa: fingerprint creation can fail There does not seem to be a way to retrieve information about why failure occured, unfortunately. When failure occurs, do not post a NULL fingerprint tag. https://bugzilla.gnome.org/show_bug.cgi?id=656641 commit 6ef56f56d7aab9ba006ad7a37e9bc8ea19939568 Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed Aug 17 10:55:59 2011 +0100 ofa: cleanup Avoid repeating casting to GstAudioFilter when one will do Use object related logging to make it easier to get just the logs we want https://bugzilla.gnome.org/show_bug.cgi?id=656641 commit 683fbaa81ac900c3e87bbd2b4745a341f9c7b07f Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk> Date: Wed Aug 17 11:07:54 2011 +0100 ofa: do not create fingerprint on EOS if record is FALSE https://bugzilla.gnome.org/show_bug.cgi?id=656641