Re: NM dbus API bug ?



On Tue, 2011-10-04 at 17:07 +0200, Jean Parpaillon wrote:
> Hi again :)

Your original crash is a dbus-glib bug, which likely was a regression in
dbus-glib 0.94 and is fixed by:

http://cgit.freedesktop.org/dbus/dbus-glib/commit/?id=3e0828f57c3925ea9b63d22ab82d991a0fea0536

ie it's been fixed in dbus-glib 0.96 and later.

> I'm quite confused on using NetworkManager DBUS API on master branch.
> 1/ When getting the object with the path returned by
> NetworkManager.GetDevices() method, NM crashes (path is of the
> form: /org/freedesktop/NetworkManager/Devices/0)

That is the correct form of paths.  Device names can change at runtime
so they are not part of the object path as exposed over D-Bus.

> 2/ If I get the Device object with path
> like /org/freedesktop/NetworkManager/Devices/eth0, I can get the object
> but Introspectable interface gives me no interface at all on this
> object. Strange...

Right, because that's not actually an object that NetworkManager exports
over D-Bus, which is why you won't get any introspection information.
It could be a bug in the Python dbus bindings that you get an object
here at all, but the Python bits us lazy bindings so they'll only look
up the introspection information when you need it, which can be later
than when you create the Interface object.

In the end, the bug is in dbus-glib 0.94 and fixed in 0.96.

Dan

> It is WIP ? It is supposed to work right now ?
> I can try to fix it, if someone gives me some hints :)
> 
> Regards,
> Jean
> 
> Le mardi 04 octobre 2011 à 14:15 +0200, Jean Parpaillon a écrit :
> > Hi all,
> > I'm using NetworkManager from master branch.
> > 
> > Running the following python code crash NetworkManager:
> > 
> > ###
> > import dbus
> > import sys
> > 
> > NM_DBUS_SERVICE = "org.freedesktop.NetworkManager"
> > NM_MANAGER_PATH = "/org/freedesktop/NetworkManager"
> > NM_MANAGER_IFACE = "org.freedesktop.NetworkManager"
> > NM_DEVICE_IFACE = "org.freedesktop.NetworkManager.Device"
> > 
> > bus = dbus.SystemBus()
> > 
> > manager_proxy = bus.get_object(NM_DBUS_SERVICE, NM_MANAGER_PATH)
> > manager_iface = dbus.Interface(manager_proxy,
> > dbus_interface=NM_MANAGER_IFACE)
> > 
> > for device_path in manager_iface.GetDevices():
> >     print "Device: %s" % device_path
> > 
> >     device_proxy = bus.get_object(NM_DBUS_SERVICE, device_path)
> > 
> > ###
> > 
> > In a few words, it crashes when I try to get dbus proxy object with a
> > path I get from GetDevices() method.
> > The crashes produces the following backtrace:
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: <warn> caught signal 11.
> > Generating backtrace...
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: ******************* START
> > **********************************
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 0: /usr/sbin/NetworkManager (nm_logging_backtrace+0x3b) [0x45e3fb]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 1: /usr/sbin/NetworkManager (0x400000+0x4470c1) [0x4470c1]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 2: /lib/x86_64-linux-gnu/libpthread.so.0 (0x7fbdf74d9000+0x7fbdf74e8020)
> > [0x7fbdf74e8020]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 3: /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2 (0x7fbdf793a000
> > +0x7fbdf79469b0) [0x7fbdf79469b0]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 4: /lib/libglib-2.0.so.0 (g_hash_table_foreach+0x43) [0x7fbdf6017bd3]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 5: /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2 (0x7fbdf793a000
> > +0x7fbdf794808c) [0x7fbdf794808c]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 6: /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x7fbdf76f5000+0x7fbdf7713371)
> > [0x7fbdf7713371]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 7: /lib/x86_64-linux-gnu/libdbus-1.so.3 (dbus_connection_dispatch+0x380)
> > [0x7fbdf7705270]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 8: /usr/lib/x86_64-linux-gnu/libdbus-glib-1.so.2 (0x7fbdf793a000
> > +0x7fbdf7945675) [0x7fbdf7945675]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 9: /lib/libglib-2.0.so.0 (g_main_context_dispatch+0x1f3)
> > [0x7fbdf60284a3]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 10: /lib/libglib-2.0.so.0 (0x7fbdf5fe3000+0x7fbdf6028c80)
> > [0x7fbdf6028c80]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 11: /lib/libglib-2.0.so.0 (g_main_loop_run+0x182) [0x7fbdf60292f2]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 12: /usr/sbin/NetworkManager (main+0x1155) [0x4220f5]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 13: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xfd)
> > [0x7fbdf57f7ead]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: Frame
> > 14: /usr/sbin/NetworkManager (0x400000+0x42224d) [0x42224d]
> > Oct  4 14:01:17 tiflis NetworkManager[26393]: ******************* END
> > **********************************
> > 
> > 
> > Any clue ?
> > 
> > _______________________________________________
> > networkmanager-list mailing list
> > networkmanager-list gnome org
> > http://mail.gnome.org/mailman/listinfo/networkmanager-list
> 
> 
> 
> _______________________________________________
> networkmanager-list mailing list
> networkmanager-list gnome org
> http://mail.gnome.org/mailman/listinfo/networkmanager-list




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