ruby-dbus icon indicating copy to clipboard operation
ruby-dbus copied to clipboard

dbus/message.rb:87:in `synchronize': can't be called from trap context (ThreadError)

Open tomasjura opened this issue 9 years ago • 2 comments

Explanation: Holding mutex in trap is deadlockable. It is what ruby complained.

Possible solutions I found at this blog

tomasjura avatar Feb 15 '16 22:02 tomasjura

Thanks for the report!

In what context are you getting this error? Do you have a simple test case for it?

BTW lps-it.fr seems to be down, but I copied its Google cache to a gist.

mvidner avatar Feb 17 '16 13:02 mvidner

I'm writing a simple dbus client for modem manager and it's location (org.freedesktop.ModemManager1.Modem.Location) interface. When terminated by SIGINT I want the client to stop the GPS.

I do not have the example any more - I rewrote it and used pipe IO.select as shown in the mentioned blog. But simply any contruction like

Signal.trap("SIGINT") {
  dbus_interface.method
}
sleep 10 while true

and sending the INT signal to process should raise the error message.

tomasjura avatar Feb 17 '16 21:02 tomasjura