UPDATE 3:
After looking at the auto-generated code more closely, I realised it wasn't a Vala-to-C issue I had to work around, but actually an issue with existing assumptions in the libgdata code regarding responsibility over memory. Where libxml2 APIs would return allocated memory for its users to free, GXml (in at least the case of accessing an attribute or node's value) often returns "const gchar*" because GXml is retaining a reference to the returned data and intends on managing it itself, and doesn't want its users to try freeing it. Checking the libgdata compile messages verifies my failure to account for this earlier, with warnings about ignoring const when freeing pointers. Fixed :)
UPDATE 2:
The
above problem went away with the same solution at another location.
I've made a note to go forth and make sure in Vala code that all private
string members are initialised to "", because the resulting C code
tries to free private string members before assigning a new value to
them, even if it wasn't allocated yet. I think :D
***
glibc detected ***
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb:
double free or corruption (!prev): 0x00000000006a3580 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7703a)[0x7ffff57e903a]
/lib64/libglib-2.0.so.0(g_free+0x23)[0x7ffff5f78743]
/home/richard/.local/lib/libgxml.so(+0x1b585)[0x7ffff704b585]
/home/richard/.local/lib/libgxml.so(gxml_dom_node_list_to_string+0x3e)[0x7ffff70475ac]
/home/richard/.local/lib/libgdata.so.13(+0x269c5)[0x7ffff7b549c5]
/home/richard/.local/lib/libgdata.so.13(+0x51af1)[0x7ffff7b7faf1]
/home/richard/.local/lib/libgdata.so.13(+0x2a647)[0x7ffff7b58647]
/home/richard/.local/lib/libgdata.so.13(+0x26d25)[0x7ffff7b54d25]
/home/richard/.local/lib/libgdata.so.13(+0x6a4cd)[0x7ffff7b984cd]
/home/richard/.local/lib/libgdata.so.13(+0x2a647)[0x7ffff7b58647]
/home/richard/.local/lib/libgdata.so.13(+0x2a827)[0x7ffff7b58827]
/home/richard/.local/lib/libgdata.so.13(gdata_service_insert_entry+0x2fb)[0x7ffff7b506eb]
/home/richard/.local/lib/libgdata.so.13(gdata_picasaweb_service_insert_album+0x1f8)[0x7ffff7b9e9c8]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x40cc8a]
/lib64/libglib-2.0.so.0(+0x66c99)[0x7ffff5f95c99]
/lib64/libglib-2.0.so.0(+0x66e16)[0x7ffff5f95e16]
/lib64/libglib-2.0.so.0(+0x66e16)[0x7ffff5f95e16]
/lib64/libglib-2.0.so.0(g_test_run_suite+0x15f)[0x7ffff5f9610f]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x40725f]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7ffff579339d]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x4072a1]
UPDATE 1:
Explicitly initialising a string gets us past that occasional issue, but now we encounter this:
***
glibc detected ***
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb:
corrupted double-linked list: 0x0000000000c2fb20 ***
Dun dun dun!
Original:
Not labelling this, as I don't want it to end up on Planet GNOME :D
Current obstacle of the day to GXml:
*** glibc detected *** /home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb: free(): invalid pointer: 0x0000000000adf110 ***
======= Backtrace: =========
/lib64/libc.so.6(+0x7703a)[0x7ffff57e903a]
/lib64/libglib-2.0.so.0(g_free+0x23)[0x7ffff5f78743]
/home/richard/.local/lib/libgxml.so(+0xa17f)[0x7ffff703a17f]
/home/richard/.local/lib/libgxml.so(gxml_dom_xnode_get_node_value+0x23)[0x7ffff704e86a]
/home/richard/.local/lib/libgxml.so(gxml_dom_element_save_attributes+0x342)[0x7ffff7042aae]
/home/richard/.local/lib/libgxml.so(gxml_dom_document_sync_dirty_elements+0xbe)[0x7ffff7040c5d]
/home/richard/.local/lib/libgxml.so(+0xbae6)[0x7ffff703bae6]
/home/richard/.local/lib/libgxml.so(gxml_dom_xnode_to_string+0x32)[0x7ffff704e5c5]
/home/richard/.local/lib/libgxml.so(+0x1b51e)[0x7ffff704b51e]
/home/richard/.local/lib/libgxml.so(gxml_dom_node_list_to_string+0x3e)[0x7ffff704758c]
/home/richard/.local/lib/libgdata.so.13(+0x269c5)[0x7ffff7b549c5]
/home/richard/.local/lib/libgdata.so.13(+0x51af1)[0x7ffff7b7faf1]
/home/richard/.local/lib/libgdata.so.13(+0x2a647)[0x7ffff7b58647]
/home/richard/.local/lib/libgdata.so.13(+0x26d25)[0x7ffff7b54d25]
/home/richard/.local/lib/libgdata.so.13(+0x6a4cd)[0x7ffff7b984cd]
/home/richard/.local/lib/libgdata.so.13(+0x2a647)[0x7ffff7b58647]
/home/richard/.local/lib/libgdata.so.13(+0x1f469)[0x7ffff7b4d469]
/home/richard/.local/lib/libgdata.so.13(+0x2a647)[0x7ffff7b58647]
/home/richard/.local/lib/libgdata.so.13(+0x2a827)[0x7ffff7b58827]
/home/richard/.local/lib/libgdata.so.13(+0x1f27c)[0x7ffff7b4d27c]
/home/richard/.local/lib/libgdata.so.13(+0x218ef)[0x7ffff7b4f8ef]
/home/richard/.local/lib/libgdata.so.13(gdata_service_query+0x21c)[0x7ffff7b4fcbc]
/home/richard/.local/lib/libgdata.so.13(gdata_picasaweb_service_query_all_albums+0x1fe)[0x7ffff7b9d9ee]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x40f24f]
/lib64/libglib-2.0.so.0(+0x66ca8)[0x7ffff5f95ca8]
/lib64/libglib-2.0.so.0(+0x66e16)[0x7ffff5f95e16]
/lib64/libglib-2.0.so.0(+0x66e16)[0x7ffff5f95e16]
/lib64/libglib-2.0.so.0(g_test_run_suite+0x15f)[0x7ffff5f9610f]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x40725f]
/lib64/libc.so.6(__libc_start_main+0xed)[0x7ffff579339d]
/home/richard/mine/development/gnome/gdom/libgdata/gdata/tests/.libs/picasaweb[0x4072a1]
Fun fun fun :D