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 569437 - mpegtsparse: flow error or crashes while dynamicly changing program-numbers property
mpegtsparse: flow error or crashes while dynamicly changing program-numbers p...
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gst-plugins-bad
0.10.10
Other All
: Normal normal
: 0.10.12
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2009-01-28 09:56 UTC by Vincent Génieux
Modified: 2009-05-03 16:13 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test case (2.10 KB, text/x-python)
2009-01-28 09:59 UTC, Vincent Génieux
  Details
proposed patch (4.12 KB, patch)
2009-01-28 14:17 UTC, Vincent Génieux
none Details | Review

Description Vincent Génieux 2009-01-28 09:56:50 UTC
Please describe the problem:
See the following python program which dynamicly change the mpegtsparse's "program-numbers" property.

This dynamic change is not working well : there is sometime a "GST_FLOW_NOT_LINKED" error while the new pad is added (when new program entry is added to the property) and rarely a segmentation fault while removing a pad (when a program is removed from the property).

Steps to reproduce:
See the attached python sample program. 
This sample program reads a MPTS stream from an UDP multicast address (you can use vlc to stream a MPTS file as a source)

Actual results:
-> many time the sample program is working well
-> but after a while, there is a GST_FLOW_NOT_LINKED error or a segmentation fault

Expected results:


Does this happen every time?


Other information:
The segmentation is rare so here is a stack trace obtained using gdb:
$ gdb --args python test_tsparse.py
register program 6905 counter: 1
pad added
linking
linked
[New Thread 0xb64ffb90 (LWP 14586)]
[Thread 0xb64ffb90 (LWP 14586) exited]
unregister program 6905
pad removed
[....]
register program 6905 counter:28
pad added
linking
linked
[New Thread 0xb64ffb90 (LWP 14587)]
[Thread 0xb64ffb90 (LWP 14587) exited]
unregister program 6905
pad removed

Program received signal SIGSEGV, Segmentation fault.

Thread 3077278608 (LWP 14569)

  • #0 mpegts_parse_push
    at mpegtsparse.c line 676
  • #1 mpegts_parse_chain
    at mpegtsparse.c line 1220
  • #2 gst_pad_chain_unchecked
    at gstpad.c line 3877
  • #3 gst_pad_push
    at gstpad.c line 4045
  • #4 gst_queue_loop
    at gstqueue.c line 1047
  • #5 gst_task_func
    at gsttask.c line 192
  • #6 ??
    from /usr/lib/libglib-2.0.so.0
  • #7 ??
    from /usr/lib/libglib-2.0.so.0
  • #8 start_thread
    from /lib/tls/i686/cmov/libpthread.so.0
  • #9 clone
    from /lib/tls/i686/cmov/libc.so.6
$1 = (MpegTSParseProgram *) 0x30657372
(gdb) print tspad->program->streams
Cannot access memory at address 0x3065737e


In fact, I suppose this bug is due to concurrent accesses to the element data (MpegTSParse->programs) between the task thread and the application thread (trought the set_property).

I am working on a patch...
Comment 1 Vincent Génieux 2009-01-28 09:59:56 UTC
Created attachment 127386 [details]
test case

This python test program is indefinitly adding/removing a program-number to the mpegtsparse "program-numbers" property. There is an error or a crash after a while...
Comment 2 Vincent Génieux 2009-01-28 14:17:21 UTC
Created attachment 127393 [details] [review]
proposed patch

This patch moves the pad creation/removal into the pad task : this avoids calls to gst_tspad_push on freed structures.
Comment 3 Zaheer Abbas Merali 2009-05-03 16:13:44 UTC
Thanks for the patch, now committed:

commit 8ef8daf4dbdbab23ff49757a6223c3a9bfba11d3
Author: Vincent Genieux <mutex@runbox.com>
Date:   Sun May 3 17:21:22 2009 +0100

    mpegtsparse: make safe changing the program-numbers property dynamically
    
    Fixes #569437.