Skip to content
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

Occasional crashes #1657

Open
walseb opened this issue Feb 2, 2024 · 7 comments
Open

Occasional crashes #1657

walseb opened this issue Feb 2, 2024 · 7 comments
Labels

Comments

@walseb
Copy link

walseb commented Feb 2, 2024

Describe the bug

Hi!

It seems that at random times that plover crashes for me. It's usually when plover has been running for some time. Sometimes it spams notifications with stack traces, and at other times it simply dies. I think it's related to dbus being occupied. execute_engine_command is usually mentioned in some way. Restarting plover fixes the issue until it crashes again later on.

Here's the stack trace of a recent crash:

2024-02-02 10:08:34,815 [Thread-1-engine] ERROR: engine execute_engine_command failed
Traceback (most recent call last):
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 143, in run
    if func(*args, **kwargs):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 373, in _execute_engine_command
    self._consume_engine_command(command, force=force)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 344, in _consume_engine_command
    self._set_output(True)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 324, in _set_output
    self._machine.set_suppression(enabled)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/machine/keyboard.py", line 93, in set_suppression
    self._suppress()
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/machine/keyboard.py", line 47, in _suppress
    self._keyboard_capture.suppress_keyboard(suppressed_keys)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 157, in wrapped
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 314, in suppress_keyboard
    self._grab_key(KEY_TO_KEYCODE[key])
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 290, in _grab_key
    self._window.xinput_grab_keycode(deviceid,
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/ext/xinput.py", line 651, in grab_keycode
    return passive_grab_device(self, deviceid, time, keycode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/ext/xinput.py", line 632, in passive_grab_device
    return XIPassiveGrabDevice(
           ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/protocol/rq.py", line 1368, in __init__
    self.reply()
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/protocol/rq.py", line 1388, in reply
    raise self._error
Xlib.error.XError: <class 'Xlib.error.XError'>: code = 129, resource_id = 17, sequence_number = 5931, major_opcode = 131, minor_opcode = 54
Exception in thread Thread-1-engine:
Traceback (most recent call last):
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 143, in run
    if func(*args, **kwargs):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 373, in _execute_engine_command
    self._consume_engine_command(command, force=force)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 344, in _consume_engine_command
    self._set_output(True)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 324, in _set_output
    self._machine.set_suppression(enabled)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/machine/keyboard.py", line 93, in set_suppression
    self._suppress()
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/machine/keyboard.py", line 47, in _suppress
    self._keyboard_capture.suppress_keyboard(suppressed_keys)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 157, in wrapped
    return func(self, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 314, in suppress_keyboard
    self._grab_key(KEY_TO_KEYCODE[key])
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/xkeyboardcontrol.py", line 290, in _grab_key
    self._window.xinput_grab_keycode(deviceid,
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/ext/xinput.py", line 651, in grab_keycode
    return passive_grab_device(self, deviceid, time, keycode,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/ext/xinput.py", line 632, in passive_grab_device
    return XIPassiveGrabDevice(
           ^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/protocol/rq.py", line 1368, in __init__
    self.reply()
  File "/nix/store/5jm168lp1wza3vl9rgsgr7m3zkphdc0d-python3.11-xlib-0.33/lib/python3.11/site-packages/Xlib/protocol/rq.py", line 1388, in reply
    raise self._error
Xlib.error.XError: <class 'Xlib.error.XError'>: code = 129, resource_id = 17, sequence_number = 5931, major_opcode = 131, minor_opcode = 54

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/threading.py", line 1045, in _bootstrap_inner
    self.run()
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 146, in run
    log.error('engine %s failed', func.__name__[1:], exc_info=True)
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/logging/__init__.py", line 1518, in error
    self._log(ERROR, msg, args, **kwargs)
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/nix/store/p1zbyfrpj3hq50mxh5hmxl3kqpa2b1am-python3-3.11.6/lib/python3.11/logging/__init__.py", line 978, in handle
    self.emit(record)
  File "/nix/store/s8rdghwp48b0sdk31pbpaykckqqxj79r-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/oslayer/log_dbus.py", line 42, in emit
    self._notify.Notify(APPNAME, 0, APPICON,  # app_name, replaces_id, app_icon
  File "/nix/store/z716lip6gsjxacl5ir5spj8rv52mi542-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 72, in __call__
    return self._proxy_method(*args, **keywords)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/z716lip6gsjxacl5ir5spj8rv52mi542-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/proxies.py", line 141, in __call__
    return self._connection.call_blocking(self._named_service,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/z716lip6gsjxacl5ir5spj8rv52mi542-python3.11-dbus-python-1.2.18/lib/python3.11/site-packages/dbus/connection.py", line 652, in call_blocking
    reply_message = self.send_message_with_reply_and_block(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
dbus.exceptions.DBusException: org.freedesktop.DBus.Error.ServiceUnknown: The name :1.132 was not provided by any .service files

I thought I would just report it. I can't reliably reproduce it.

Operating system

  • OS: NixOS, Linux 6.7.2
  • Plover Version: Plover 4.0.0.dev10
  • Desktop environment: Xorg with a window manager (EXWM)

Hardware

It's just a normal ASCII keyboard with a custom keyboard layout. It's connected to a T480 ThinkPad laptop via USB.

@walseb walseb added the bug label Feb 2, 2024
@user202729
Copy link
Member

user202729 commented Feb 2, 2024

Ones in a while I got something like that too... but I can't figure out how X interface work and how to look up what the error mean based on major/minor_opcode (yet).

<class 'Xlib.error.XError'>: code = 129, resource_id = 408, sequence_number = 101, major_opcode = 131, minor_opcode = 55
X protocol error:
<class 'Xlib.error.BadValue'>: code = 2, resource_id = 0, sequence_number = 17, major_opcode = 131, minor_opcode = 46

For the second one, I suspect there's something going on with the notification system --- refer to #1544 that one is fixed, but it's fixed after 4.0.0.dev11 while you're using 4.0.0.dev10.

@walseb
Copy link
Author

walseb commented Feb 2, 2024

Ones in a while I got something like that too... but I can't figure out how X interface work and how to look up what the error mean based on major/minor_opcode (yet).

<class 'Xlib.error.XError'>: code = 129, resource_id = 408, sequence_number = 101, major_opcode = 131, minor_opcode = 55
X protocol error:
<class 'Xlib.error.BadValue'>: code = 2, resource_id = 0, sequence_number = 17, major_opcode = 131, minor_opcode = 46

For the second one, I suspect there's something going on with the notification system --- refer to #1544 that one is fixed, but it's fixed after 4.0.0.dev11 while you're using 4.0.0.dev10.

That fix sounds promising! I know that notifications sometimes freeze up on my system for short durations. I will report back when I try out 4.0.0.dev11 for a while. Thanks so much!

@walseb
Copy link
Author

walseb commented Feb 4, 2024

I'm still running 4.0.0.dev10, however, today I got this message after resuming plover with plover_send_command resume:

engine execute_engine_command failed
Xlib.error.XError: <class 'Xlib.error.XError'>: code = 129, resource_id = 10, sequence_number = 2975, major_opcode = 131, minor_opcode = 54

After that it just stopped working and I had to restart it.

I will set up dev11 at some point, I just thought I would start collecting these error messages.

@walseb
Copy link
Author

walseb commented Mar 5, 2024

Here are some more errors that I'm getting now:

2024-03-04 21:53:31,567 [MainThread] ERROR: connection to existing instance failed, force cleaning before restart
2024-03-04 22:07:39,102 [Thread-1-engine] ERROR: engine on_stroked failed
Traceback (most recent call last):
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 143, in run
    if func(*args, **kwargs):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 379, in _on_stroked
    self._translator.translate(stroke)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 206, in translate
    self.translate_stroke(stroke)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 307, in translate_stroke
    self.translate_macro(macro)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 317, in translate_macro
    macro_fn = registry.get_plugin('macro', macro.name).obj
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/registry.py", line 73, in get_plugin
    return self._plugins[plugin_type][plugin_name.lower()]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^
KeyError: 'repeat_last_translation'
2024-03-04 22:07:39,175 [Thread-1-engine] ERROR: engine on_stroked failed
Traceback (most recent call last):
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 143, in run
    if func(*args, **kwargs):
       ^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/engine.py", line 379, in _on_stroked
    self._translator.translate(stroke)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 206, in translate
    self.translate_stroke(stroke)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 307, in translate_stroke
    self.translate_macro(macro)
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/translation.py", line 317, in translate_macro
    macro_fn = registry.get_plugin('macro', macro.name).obj
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/nix/store/p9839qsfl6lzd6ps6a8lin96zjxvsran-python3.11-plover-4.0.0.dev10/lib/python3.11/site-packages/plover/registry.py", line 73, in get_plugin
    return self._plugins[plugin_type][plugin_name.lower()]
           ~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^

@walseb
Copy link
Author

walseb commented Mar 5, 2024

I'm still on 4.0.0.dev10, I'm running on the unstable branch of NixOS, but it seems like Plover still isn't updated. I will try overriding it to get the latest version.

@walseb
Copy link
Author

walseb commented Mar 5, 2024

It seems some of the recently added dependencies to Plover don't exist on NixOS yet, so I'm stuck on 4.0.0.dev10 until those are added.

@aerickt
Copy link

aerickt commented Mar 5, 2024

Using the AppImage is really the only officially supported way of running Plover on Linux. For what it's worth, though, dnaq has a flake for running Plover in NixOS: https://github.com/dnaq/plover-flake

I believe that should make it easier to run the latest version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants