-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failure to get D-Bus Session Bus causes Plover v4.0.0.dev11 to crash upon any notification #1544
Comments
I can't reproduce (by setting And what is the value of plover/oslayer/linux/log_dbus.py | 2 ++
1 file changed, 2 insertions(+)
diff --git i/plover/oslayer/linux/log_dbus.py w/plover/oslayer/linux/log_dbus.py
index 10a83a7d2..0949fa07d 100644
--- i/plover/oslayer/linux/log_dbus.py
+++ w/plover/oslayer/linux/log_dbus.py
@@ -86,6 +86,8 @@ class DbusNotificationHandler(logging.Handler):
raise MemoryError
bus = bus_get(DBUS_BUS_SESSION, None)
+ if bus is None:
+ raise ConnectionError('could not get DBUS session bus')
actions_signature = ctypes.c_char_p(b's')
hints_signature = ctypes.c_char_p(b'{sv}') |
Unfortunately haven't figured out a way to get more info on it. The program simply terminates after the last line in the error log. The value at line 88 is indeed None and the suggested patch successfully prevents Plover from crashing.
|
Describe the bug
Any notification (e.g. due to missing serial port at start, loading of malformed dictionary, etc.) that fails to send over dbus causes Plover to crash after changes introduced in #1496. Prior to the change to plover/oslayer/log_dbus.py they would fail to transmit just the same, but only result in a DBusException being raised instead of causing program to crash.
The issue seems to occur if a dbus instance is reported, but no working SessionBus despite this exists. This is perhaps not the easiest to reproduce, but forcing bus = None for https://github.com/benoit-pierre/plover/blob/5c2dfdb3ca0fc173a055c71008f07fb10d04d0d3/plover/oslayer/log_dbus.py#L88 should trigger the same whenever a notification is emitted.
Error log in Plover v4.0.0.dev11:
Error log in Plover v4.0.0.dev10 (for reference only):
in dev10 Plover does not crash, but any notification attempted to be sent after failing to spawn the dbus session will produces the same errors as reported in #1490 (comment)
Expected behavior
If a session bus instance cannot be retrieved, raise error similarly as to what is done in case dbus-1 library isn't found. https://github.com/benoit-pierre/plover/blob/5c2dfdb3ca0fc173a055c71008f07fb10d04d0d3/plover/oslayer/log_dbus.py#L54
Operating system
Hardware
The text was updated successfully, but these errors were encountered: