After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 602847 - [dvdspu] Segfaults on seeking in matroska file
[dvdspu] Segfaults on seeking in matroska file
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.x
Other Linux
: Normal normal
: 0.10.22
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-11-24 16:26 UTC by Alexander Hunziker
Modified: 2011-01-24 18:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
dvdspu: don't write clipped lines to the output buffer (1.32 KB, patch)
2011-01-11 16:00 UTC, Vincent Penquerc'h
committed Details | Review

Description Alexander Hunziker 2009-11-24 16:26:47 UTC
I have totem segfaulting on a matroska file containing theora and vorbis, plus a bitmap subtitle. Stacktrace:

Program received signal SIGSEGV, Segmentation fault.
_int_malloc (av=<value optimised out>, bytes=<value optimised out>) at malloc.c:4311
4311	malloc.c: No such file or directory.
	in malloc.c
(gdb) bt full
  • #0 _int_malloc
    at malloc.c line 4311
  • #1 *__GI___libc_malloc
    at malloc.c line 3638
  • #2 IA__g_malloc
    at /build/buildd/glib2.0-2.22.2/glib/gmem.c line 131
  • #3 IA__g_strdup
    at /build/buildd/glib2.0-2.22.2/glib/gstrfuncs.c line 102
  • #4 ??
    from /usr/lib/libatk-1.0.so.0
  • #5 atk_object_set_name
    from /usr/lib/libatk-1.0.so.0
  • #6 ??
  • #7 seek_slider_changed_cb
  • #8 IA__g_cclosure_marshal_VOID__VOID
    at /build/buildd/glib2.0-2.22.2/gobject/gmarshal.c line 77
  • #9 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #10 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3247
  • #11 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2980
  • #12 IA__g_signal_emit
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3037
  • #13 gtk_adjustment_value_changed
    from /usr/lib/libgtk-x11-2.0.so.0
  • #14 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #15 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #16 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 878
  • #17 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #18 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3285
  • #19 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2990
  • #20 IA__g_signal_emit
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3037
  • #21 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #22 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #23 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #24 g_type_class_meta_marshal
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 878
  • #25 IA__g_closure_invoke
    at /build/buildd/glib2.0-2.22.2/gobject/gclosure.c line 767
  • #26 signal_emit_unlocked_R
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3285
  • #27 IA__g_signal_emit_valist
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 2990
  • #28 IA__g_signal_emit
    at /build/buildd/glib2.0-2.22.2/gobject/gsignal.c line 3037
  • #29 ??
    from /usr/lib/libgtk-x11-2.0.so.0
  • #30 gtk_propagate_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #31 gtk_main_do_event
    from /usr/lib/libgtk-x11-2.0.so.0
  • #32 ??
    from /usr/lib/libgdk-x11-2.0.so.0
  • #33 g_main_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 1960
  • #34 IA__g_main_context_dispatch
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2513
  • #35 g_main_context_iterate
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2591
  • #36 IA__g_main_loop_run
    at /build/buildd/glib2.0-2.22.2/glib/gmain.c line 2799
  • #37 gtk_main
    from /usr/lib/libgtk-x11-2.0.so.0
  • #38 main

Comment 1 Bastien Nocera 2009-11-25 14:06:21 UTC
atk_object_set_name() crashes in malloc which usually indicates memory corruption.

Any chance to get a better backtrace by running totem in valgrind?
Comment 2 Alexander Hunziker 2009-11-25 15:49:01 UTC
This is the first time I used Valgrind, let me know if the pasted info below is not what you need. When running in Valgrind, it doesn't segfault, but prints a lot of output to the terminal when i seek.

==23342== Invalid write of size 1
==23342==    at 0x4026B88: memset (mc_replace_strmem.c:586)
==23342==    by 0xCBA1079: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0xCBA3328: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0xCB9D083: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0xCB9F6A5: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0xCBA04A8: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0x4123A94: gst_pad_chain_data_unchecked (gstpad.c:4042)
==23342==    by 0x41245FF: gst_pad_push_data (gstpad.c:4271)
==23342==    by 0x4068867: gst_base_transform_chain (gstbasetransform.c:2081)
==23342==    by 0x4123A94: gst_pad_chain_data_unchecked (gstpad.c:4042)
==23342==    by 0x41245FF: gst_pad_push_data (gstpad.c:4271)
==23342==    by 0x7FDF4CC: gst_queue_loop (gstqueue.c:1048)
==23342==  Address 0x9d04f84 is 4 bytes after a block of size 1,424 alloc'd
==23342==    at 0x4024C1C: malloc (vg_replace_malloc.c:195)
==23342==    by 0x4024CA6: realloc (vg_replace_malloc.c:476)
==23342==    by 0x4D261CE: g_realloc (gmem.c:170)
==23342==    by 0xCB9D3BB: ??? (in /usr/lib/gstreamer-0.10/libgstdvdspu.so)
==23342==    by 0x411CC36: gst_pad_set_caps (gstpad.c:2526)
==23342==    by 0x411D613: gst_pad_configure_sink (gstpad.c:2582)
==23342==    by 0x4123B79: gst_pad_chain_data_unchecked (gstpad.c:4024)
==23342==    by 0x41245FF: gst_pad_push_data (gstpad.c:4271)
==23342==    by 0x4068867: gst_base_transform_chain (gstbasetransform.c:2081)
==23342==    by 0x4123A94: gst_pad_chain_data_unchecked (gstpad.c:4042)
==23342==    by 0x41245FF: gst_pad_push_data (gstpad.c:4271)
==23342==    by 0x7FDF4CC: gst_queue_loop (gstqueue.c:1048)
Comment 3 Bastien Nocera 2009-11-25 15:55:26 UTC
Looks good. Probably a bug in the subtitle handling. Could you please make the file available somewhere for download?
Comment 4 Alexander Hunziker 2009-11-25 16:11:04 UTC
I can confirm that a file generated using the same DVD ripper, but without subtitles does not crash totem on seeking, so it's probably in the subtitling code.

I've put the file at http://www.nbi.dk/~hunziker/Gladiator.mkv
Comment 5 Jan Schmidt 2009-11-25 16:26:41 UTC
Well, I can't trigger a crash on my machine, but it is definitely drawing the subpictures completely wrong.

For interest's sake, could you confirm the version of gst-plugins-bad you have installed (that's where the dvdspu component comes from).
Comment 6 Alexander Hunziker 2009-11-25 21:32:48 UTC
That's 0.10.14 in Ubuntu Karmic. Can somebody else get it to crash?
Comment 7 Jan Schmidt 2009-11-25 22:32:09 UTC
You're right - I neglected to test the installed dvdspu.

This patch, after 0.10.14, probably fixes the crash. The rendering is still completely incorrect, however:

commit f248986ba4f2f979dc289e2a3593d010f5333397
Author: Jan Schmidt <thaytan@noraisin.net>
Date:   Tue Sep 22 01:16:47 2009 +0100

    dvdspu: Fix rendering and add guards
    
    Fix the rendering when we hit the right hand side of the display
    area, by resetting to the correct X coordinate, and add some more
    guards against bad PGS data.
Comment 8 Jan Schmidt 2009-11-25 22:33:18 UTC
Oh, actually - that patch only touches PGS code, so is completely irrelevant. I can't see any other patches that would affect the crash - so the difference is probably just the debug vs stripped build touching memory differently.
Comment 9 Vincent Penquerc'h 2011-01-11 11:52:11 UTC
I do get an invalid write from the dvdspu element, though no crash.
That video was apparently resized, but the SPUs still write to the original position, and thus end up displayed *below* the video. This is probably what causes the problem, if there's no guard against that. Looking into it more...
Comment 10 Vincent Penquerc'h 2011-01-11 16:00:08 UTC
Created attachment 178055 [details] [review]
dvdspu: don't write clipped lines to the output buffer

We may not increment the output pointer, but it'll still be just
off the end of the allocated area.
Comment 11 Sebastian Dröge (slomo) 2011-01-11 17:29:21 UTC
Looks correct to me, I'll push this after release.
Comment 12 Sebastian Dröge (slomo) 2011-01-24 18:47:55 UTC
commit c3d05d6006ed78d0d470ab7bbe9436fd43c60d5e
Author: Vincent Penquerc'h <vincent.penquerch@collabora.co.uk>
Date:   Tue Jan 11 15:52:03 2011 +0000

    dvdspu: don't write clipped lines to the output buffer
    
    We may not increment the output pointer, but it'll still be just
    off the end of the allocated area.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=602847