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 760161 - gegl-xml: Cannot serialize a node that is a graph but not a meta-op
gegl-xml: Cannot serialize a node that is a graph but not a meta-op
Status: RESOLVED FIXED
Product: GEGL
Classification: Other
Component: general
git master
Other All
: Normal normal
: ---
Assigned To: Default Gegl Component Owner
Default Gegl Component Owner
Depends on:
Blocks:
 
 
Reported: 2016-01-05 14:08 UTC by Debarshi Ray
Modified: 2016-01-16 16:18 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gegl-xml: Fix serialization of graph nodes that are not meta-ops (1.32 KB, patch)
2016-01-05 14:10 UTC, Debarshi Ray
committed Details | Review
gegl-xml: Unbreak serialization of empty graphs (1.74 KB, patch)
2016-01-16 15:22 UTC, Debarshi Ray
committed Details | Review
tests: Enable test for serialization of sub-graphs (2.25 KB, patch)
2016-01-16 15:55 UTC, Debarshi Ray
committed Details | Review
tests: Test multiple serializations of an empty graph (1.80 KB, patch)
2016-01-16 15:56 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-01-05 14:08:23 UTC
gegl_node_to_xml intends to handle GeglNodes that are "empty" graphs by using their output proxy. Unfortunately, the check for detecting such nodes is wrong.

gegl_node_get_operation will return "GraphNode", not NULL, for nodes that are graphs but don't have an operation associated with them.
Comment 1 Debarshi Ray 2016-01-05 14:10:43 UTC
Created attachment 318255 [details] [review]
gegl-xml: Fix serialization of graph nodes that are not meta-ops
Comment 2 Debarshi Ray 2016-01-05 14:56:21 UTC
Comment on attachment 318255 [details] [review]
gegl-xml: Fix serialization of graph nodes that are not meta-ops

Pushed to master after pippin's approval in #gegl.
Comment 3 Debarshi Ray 2016-01-05 14:56:34 UTC
commit 6a791c1f74c90c6d34e57edc32d026f3a4d244b8
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Tue Jan 5 14:44:39 2016 +0100

    gegl-xml: Fix serialization of graph nodes that are not meta-ops
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760161
Comment 4 Massimo 2016-01-08 10:02:56 UTC
(In reply to Debarshi Ray from comment #3)
> commit 6a791c1f74c90c6d34e57edc32d026f3a4d244b8
> Author: Debarshi Ray <debarshir@gnome.org>
> Date:   Tue Jan 5 14:44:39 2016 +0100
> 
>     gegl-xml: Fix serialization of graph nodes that are not meta-ops
>     
>     https://bugzilla.gnome.org/show_bug.cgi?id=760161

This commit broke make check:

https://build.gimp.org/job/gegl-master/

In tests/xml/test-save.c there is already a
test commented out as expected to fail, perhaps 
it is the case to add one that would fail without
this commit and an explanation of why
/xml/save/empty_graph is now failing.

Btw this commit is sortof reverting part of

https://git.gnome.org/browse/gegl/commit/gegl/gegl-xml.c?id=00431fb8a23af8a68009330d00e34674a347291d
Comment 5 Debarshi Ray 2016-01-08 10:15:58 UTC
(In reply to Massimo from comment #4)
> This commit broke make check:
> 
> https://build.gimp.org/job/gegl-master/
> 
> In tests/xml/test-save.c there is already a
> test commented out as expected to fail, perhaps 
> it is the case to add one that would fail without
> this commit and an explanation of why
> /xml/save/empty_graph is now failing.

I will take a look.
Comment 6 Debarshi Ray 2016-01-16 15:22:31 UTC
Created attachment 319182 [details] [review]
gegl-xml: Unbreak serialization of empty graphs
Comment 7 Debarshi Ray 2016-01-16 15:25:33 UTC
(In reply to Massimo from comment #4)
> This commit broke make check:
> 
> https://build.gimp.org/job/gegl-master/
>
> [...]
>
> Btw this commit is sortof reverting part of
> 
> https://git.gnome.org/browse/gegl/commit/gegl/gegl-xml.
> c?id=00431fb8a23af8a68009330d00e34674a347291d

Killed two birds with one stone.

I am sorry about breaking the tests. My only excuse is that 8 of the compositions tests always fail on this particular laptop, and this particular laptop only. That prevented the XML tests from running.
Comment 8 Debarshi Ray 2016-01-16 15:55:37 UTC
Created attachment 319183 [details] [review]
tests: Enable test for serialization of sub-graphs
Comment 9 Debarshi Ray 2016-01-16 15:56:04 UTC
Created attachment 319184 [details] [review]
tests: Test multiple serializations of an empty graph
Comment 10 Debarshi Ray 2016-01-16 16:18:32 UTC
commit 09993e3bf24a42c20c4f67285514adbbd53bef27
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Sat Jan 16 16:20:32 2016 +0100

    gegl-xml: Unbreak serialization of empty graphs
    
    Nodes without any children at all (or empty graphs) have is_graph set
    to FALSE. Therefore, the condition to handle non-meta-op graphs was
    excluding such nodes. Trying to serialize such a node would lead to:
      CRITICAL **: gegl_node_get: assertion 'self->is_graph ||
        GEGL_IS_OPERATION (self->operation)' failed
    
    Checking for the absence of a GeglOperation object covers both cases.
    This is unlike gegl_node_get_operation which returns NULL for one and
    "GraphNode" for another.
    
    As a nice side-effect, this reverts to using only public API in
    gegl_xml functions.
    
    Fall out from 6a791c1f74c90c6d34e57edc32d026f3a4d244b8
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760161
Comment 11 Debarshi Ray 2016-01-16 16:18:47 UTC
commit 3a835d569763094d9494a95f801a4ebcad77067b
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Sat Jan 16 16:53:31 2016 +0100

    tests: Test multiple serializations of an empty graph
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760161

commit d8d0bbc4adfd3c8c4f75676e831153e4a13da857
Author: Debarshi Ray <debarshir@gnome.org>
Date:   Sat Jan 16 16:43:06 2016 +0100

    tests: Enable test for serialization of sub-graphs
    
    For serialization to work, the nodes inside the sub-graph should be
    connected to the proxies.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=760161