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 642383 - Mem corruption when using set_*member twice without a remove
Mem corruption when using set_*member twice without a remove
Status: RESOLVED FIXED
Product: json-glib
Classification: Core
Component: Core
0.10.x
Other Linux
: Normal normal
: ---
Assigned To: json-glib-maint
json-glib-maint
Depends on:
Blocks:
 
 
Reported: 2011-02-15 15:14 UTC by Michal Hruby
Modified: 2012-03-13 22:08 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test source (790 bytes, text/x-csrc)
2011-02-15 15:14 UTC, Michal Hruby
Details

Description Michal Hruby 2011-02-15 15:14:38 UTC
Created attachment 180897 [details]
Test source

Running the attached program results in this output, even though according to the docs everything should be fine:

** (process:9352): DEBUG: test-json-set.vala:19: { "member" : "foo" }

(process:9352): Json-CRITICAL **: json_node_get_node_type: assertion `node != NULL' failed
** (process:9352): DEBUG: test-json-set.vala:22: { "\xa8\xae.\xca\u0001\u007f" : null }
Comment 1 Emmanuele Bassi (:ebassi) 2011-02-15 15:56:52 UTC
an odd result is that if I change the g_debug() to:

  json_object_set_string_member (obj, "member", "foo");
  g_assert (strcmp (json_object_get_string_member (obj, "member"), "foo") == 0);

  json_object_set_string_member (obj, "member", "bar");
  g_assert (strcmp (json_object_get_string_member (obj, "member"), "bar") == 0);

the test passes without triggering any assertion. so it looks like it's not a problem of JsonObject or JsonNode, but a problem somewhere in JsonGenerator.
Comment 2 Emmanuele Bassi (:ebassi) 2011-02-15 16:19:10 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.
Comment 3 André Klapper 2012-03-13 22:08:21 UTC
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]