Re: Null service_name?



On Mon, 2009-03-23 at 14:34 -0700, Drew Moseley wrote:
> Hello,
> 
> I'm seeing an occasional failure in nm-applet where in the
> applet_get_exported_connection_for_device() routine, the
> service_name string is coming back as a null pointer.  This is
> causing a segfault in the strcmp().  
> 
> This happens during one of my stress tests where I am unloading
> the modules for my WIFI chip and restarting HAL.  It looks like
> it may be ok to simply test for NULL and continue just as if the
> strcmp() returned non-zero but I'm wondering if there is a bigger
> problem.  Should this pointer ever be NULL?

It shouldn't be NULL, but nm_active_connection_get_service_name() may
well make a d-bus call to NM.  I'd be interested to figure out why that
fails; do you ever get:

_nm_object_get_property: Error getting 'service-name' for /blah/bar/baz: <error>

in the applet's output?  If you don't, add an 'else' block to
_nm_object_get_string_property() in libnm-glib/nm-object.c like so:

		if (G_VALUE_HOLDS_STRING (&value))
			str = g_strdup (g_value_get_string (&value));
		else if (G_VALUE_HOLDS (&value, DBUS_TYPE_G_OBJECT_PATH))
			str = g_strdup (g_value_get_boxed (&value));
+		else
+			g_warning ("%s: unhandled type %s", __func__, G_VALUE_TYPE_NAME(&value));

and see if that turns up anything, and if so, what type it is?

Thanks!
Dan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]