GNOME Bugzilla – Bug 667069
gjs crashes when processing stdout - e.g runnng GLib spawn_command_line_sync("echo a");
Last modified: 2012-02-06 19:26:31 UTC
I think this says it all: $ LANG=C LC_ALL=C gjs gjs> const g = imports.gi.GLib; typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi typein:1: strict warning: reference to undefined property imports.gi gjs> g.spawn_command_line_sync("echo a"); (gjs:2446): GLib-CRITICAL **: g_utf8_to_utf16: assertion `str != NULL' failed Violación de segmento Same crash with my default locale es_ES.UTF-8 It's x86 Linux Mint 12, gnome-3.2, gjs 1.30.0 using GLib function g_spawn_command_line_sync in C works perfectly! Thanks for looking into it! Lukas
Created attachment 206915 [details] [review] Be robust when faced with NULL arrays Some API return NULL to mean an empty array (especially if they have an explicit length). Be robust in this cases, and handle such empty bytearrays in a way that prevents crashes.
Review of attachment 206915 [details] [review]: Sure.
Attachment 206915 [details] pushed as 36094f3 - Be robust when faced with NULL arrays