glib bindings issues
Robert McQueen
robert.mcqueen at collabora.co.uk
Tue Jun 6 17:00:10 PDT 2006
Havoc Pennington wrote:
> Hi,
Hola,
> "make check" in glib wasn't working for me, due to GPtrArray append not
> copying the string values passed in. I added more details in a comment
> and also a g_assert_not_reached() to be sure it crashes for everyone
> instead of just corrupting memory, but someone who gets this code needs
> to debug.
Yeah I knew it was broken, that was my bad after adding the freeing
patch. I've fixed it now. Rather than copying everything (the
demarshallers already copy all of the things which are taken from the
messages), and also breaking the API's take semantics for existing
users, I just take a copy if the NOCOPY flag is set (! :D), which seems
to be the right behaviour. I committed the attached patch, which I've
shown round at the office to general agreement. :)
> There's also another likely bug in GSList handling, I added an assertion
> and comment there as well.
Yeah, I cleaned that up too. The GSList code was completely broken in
fact (copying, iterating and appending all screwed), but the code is
hard to reach at the moment because the bindings and binding-tool are
all hardcoded to give you GPtrArray for demarshalling those types.
Something I hope to hack at a bit at GUADEC, making an equivalence
between D-Bus interfaces and GInterfaces on both client and server side,
and using glue and/or introspection as necessary to let people direct
the types that we demarshal to.
> Havoc
Regards,
Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: ptrarray-copy-static.patch
Type: text/x-patch
Size: 2000 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20060607/5a634621/ptrarray-copy-static.bin
More information about the dbus
mailing list