I have been experimenting weird Segmentation faults in the past when writing
GStreamer elements in Python using gst-python. I still have some elements causing issues, but I can't share the source code with you unfortunately, and I couldn't figure out which line(s) is(are) causing this to happen so I can't share a simple way to reproduce it either. I'll just try to describe the problem as clearly as I can here. As of today, all of the elements I have in my codebase are fine. Most of them are declaring custom properties, and I have been using the Pythonic way to do it (using annotation @GObject.Property with the appropriate type, default, min/max, ...) as well as the C way (adding the __gproperties__ field and defining getters/setters for each property). No matter the method I chose, the result is the same: they all work fine for all kind of elements (srcs, sinks, ALWAYS/ON_REQUEST/SOMETIMES pads, ...). However, sometimes, when I add a property to an element that works just fine, the element starts "Segmentation faulting" for no apparent reason. I have experienced this with multiple properties types / defaults / mins / maxs, and switching between the Pythonic definition or the properties and the C-style definition doesn't change anything. What I am experimenting is, I can't even gst-inspect-1.0 the element without a Segmentation fault showing up when listing the properties. I got this line showing up right before the flags of the property are listed: and then a Segmentation fault. gst-launch-1.0 obviously won't work either. What I have tested so far is: - Enabling core dumps to track down who is causing this Segmentation fault. It didn't give me anything, really. - Adding a Gst.init(None) at the top of the Python file doesn't change anything - Adding a "import pdb; pdb.set_trace()" statement at the end of the __init__ method of the element. This way, I can make sure the element and its properties are all initialized fine. Then I just hit "c" to continue executing the code. Proceeding this way *actually does get rid of the Segmentation fault*. Unfortunately, I can't go to prod with this workaround... - For this reason, I assumed replacing the "import pdb; pdb.set_trace()" + "c" trick with a good old "time.sleep(1)" should do the trick as well. Unfortunately, the Segmentation fault is back... - Lately, I've noticed declaring a fake sinkpad with a chain function in the __init__ method also gets rid of the Segmentation fault, even though I'm never actually using this sinkpad: So far, I don't have any better solution than this last point. However, I obviously don't feel confident going to prod with a weird behaviour I can't explain in my elements. Any hint on how to solve this? -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
It looks like the "raw" parts of my message didn't make it, so I'll add them
here. > [...] > What I am experimenting is, I can't even gst-inspect-1.0 the element > without a Segmentation fault showing up when listing the properties. I got > this line showing up right before the flags of the property are listed: sys:1: Warning: g_object_get_property: assertion 'G_IS_OBJECT (object)' failed > and then a Segmentation fault. gst-launch-1.0 obviously won't work either. > [...] > - Lately, I've noticed declaring a fake sinkpad with a chain function in > the __init__ method also gets rid of the Segmentation fault, even though > I'm never actually using this sinkpad: self.s = Gst.Pad.new_from_template(sinkpadtemplate, "sink") self.s.set_chain_function_full(self.chain) > > So far, I don't have any better solution than this last point. However, I > obviously don't feel confident going to prod with a weird behaviour I > can't explain in my elements. Any hint on how to solve this? -- Sent from: http://gstreamer-devel.966125.n4.nabble.com/ _______________________________________________ gstreamer-devel mailing list [hidden email] https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel |
Free forum by Nabble | Edit this page |