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 665731 - Adding and removing layers to a timeline gets random crashes
Adding and removing layers to a timeline gets random crashes
Status: VERIFIED FIXED
Product: GStreamer
Classification: Platform
Component: gst-editing-services
0.10.x
Other Linux
: Normal normal
: git master
Assigned To: Robert Swain
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2011-12-07 14:37 UTC by Xabier Rodríguez Calvar
Modified: 2012-01-12 16:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test program (4.55 KB, application/octet-stream)
2011-12-07 14:37 UTC, Xabier Rodríguez Calvar
  Details
GESTimeline: Lock object discovery list (5.67 KB, patch)
2012-01-04 16:27 UTC, Robert Swain
none Details | Review
Updated patch (5.35 KB, patch)
2012-01-05 12:35 UTC, Robert Swain
none Details | Review

Description Xabier Rodríguez Calvar 2011-12-07 14:37:21 UTC
Created attachment 202991 [details]
Test program

To compile the program:
gcc [ -DNO_RESET_LAYERS ] -o test -Wall -Werror `pkg-config --libs --cflags gst-editing-services-0.10` main.c

The program just creates a timeline with a video layer and an audio layer with a different audio (to replace the original audio).

If you run this program with the NO_RESET_LAYERS flags the program works perfectly, but if you remove the flag, the program is crashing about 50% of the times.
Comment 1 Xabier Rodríguez Calvar 2011-12-07 14:52:06 UTC
I think this only happens if you don't force the pipeline to preroll before removing and adding the layers again. I couldn't see the bug if you move the pipeline to PLAYING, then NULL and then remove and add the layers again.
Comment 2 Robert Swain 2012-01-04 16:27:11 UTC
Created attachment 204590 [details] [review]
GESTimeline: Lock object discovery list

Confirmed. This patch seems to fix it for me. Review welcome.
Comment 3 Robert Swain 2012-01-05 12:35:54 UTC
Created attachment 204682 [details] [review]
Updated patch

g_list_remove_all () can be used as a simplification as the private data to ges timeline object are 1:1.
Comment 4 Thibault Saunier 2012-01-06 12:22:55 UTC
commit e288a6f4604323518fae42591122228342d2c3da
Author: Robert Swain <robert.swain@gmail.com>
Date:   Fri Jan 6 09:16:09 2012 -0300

    timeline: simplify code to remove an object from the pendingobjects list
    
    g_list_remove_all () can be used as a simplification as the private data to ges
    timeline object are 1:1.

commit fc97c16e7e43cd2362175106e72541113b5e4a81
Author: Robert Swain <robert.swain@gmail.com>
Date:   Wed Jan 4 17:24:16 2012 +0100

    GESTimeline: Lock object discovery list
    
    TimelineFileSource objects are asynchronously discovered with discoverer
    with such objects being added to a pendingobjects list. If one were to
    remove a layer before an object in said layer had been discovered, a
    segfault could occur.
    
    As such, management of the list has been made more robust with the
    addition of a mutex and removal of the object from the pendingobjects
    list upon layer removal.
Comment 5 Xabier Rodríguez Calvar 2012-01-12 16:04:22 UTC
Thx!