Public bug reported: python segfaults if DBusMainLoop is used in multiple threads; e.g.:
#!/usr/bin/python3 import dbus import sys import threading from gi.repository import GLib from dbus.mainloop.glib import DBusGMainLoop #DBusGMainLoop(set_as_default=True) if __name__ == "__main__": threading.Thread(target=GLib.MainLoop().run).start() for r in range(1000): print(".", flush=True, end="") dbus.SessionBus(private=True, mainloop=DBusGMainLoop()) #dbus.SessionBus(private=True) print("") sys.exit(0) $ ./test.py .............Segmentation fault It will also segfault if set_as_default is set to True, even without passing it to the SessionBus's mainloop parameter. ** Affects: dbus-python (Ubuntu) Importance: Undecided Status: New -- You received this bug notification because you are a member of Ubuntu Touch seeded packages, which is subscribed to dbus-python in Ubuntu. https://bugs.launchpad.net/bugs/1890753 Title: DBusGMainLoop segfaults python if multi-threaded Status in dbus-python package in Ubuntu: New Bug description: python segfaults if DBusMainLoop is used in multiple threads; e.g.: #!/usr/bin/python3 import dbus import sys import threading from gi.repository import GLib from dbus.mainloop.glib import DBusGMainLoop #DBusGMainLoop(set_as_default=True) if __name__ == "__main__": threading.Thread(target=GLib.MainLoop().run).start() for r in range(1000): print(".", flush=True, end="") dbus.SessionBus(private=True, mainloop=DBusGMainLoop()) #dbus.SessionBus(private=True) print("") sys.exit(0) $ ./test.py .............Segmentation fault It will also segfault if set_as_default is set to True, even without passing it to the SessionBus's mainloop parameter. To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/dbus-python/+bug/1890753/+subscriptions -- Mailing list: https://launchpad.net/~touch-packages Post to : touch-packages@lists.launchpad.net Unsubscribe : https://launchpad.net/~touch-packages More help : https://help.launchpad.net/ListHelp