gstreamer-java / gst1-java-core

Java bindings for GStreamer 1.x
GNU Lesser General Public License v3.0
193 stars 72 forks source link

GLib-GObject-WARNING g_object_remove_toggle_ref on master #188

Closed MaZderMind closed 4 years ago

MaZderMind commented 4 years ago

When running on the current master of gst1-java-core, I see the following Ẃarnings in my Logs, which I cannot reproduce with v1.1.0:

(gst1-java-core:1814): GLib-GObject-WARNING **: 21:10:37.682: g_object_remove_toggle_ref: couldn't find toggle ref 0x7fc374003010(0x55de24cc)

The only relevant change on master that might trigger this is this change to NatieObject.objectFor

neilcsmith-net commented 4 years ago

That change is an important bug fix. If that is the cause of this, it sounds like something is incorrectly relying on the old behaviour. Be good to narrow down to what is triggering it. Perhaps native GStreamer logs can help?

MaZderMind commented 4 years ago

I'll try to narrow the Source of the Problem down. The Message coincides with the GC cleaning up the Java-Side. I'll do more Debugging and try to create an Reproducible Case when the other PRs are done.

neilcsmith-net commented 4 years ago

Also try Java side logging Level.FINE which is LIFECYCLE at https://github.com/gstreamer-java/gst1-java-core/blob/master/src/org/freedesktop/gstreamer/glib/GObject.java#L70 Yes, it should coincide with GC. Would like to know what type if possible, and where that type is created in your code. Suggests a reference counting bug. I wonder if it's GhostPad? I'm not sure the constructors are correct there.

MaZderMind commented 4 years ago

adding @CallerOwnsReturn to gst_element_get_request_pad as suggested in https://github.com/gstreamer-java/gst1-java-core/pull/186#discussion_r406777371 seems to reliably fix this. I'll open a PR with this change soon.