GNOME Bugzilla – Bug 565865
Crash when using stacked arrays in D-Bus server
Last modified: 2010-10-16 13:40:12 UTC
pvanhoof@tinc:~$ cat xesam2.vala using GLib; /* public struct QueryHint { string query; Value value; } */ [DBus (name = "org.freedesktop.xesam.Searcher")] public class Searcher : Object { public void NewSearch (DBus.ObjectPath search_object_path, /* QueryHint[] query_hints, */ string query_xml, string[] fields_to_monitor, uint offset, uint count, bool is_live, DBus.ObjectPath search_to_close, out uint hit_count, out string[] field_map, out Value[][] hit_data) { } public void NewSearchBySortKey (DBus.ObjectPath search_object_path, /* QueryHint[] query_hints, */ string query_xml, string[] fields_to_monitor, char[] start_sortkey, char[] end_sortkey, uint offset, uint count, bool is_live, DBus.ObjectPath search_to_close, out uint hit_count, out string[] field_map, out Value[][] hit_data) { } } [DBus (name = "org.freedesktop.xesam.Search")] public class Search : Object { signal void HitsAdded (out Value[][] hits); signal void HitsModified (out Value[][] oldhits); signal void HitsRemoved (out Value[][] hits); public void GetHits (uint offset, uint count, out Value[][] hits) { } public void GetHitsBySortKey (char[] start_sortkey, char[] end_sortkey, uint offset, uint count, out Value[][] hits) { } public void Close () { } } void main () { var loop = new MainLoop (null, false); try { var conn = DBus.Bus.get (DBus.BusType. SESSION); dynamic DBus.Object bus = conn.get_object ("org.freedesktop.DBus", "/org/freedesktop/DBus", "org.freedesktop.DBus"); uint request_name_result = bus.request_name ("org.freedesktop.xesam", (uint) 0); if (request_name_result == DBus.RequestNameReply.PRIMARY_OWNER) { dynamic DBus.Object dbus_searcher; DBus.ObjectPath path; string [] fields = new string[0]; /* QueryHint[] hints = new QueryHint[0]; */ string [] field_map; Value[][] hit_data; uint hit_count; var searcher = new Searcher (); var search = new Search (); path = new DBus.ObjectPath ("/my/application/xesam/Search"); conn.register_object ("/org/freedesktop/xesam/Searcher", searcher); conn.register_object (path, search); dbus_searcher = conn.get_object ("org.freedesktop.xesam", "/org/freedesktop/xesam/Searcher", "org.freedesktop.xesam.Searcher"); dbus_searcher.NewSearch (path, /* hints, */ "query", fields, 0, 0, false, path, out hit_count, out field_map, out hit_data); loop.run (); } } catch (Error e) { stderr.printf ("Oops: %s\n", e.message); } } pvanhoof@tinc:~$ pvanhoof@tinc:~$ gdb /opt/vala/bin/valac GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu"... (gdb) set args --pkg dbus-glib-1 -o dbustest ./xesam2.vala (gdb) run Starting program: /opt/vala/bin/valac --pkg dbus-glib-1 -o dbustest ./xesam2.vala ** (valac:4689): CRITICAL **: vala_ccode_binary_expression_construct: assertion `r != NULL' failed ** (valac:4689): CRITICAL **: vala_ccode_binary_expression_construct: assertion `r != NULL' failed ** (valac:4689): CRITICAL **: vala_ccode_binary_expression_construct: assertion `r != NULL' failed ** (valac:4689): CRITICAL **: vala_ccode_binary_expression_construct: assertion `r != NULL' failed Program received signal SIGSEGV, Segmentation fault. vala_typesymbol_get_type_id (self=0x0) at valatypesymbol.c:261 261 return VALA_TYPESYMBOL_GET_CLASS (self)->get_type_id (self); (gdb) bt
+ Trace 211119
Confirming, stacked array issue.
commit cc435dd6ec069b87e986fa454e80e5fe80a0df72 Author: Jürg Billeter <j@bitron.ch> Date: Sat Oct 16 15:17:23 2010 +0200 Report error when trying to use stacked arrays Stacked array support was never completed. Report an error instead of generating incorrect C code. Fixes bug 546603, bug 548428, bug 548429, bug 565865, bug 565872, bug 571322, bug 572649, and bug 576611.