Python decorators on dbus hotplugging

Frank Aune Frank.Aune at broadpark.no
Fri Oct 24 05:57:02 PDT 2008


On Friday 24 October 2008 09:21:54 Frank Aune wrote:
> On Thursday 23 October 2008 17:13:37 Rendy Anthony wrote:
> > Hi,
> >
> > You need to add "gobject.threads_init()" before running your mainloop if
> > you use threading in your application. 

The change I did was:

if __name__ == '__main__':
    gobject.threads_init()
    mainloop = gobject.MainLoop()
    m = DeviceManager()
    try:
        mainloop.run()
    except KeyboardInterrupt:
        mainloop.quit()
        print 'Exiting ...'
        sys.exit(0)

which should enable threading support in the gobject module. But after running 
the testcase code I provided in the OP again with this fix, I still 
experience random segfaults and crashes. It often crash without even printing 
out anything.

Once after a crash I got a backtrace and a message from the dbus library about 
an invalid argument (passed to an assertion?), and that this normally was a 
bug in the application using dbus. Unfortunately I didnt manage to write it 
down before it disappeared, so the question is: am I using the python dbus 
bindings wrong in the example code?

Regards,
Frank




More information about the dbus mailing list