GNOME Bugzilla – Bug 673043
gnome-shell 3.3.92 crashes when networkmanager daemon is restarted
Last modified: 2012-05-18 14:43:25 UTC
JS ERROR: !!! Exception was: TypeError: devices is null JS ERROR: !!! lineNumber = '1848' JS ERROR: !!! fileName = '"/usr/share/gnome-shell/js/ui/status/network.js"' JS ERROR: !!! stack = '"()@/usr/share/gnome-shell/js/ui/status/network.js:1848 wrapper()@/usr/share/gjs-1.0/lang.js:204 ()@/usr/share/gnome-shell/js/ui/status/network.js:2003 wrapper()@/usr/share/gjs-1.0/lang.js:204 ([object _private_NMClient_Client],[object _private_GObject_ParamSpec])@/usr/share/gnome-shell/js/ui/status/network.js:1999 wrapper([object _private_NMClient_Client],[object _private_GObject_ParamSpec])@/usr/share/gjs-1.0/lang.js:204 "' JS ERROR: !!! message = '"devices is null"' JS ERROR: !!! Exception was: TypeError: devices is null JS ERROR: !!! lineNumber = '1848' JS ERROR: !!! fileName = '"/usr/share/gnome-shell/js/ui/status/network.js"' JS ERROR: !!! stack = '"()@/usr/share/gnome-shell/js/ui/status/network.js:1848 wrapper()@/usr/share/gjs-1.0/lang.js:204 ([object _private_NMClient_Client],[object _private_GObject_ParamSpec])@/usr/share/gnome-shell/js/ui/status/network.js:2003 wrapper([object _private_NMClient_Client],[object _private_GObject_ParamSpec])@/usr/share/gjs-1.0/lang.js:204 "' JS ERROR: !!! message = '"devices is null"' ** Message: applet now removed from the notification area
Does this still happen in 3.4?
between 3.3.92 and 3.4.0 there aren't any modifications related to network. i forgot to add that i'm using networkmanager 0.9.4.0
Created attachment 210882 [details] [review] NetworkMenu: fix crash when NetworkManger restarts nm_active_connection_get_devices() has a (questionable) special case for the no devices case (which happens if the DBus object is destroyed because NM went down): it returns null instead of an empty array. Handle that instead of crashing. This is a candidate for 3.4.1, I think.
Review of attachment 210882 [details] [review]: Looks good.
Attachment 210882 [details] pushed as b6aab53 - NetworkMenu: fix crash when NetworkManger restarts
It returns NULL on empty arrays because before GOI was even around, these functions got used from C. And in C it's less code to just check for NULL and then not have to free an empty array. A lot of the other code does this too, but at least it's consistently applied throughout the library wherever a GPtrArray is returned: nm_client_get_devices() nm_client_get_active_connections() nm_device_wifi_get_access_points() nm_device_wimax_get_nsps() nm_ip4_config_get_domains() nm_ip6_config_get_domains() nm_active_connection_get_devices() But a quick audit of the code shows that every location that calls these now uses || []; so we should be fine now.