After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 546450 - Troubles with dynamic DBus.Object and string [][]
Troubles with dynamic DBus.Object and string [][]
Status: RESOLVED FIXED
Product: vala
Classification: Core
Component: Code Generator
0.3.x
Other All
: Normal normal
: ---
Assigned To: Jürg Billeter
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2008-08-05 17:59 UTC by Philip Van Hoof
Modified: 2008-08-06 14:54 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Philip Van Hoof 2008-08-05 17:59:42 UTC
These string[][] problems are making any "aas" reply not usable in Vala:

Async situation:

error: internal error: duplicating string[] instances not yet supported
	private void on_get_stats (string [][] items, GLib.Error e) {
				   ^^^^^^^^^^^^^^^^^

private void on_get_stats (string [][] items, GLib.Error e) {
	foreach (string [] pair in items) {
		print ("k:" + pair[0] + " v:" + pair[1] + "\n");
	}
}

Facade.Instance().tracker.GetStats (on_get_stats);

Non-async situation:

error: internal error: duplicating string[] instances not yet supported
		string[][] tags;


dynamic DBus.Object tracker = ...

private void get_numbers () {
	string[][] tags;

	tracker.GetStats ();
	foreach (string [] pair in tags) {
		print ("k:" + pair[0] + " v:" + pair[1] + "\n");
	}
}


Weak strings, non-async:

Segmentation fault (core dumped)

dynamic DBus.Object tracker = ...

private void get_numbers () {
	string[][] tags;

	tracker.GetStats ();
	foreach (weak string [] pair in tags) {
		print ("k:" + pair[0] + " v:" + pair[1] + "\n");
	}
}
Comment 1 Jürg Billeter 2008-08-06 13:08:43 UTC
You certainly need to use weak for now, I'll fix the crash.
Comment 2 Jürg Billeter 2008-08-06 13:09:29 UTC
2008-08-06  Jürg Billeter  <j@bitron.ch>

	* gobject/valaccodegenerator.vala:

	Fix crash when using foreach with stacked arrays, fixes bug 546450

Fixed in r1736.
Comment 3 Philip Van Hoof 2008-08-06 14:47:23 UTC
Sorry, but this case is not yet fixed: 


Async situation:

error: internal error: duplicating string[] instances not yet supported
        private void on_get_stats (string [][] items, GLib.Error e) {
                                   ^^^^^^^^^^^^^^^^^

private void on_get_stats (string [][] items, GLib.Error e) {
        foreach (string [] pair in items) {
                print ("k:" + pair[0] + " v:" + pair[1] + "\n");
        }
}

Facade.Instance().tracker.GetStats (on_get_stats);


Reopening.

Although it's not a blocker for me anymore. Thanks for the crash-fix!
Comment 4 Philip Van Hoof 2008-08-06 14:54:21 UTC
Cloned bug as requested on IRC

Closing this one