GNOME Bugzilla – Bug 651271
Generator cannot produce { "a" : {} }
Last modified: 2012-05-31 22:34:18 UTC
When I try to generate something like this { "a" : {} } I got segfault. My code: JsonBuilder *builder; JsonGenerator *generator; gchar *json = NULL; builder = json_builder_new(); json_builder_begin_object(builder); json_builder_set_member_name (builder, "a"); json_builder_begin_object(builder); json_builder_end_object(builder); json_builder_end_object(builder); generator = json_generator_new(); json_generator_set_root(generator, json_builder_get_root(builder)); json = json_generator_to_data(generator, NULL); I use the following version from ubuntu 11.04: libjson-glib-1.0-0 0.12.2-0ubuntu1
Thanks for taking the time to report this bug. Without a stack trace from the crash it's very hard to determine what caused it. Can you get us a stack trace? Please see http://live.gnome.org/GettingTraces for more information on how to do so. Thanks in advance!
I added a test case and was able to reproduce a segfault. the issue has been fixed in master, and will be backported to the stable branch. thanks for reporting this bug.
[Fixing Default QA assignee for json-glib - see 613232#c1. Sorry for bugmail noise.]
*** Bug 677156 has been marked as a duplicate of this bug. ***