Python decorators on dbus hotplugging

Frank Aune Frank.Aune at broadpark.no
Thu Oct 23 07:08:11 PDT 2008


Hello,

I'm using python threaded decorators around my hotplugging methods for an 
application communicating with HAL over dbus to intercept hotplugging events. 
The sole reason for the decorators is to prevent the application GUI 
from "freezing" during a hotplugging event. On my slowish laptop the 
application works fine, but on faster machines it will sooner or later crash 
(actually more sooner than later).

Please find attached a working sample which is designed to trigger the 
behaviour. To make it work "properly", comment out the @threaded line before 
deviceAdded and deviceRemoved. To see the erratic behaviour I'm experiencing 
comment in the @threaded lines and start hotplugging. 

USB almost always works (I actually don't recollect if I've gotten any faults 
from an USB hotplugging event) - PCCards for example will constantly produce 
segmentation faults. You can pretty much hotplug any PCMCIA PCcard a couple 
of times and get the erratic behaviour. It ranges from:

- not detecting the event
- detects the event, but not able to extract the device properties
- HAL Complaints about missing devices
- Segmentation faults

It's seems as if the deviceAdded thread dies half-way through execution, since 
it doesn't print out all statements.

I've attached a backtrace.log which shows a stack dump during a segfault. I 
would very much like to get some feedback about why this is happening, what 
I'm doing wrong and possible workarounds/fixes.

In advance,
Thank!

-Frank

System: Ubuntu 8.04 LTS
-------------- next part --------------
A non-text attachment was scrubbed...
Name: backtrace.log
Type: text/x-log
Size: 2262 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20081023/404b3773/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dbustest.py
Type: application/x-python
Size: 2203 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/dbus/attachments/20081023/404b3773/attachment-0001.bin 


More information about the dbus mailing list