issues in the GLib bindings

John (J5) Palmieri johnp at redhat.com
Wed Oct 5 12:01:34 PDT 2005


To test introspection in the Python bindings I have started using the
GLib test server.  In the course of doing so I have found a few cases
that python handles fine but which crash the GLib bindings.  It could be
my glib method or something deeper in the bindings.

Here is the method I am calling:

gboolean
my_object_echo_variant (MyObject *obj, GValue *variant, GValue *ret,
GError **error)
{
    g_value_init (ret, G_VALUE_TYPE(variant));
    g_value_copy (variant, ret);

    return TRUE;
}

It takes a variant, copy's it and then echos it back.

Here are the values I am echoing:

[1, 12323231, 3.14159265, 99999999.99,
 "dude", "123", "What is all the fuss about?", "gob at gob.com",
 [1,2,3], ["how", "are", "you"], [1.23,2.3], [1], ["Hello"],
 (1,2,3), (1,), (1,"2",3), ("2", "what"), ("you", 1.2),
 {1:"a", 2:"b"}, {"a":1, "b":2}, {1:1.1, 2:2.2}, {1.1:"a", 1.2:"b"}, 
 [[1,2,3],[2,3,4]], [["a","b"],["c","d"]],
 ([1,2,3],"c", 1.2, ["a","b","c"], {"a": (1,"v"), "b": (2,"d")})
 
The ones that causes crashes are the following:
(1,2,3) - it seems structs as variants don't want to work
(1,)
(1,"2",3)
("2", "what")
("you", 1.2)
{1:1.1, 2:2.2} - most dicts marshal fine except if they have floats
{1.1:"a", 1.2:"b"}
([1,2,3],"c", 1.2, ["a","b","c"], {"a": (1,"v"), "b": (2,"d")}) - This
is most likely a cause of the structs again

Just a heads up on some of the issues I found.

-- 
John (J5) Palmieri <johnp at redhat.com>



More information about the dbus mailing list