GNOME Bugzilla – Bug 759995
Destroying children and output proxies after the parent leads to WARNINGs
Last modified: 2015-12-30 17:32:56 UTC
Created attachment 318023 [details] Reproducer This is caused by a combination of these two cases: (i) Since GeglProcessor currently doesn't handle non-meta-op sub-graphs transparently (see bug 759619), applications use the output proxy to create the processor. The output proxy can outlive its parent if the processor is destroyed after the parent. (ii) The application keeps its own references on the children of the sub-graph, and drops those references after dropping the reference on the sub-graph. eg., in my Pipeline class, I have a GHashTable that maps operation names to GeglNodes, and it keeps its own references on the nodes, and I unref the hashtable after unreffing the sub-graph during destruction. See the attached reproducer.
The actual WARNING and CRITICAL: GLib-GObject-WARNING **: invalid unclassed pointer in cast to 'GeglNode' GEGL-gegl-node.c-CRITICAL **: gegl_node_invalidated: assertion 'GEGL_IS_NODE (node)' failed
Created attachment 318024 [details] [review] GeglNode: Stop listening to signals from proxy nodes after destruction
I would have written a test, but I can't get the test suite to fail by any means other than setting G_DEBUG=fatal-warnings in run-tests.py. Setting the variable in C doesn't work. I don't know why.
Created attachment 318025 [details] [review] GeglNode: Disconnect "invalidated" handler when the sink pad is gone Although this seems to be the right thing to do, I haven't found a real world need for it.
From #gegl on GIMPNet: 10:51 <rishi> mitch_: pippin: What do you think of https://bugzilla.gnome.org/show_bug.cgi?id=759995 ? ... <some discussion ensues> ... 12:22 <pippin> rishi: if your fixes for the reference managed behavior doesn't change any other behavior, feel free to push
Review of attachment 318025 [details] [review]: This is purely a theoretical case at the moment, so I am not pushing it now.
commit 8515991978c6da714815f0022fa6d2a57d7a4994 Author: Debarshi Ray <debarshir@gnome.org> Date: Wed Dec 30 10:49:11 2015 +0100 GeglNode: Stop listening to signals from proxy nodes after destruction https://bugzilla.gnome.org/show_bug.cgi?id=759995