GNOME Bugzilla – Bug 515689
Core is dumped in a race condition with gnonlin
Last modified: 2010-05-31 22:14:47 UTC
# This program segfaults a dumps core. This is a reduction from my program # there is some short of race condtion. If there's a sleep between # the first and second gnlcomposition1.add() it fails. import gobject gobject.threads_init() import pygst pygst.require("0.10") import gst import time main_loop = gobject.MainLoop() pipeline = gst.Pipeline() adder = gst.element_factory_make("adder") lame = gst.element_factory_make("lame") fakesink = gst.element_factory_make("fakesink") pipeline.add(adder, lame,fakesink) # taking lame out of the pipeline stops the coredump gst.element_link_many(adder, lame, fakesink) # Add one compostion gnlcomposition1 = gst.element_factory_make("gnlcomposition") audioconvert1 = gst.element_factory_make("audioconvert") pipeline.add(gnlcomposition1, audioconvert1) def OnPad (comp, pad): convpad = audioconvert1.get_compatible_pad(pad, pad.get_caps()) pad.link(convpad) gnlcomposition1.connect("pad-added", OnPad) srcpad = audioconvert1.get_pad('src') addersinkpad = adder.get_request_pad('sink%d') srcpad.link(addersinkpad) # Add second compostion gnlcomposition2 = gst.element_factory_make("gnlcomposition") audioconvert2 = gst.element_factory_make("audioconvert") pipeline.add(gnlcomposition2, audioconvert2) def OnPad (comp, pad): convpad = audioconvert2.get_compatible_pad(pad, pad.get_caps()) pad.link(convpad) gnlcomposition2.connect("pad-added", OnPad) srcpad = audioconvert2.get_pad('src') addersinkpad = adder.get_request_pad('sink%d') srcpad.link(addersinkpad) def add(): print "Going..." filesrc = gst.element_factory_make("gnlfilesource") filesrc.set_property("location", "/home/dskippy/17years.mp3") #not givin the filesrc a duration stops the coredump filesrc.set_property("duration", 1 * gst.SECOND) gnlcomposition1.add(filesrc) #taking this sleep out changes the race condition #and stops the coredump time.sleep(1) dead_air = gst.element_factory_make("gnlsource") gnlcomposition1.add(dead_air) pipeline.set_state(gst.STATE_PLAYING) gobject.idle_add(add) main_loop.run()
The second gnlcomposition2 is not necessary. All that's needed is second call to adder.get_request_pad('sink%d')
Re-assigning to gnonlin. Is this still an issue with more recent versions?
Mike, do you still get that issue with latest gnonlin releases (or even better gnonling git) ?
I was looking for a solution as PiTiVi crashes before starting with a segfault. I have tested the example above and it doesn't work unless you comment the duration setting for filesrc as specified. I'm using Ubuntu Karmic from repositories. It segfaults with both python2.5 and python2.6. Maybe, my crashes with pitivi are related to this ones. If you need more info, just tell.
Inigo, what version of gnonlin are you using ?
I'm using latest version from the gstreamer developers PPA (https://launchpad.net/~gstreamer-developers/+archive/ppa) which is version 0.10.11.2. Otherwise, Pitivi is working for me now as there was some problem with goocanvas being too old on Ubuntu Karmic.
Reopening as the requested information has been provided.
Can't get it to crash with current gnonlin. Inigo, are you still seeing the issue ?
No, I'm not seeing this crash anymore. I suppose you can savely close this bug report.