question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wayland: crash when configuring new outputs with kanshi

See original GitHub issue

The issue:

  • Qtile version: current master (c50cc12e)
  • Running on Wayland
  • No relevant logs found in qtile.log

I’m experiencing pretty reliable crashes (but not always) when my outputs (2 monitors at home, 3 at work) are being reconfigured by kanshi. This happens only when new outputs are added (HDMI cable connected, or USB DisplayLink dock connected, or wlopm --on \* runs). Interestingly, the crashes don’t seem to happen when removing outputs, like when a cable is disconnected and only my laptop screen remains active.

My qtile.log doesn’t contain any information related to this crash, and because I’m running qtile from my .bashrc, I don’t have any stdout or stderr output either (but will add this to the ticket soon if it contains anything interesting). As discussed in https://github.com/qtile/qtile/issues/3298 there don’t seem to be many options to debug these kind of crashes, so I’m currently hoping for the stderr output to contain a traceback.

Required:

  • I have searched past issues to see if this bug has already been reported.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:1
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
arjan-scommented, Sep 12, 2022

Sure, no problem! I can pretty reliably reproduce the crash with the following steps:

  1. disable kanshi
  2. use default config
  3. unplug HDMI display
  4. reload config with Ctrl-mod-r
  5. replug HDMI display
  6. reload config with Ctrl-mod-r (reloading repeatedly works best for reproducing the crash)
  7. goto 3 if not crashed yet

This yields different debug outputs (I did it twice):

[3695518.300]  -> wl_keyboard@20.modifiers(175, 0, 0, 0, 0)
[3695518.461]  -> wl_callback@33.done(1274633)
[3695518.467]  -> wl_display@1.delete_id(33)
[3696897.455]  -> wl_registry@22.global(34, "wl_output", 4)
[3696897.510]  -> wl_registry@2.global(34, "wl_output", 4)
[3696903.083] wl_surface@21.attach(wl_buffer@29, 0, 0)
[3696903.102] wl_surface@21.damage(0, 0, 2147483647, 2147483647)
[3696903.105] wl_surface@21.commit()
[3696903.151]  -> wl_buffer@32.release()
Segmentation fault (core dumped)
[3858952.821]  -> wl_display@1.delete_id(27)
[3858952.832] wl_surface@20.frame(new id wl_callback@32)
[3858952.845] wl_surface@20.commit()
[3858955.369]  -> wl_registry@21.global_remove(36)
[3858955.392]  -> wl_registry@2.global_remove(36)
[3860253.358]  -> wl_callback@32.done(1439368)
[3860253.381]  -> wl_display@1.delete_id(32)
[3861634.186]  -> wl_registry@21.global(37, "wl_output", 4)
[3861634.273]  -> wl_registry@2.global(37, "wl_output", 4)
Segmentation fault (core dumped)

If you want, I can upload the complete debug logs somewhere.

Additionally, here is another crash log with my regular config and without debugging:

00:00:12.114 [ERROR] [backend/drm/atomic.c:34] connector eDP-1: Atomic commit failed (pageflip): Device or resource busy

and another:

Errors from xkbcomp are not fatal to the X server
00:04:01.762 [ERROR] [xwayland/xwm.c:1556] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 289, value 4194305
00:04:01.762 [ERROR] [xwayland/xwm.c:1556] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 290, value 4194305
00:04:35.881 [ERROR] [xwayland/xwm.c:1556] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 363, value 4194308
00:04:35.881 [ERROR] [xwayland/xwm.c:1556] xcb error: op ChangeProperty (no minor), code Window (no extension), sequence 365, value 4194308
(EE) failed to read Wayland events: Broken pipe

With my regular config (and kanshi running) the crash is almost 100% reproducible, probably because the screens_reconfigured hook gets called several times after (un)plugging an external display. Why it isn’t just called once is a mystery to me. Probably has to do with the config getting loaded twice too, which is another mystery.

1reaction
m-colcommented, Sep 7, 2022

I think this will be fixed by https://github.com/qtile/qtile/pull/3812

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sway occasionally fails to start (suspected race condition with ...
My main sway config file. And the included file output : exec kanshi. Stack Trace: #0 0x00006431330be34c in __pthread_kill_implementation () at ...
Read more >
[sway][keyboard / input setup] On sway reload: crash with ...
I'm running Firefox-nightly with Wayland backend and latest Sway. ... This crash seems to only occur when certain xkb configuration commands are used...
Read more >
Sway - ArchWiki
Sway is a tiling Wayland compositor and a drop-in replacement for the i3 window manager for X11. It works with your existing i3...
Read more >
Wayland - turning monitor off and back on causes plasmashell ...
Plasmashell can't take out your apps when it crashes, only KWin can do that. This bug is about a Plasmashell crash, not a...
Read more >
How to keep kanshi (Display Configuration Manager) running ...
I just installed kanshi for managing my display profiles. ... be used on Wayland compositors supporting the wlr-output-management protocol.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found