GNOME Bugzilla – Bug 667103
discoverer.discover_uri() segfaults
Last modified: 2013-07-17 15:53:15 UTC
When making a call to discover_uri(), it will segfault once every ~1000 uris (or so), and almost every time i try to import my 7000 song library. The code and output is at http://pastebin.com/NSM2bcmR, or below: importing /media/5A2813CC2813A653/Documents and Settings/Scott/Music/Better Than Ezra/Deluxe/Coyote.flac getting info.. (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:20677): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed Program received signal SIGSEGV, Segmentation fault.
+ Trace 229361
Thread 3005209456 (LWP 20702)
public Song? import_song(GLib.File file) { Song s = new Song(file.get_path()); stdout.printf("importing %s\n", file.get_path()); DiscovererInfo info; try { stdout.printf("getting info..\n"); info = disc.discover_uri(file.get_uri()); stdout.printf("info recieved\n"); if(info == null) return null; } catch(GLib.Error err) { stdout.printf("Could not read song's metadata\n"); return null; } stdout.printf("import_song info fetched\n"); unowned TagList tags = info.get_tags(); stdout.printf("taglist set\n"); if(info != null && tags != null) { try { string title, artist, album_artist, album, genre, comment, lyrics; uint track, track_count, album_number, album_count, bitrate, rating; double bpm; int64 duration; GLib.Date? date = new GLib.Date(); stdout.printf("0\n"); /* get title, artist, album artist, album, genre, comment, lyrics strings */ if(tags.get_string(TAG_TITLE, out title)) s.title = title; if(tags.get_string(TAG_ARTIST, out artist)) s.artist = artist; stdout.printf("a\n"); if(tags.get_string(TAG_ALBUM_ARTIST, out album_artist)) s.album_artist = album_artist; else s.album_artist = s.artist; stdout.printf("b\n"); if(tags.get_string(TAG_ALBUM, out album)) s.album = album; if(tags.get_string(TAG_GENRE, out genre)) s.genre = genre; if(tags.get_string(TAG_COMMENT, out comment)) s.comment = comment; if(tags.get_string(TAG_LYRICS, out lyrics)) s.lyrics = lyrics; /* get the year */ if(tags.get_date(TAG_DATE, out date)) { if(date != null) s.year = (int)date.get_year(); } /* get track/album number/count, bitrating, rating, bpm */ if(tags.get_uint(TAG_TRACK_NUMBER, out track)) s.track = (int)track; if(tags.get_uint(TAG_TRACK_COUNT, out track_count)) s.track_count = track_count; if(tags.get_uint(TAG_ALBUM_VOLUME_NUMBER, out album_number)) s.album_number = album_number; if(tags.get_uint(TAG_ALBUM_VOLUME_COUNT, out album_count)) s.album_count = album_count; if(tags.get_uint(TAG_BITRATE, out bitrate)) s.bitrate = (int)(bitrate/1000); if(tags.get_uint(TAG_USER_RATING, out rating)) s.rating = (int)((rating > 0 && rating <= 5) ? rating : 0); if(tags.get_double(TAG_BEATS_PER_MINUTE, out bpm)) s.bpm = (int)bpm; if(info.get_audio_streams().length() > 0) s.samplerate = info.get_audio_streams().nth_data(0).get_sample_rate(); /* get length */ s.length = info.get_duration()/1000000000; s.date_added = (int)time_t(); stdout.printf("g\n"); /* get the size and convert to MB */ s.file_size = (int)(file.query_info("*", FileQueryInfoFlags.NONE).get_size()/1000000); } finally { if(s.title == null || s.title == "") { string[] paths = file.get_path().split("/", 0); s.title = paths[paths.length - 1]; } if(s.artist == null || s.artist == "") s.artist = "Unknown"; } } else { return null; } return s; }
Could you run your application in gdb like this: $ G_DEBUG=fatal_warnings gdb --args ./yourapp (gdb) run ... should abort at gst_value_init_and_copy() warning (gdb) bt ... copy the stack trace from here (gdb) kill Thanks! PS: you have filed this against version 0.10.36, which hasn't been released yet. What version of core/base are you actually using? (0.10.35? git? pre-releases? something else?)
This is the stack trace (plus the gstreamer-critical) using that command. GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed Program received signal SIGTRAP, Trace/breakpoint trap.
+ Trace 229370
Thread 2916072304 (LWP 19255)
I actually meant 0.10.35. If you'd like, you can test it yourself at launchpad.net/beat-box. I will push my current code right now. Thanks you very much
FYI, this looks to be the same bug: https://bugzilla.gnome.org/show_bug.cgi?id=640210
Thanks, It would helpful if you could install debug symbols for glib and GStreamer (sudo apt-get install libglib2.0-0-dbg libgstreamer0.10-0-dbg gstreamer0.10-plugins-base-dbg gstreamer0.10-plugins-good-dbg if on a debian/ubuntu system) and then create a new stacktrace.
With debug symbols: (beatbox:3051): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:3051): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:3051): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed Program received signal SIGSEGV, Segmentation fault.
+ Trace 229383
Thread 2915810160 (LWP 3562)
Right, this matches the valgrind log in the other bug report (although that one was against 0.10.32). I don't really know what might cause this, possibly a stale pointer. Could you re-do a valgrind log as well please, like this (the other valgrind log didn't disable GSlice so was less useful than it could have been): $ export G_SLICE=always-malloc $ valgrind ./yourapp ...
I am trying that now, but I have doubts that it will crash because of http://valgrind.org/docs/manual/faq.html#faq.crashes.
I can reproduce this using the vala test of the bug reporter and the mp3 file from the other bug, and gstreamer core/base 0.10.35: ==2197== Invalid read of size 8 ==2197== at 0x5A0F2EC: g_type_check_value (gtype.c:4133) ==2197== by 0x5A11D82: g_value_copy (gvalue.c:206) ==2197== by 0x50E5E6D: copy_garray_of_gstvalue.isra.32 (gstvalue.c:230) ==2197== by 0x50E5F5F: gst_value_copy_list_or_array (gstvalue.c:241) ==2197== by 0x50CB811: gst_structure_copy (gststructure.c:312) ==2197== by 0x59E7EAF: boxed_proxy_collect_value (gboxed.c:228) ==2197== by 0x50CA605: gst_structure_id_set_valist_internal (gststructure.c:647) ==2197== by 0x50CC1AB: gst_structure_id_set (gststructure.c:681) ==2197== by 0x4E427E9: parse_stream_topology (gstdiscoverer.c:594) ==2197== by 0x4E428D5: parse_stream_topology (gstdiscoverer.c:858) ==2197== by 0x4E42853: parse_stream_topology (gstdiscoverer.c:852) ==2197== by 0x4E42920: parse_stream_topology (gstdiscoverer.c:863) ==2197== Address 0xc414ad8 is 24 bytes inside a block of size 128 free'd ==2197== at 0x4C268FE: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2197== by 0x6255AE9: g_array_free (garray.c:302) ==2197== by 0x5A11752: g_value_unset (gvalue.c:275) ==2197== by 0x50C9FDA: gst_structure_free (gststructure.c:340) ==2197== by 0x4E43348: _event_probe (gstdiscoverer.c:428) ==2197== by 0x50EF847: gst_marshal_BOOLEAN__POINTER (gstmarshal.c:586) ==2197== by 0x59EA803: g_closure_invoke (gclosure.c:774) ==2197== by 0x59FC789: signal_emit_unlocked_R (gsignal.c:3272) ==2197== by 0x5A0541F: g_signal_emitv (gsignal.c:2907) ==2197== by 0x507763A: gst_pad_emit_have_data_signal (gstpad.c:4143) ==2197== by 0x50B20CA: gst_pad_push_event (gstpad.c:5236) ==2197== by 0x509B730: gst_proxy_pad_do_event (gstghostpad.c:114) ==2197== (discoverer:2197): GLib-GObject-CRITICAL **: g_value_copy: assertion `G_IS_VALUE (src_value)' failed ==2197== Invalid read of size 8 ==2197== at 0x50E5E5E: copy_garray_of_gstvalue.isra.32 (gstvalue.c:230) ==2197== by 0x50E5F5F: gst_value_copy_list_or_array (gstvalue.c:241) ==2197== by 0x50CB811: gst_structure_copy (gststructure.c:312) ==2197== by 0x59E7EAF: boxed_proxy_collect_value (gboxed.c:228) ==2197== by 0x50CA605: gst_structure_id_set_valist_internal (gststructure.c:647) ==2197== by 0x50CC1AB: gst_structure_id_set (gststructure.c:681) ==2197== by 0x4E427E9: parse_stream_topology (gstdiscoverer.c:594) ==2197== by 0x4E428D5: parse_stream_topology (gstdiscoverer.c:858) ==2197== by 0x4E42853: parse_stream_topology (gstdiscoverer.c:852) ==2197== by 0x4E42920: parse_stream_topology (gstdiscoverer.c:863) ==2197== by 0x4E42BCF: discoverer_collect (gstdiscoverer.c:972) ==2197== by 0x4E4400A: gst_discoverer_discover_uri (gstdiscoverer.c:1477) ==2197== Address 0xc414a60 is 0 bytes inside a block of size 32 free'd ==2197== at 0x4C268FE: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==2197== by 0x6255ADC: g_array_free (garray.c:316) ==2197== by 0x5A11752: g_value_unset (gvalue.c:275) ==2197== by 0x50C9FDA: gst_structure_free (gststructure.c:340) ==2197== by 0x4E43348: _event_probe (gstdiscoverer.c:428) ==2197== by 0x50EF847: gst_marshal_BOOLEAN__POINTER (gstmarshal.c:586) ==2197== by 0x59EA803: g_closure_invoke (gclosure.c:774) ==2197== by 0x59FC789: signal_emit_unlocked_R (gsignal.c:3272) ==2197== by 0x5A0541F: g_signal_emitv (gsignal.c:2907) ==2197== by 0x507763A: gst_pad_emit_have_data_signal (gstpad.c:4143) ==2197== by 0x50B20CA: gst_pad_push_event (gstpad.c:5236) ==2197== by 0x509B730: gst_proxy_pad_do_event (gstghostpad.c:114) Have not been able to reproduce this with git though, so may well be fixed already.
Any chance you could try the current pre-releases? If you're on ubuntu, there's a GStreamer PPA, if you're on debian sid prerelease packages are in experimental.
I tried with the pre-release. It does not segfault on the file it was before, but instead segfaults on a new file now. Trace: [FATAL 13:09:35.005842] [GLib-GObject] g_value_copy: assertion `G_IS_VALUE (src_value)' failed [FATAL 13:09:35.005924] BeatBox will not function properly. (beatbox:32475): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed (beatbox:32475): GStreamer-CRITICAL **: gst_value_init_and_copy: assertion `G_IS_VALUE (src)' failed Program received signal SIGSEGV, Segmentation fault.
+ Trace 229396
Thread 3063937904 (LWP 32499)
Hrm, sorry, not quite sure what to do with this. Some more questions: - does it happen with the gst-discoverer-0.10 utility as well ? - could you provide a valgrind log ? - could you re-test with GStreamer 1.0.x ? (There were some fixes that look relevant) - does it happen with a test case written in C as well? (though that should really be gst-discoverer-x.y)
No answers after 8+ months (18 since last response). Never reproduced in 1.x Closing. Re-open if you can reproduce this with gst-discoverer-1.0