Summary: | kwin_wayland crashed in KWin::DrmGpu::updateOutputs while un/re-plugging monitor | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Jiri Slaby <jirislaby> |
Component: | platform-drm | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | crash | CC: | markus.knetschke, nate, sonichedgehog_hyperblast00, veehexx, xaver.hugl |
Priority: | NOR | Keywords: | wayland |
Version: | 5.22.0 | ||
Target Milestone: | --- | ||
Platform: | openSUSE | ||
OS: | Linux | ||
Latest Commit: | https://invent.kde.org/plasma/kwin/commit/54ce400764184eee067dc4f3d8d81cee2ec25537 | Version Fixed In: | 5.22.4 |
Sentry Crash Report: | |||
Attachments: |
~/.local/share/sddm/wayland-session.log
~/.local/share/sddm/wayland-session.log wayland-session.log |
Description
Jiri Slaby
2021-06-17 05:58:58 UTC
Can you reproduce it again and then attach the resulting ~/.local/share/sddm/wayland-session.log file? Does this only happen when you do it fast, or is there no crash if you first unplug, wait for a bit and then replug? Created attachment 139531 [details] ~/.local/share/sddm/wayland-session.log (In reply to Zamundaaa from comment #1) > Can you reproduce it again and then attach the resulting > ~/.local/share/sddm/wayland-session.log file? > > Does this only happen when you do it fast, or is there no crash if you first > unplug, wait for a bit and then replug? We had some electricity outages during the night and this happened again. They were like 1 s, so rather fast. Hmm, there's a lot of (possibly unrelated) errors in that log before and after the crash which suggest there's either another bug in KWin or a bug in the graphics driver. I assume the thunderbolt dock has its own power supply? Does it also work without it? And did you need to install a separate driver like DisplayLink to get it to work? Could you also add QT_LOGGING_RULES="kwin_*.debug=true;kwin_libinput.debug=false" to /etc/environment, reboot and provide the same file again in the following situations: 1. without any crash or unplug (to check for the other error) 2. when you plug it out, wait for 10 seconds and plug it in again 3. with the crash That should tell us whether or not it's on unplug or hotplug, and how much time between the two events being processed by KWin passed. (In reply to Zamundaaa from comment #3) > Hmm, there's a lot of (possibly unrelated) errors in that log before and > after the crash which suggest there's either another bug in KWin or a bug in > the graphics driver. FWIW, it sometimes crashes (with the same stack trace) also when I only unplug the connector. > I assume the thunderbolt dock has its own power supply? Yes. > Does it also work without it? I don't know, the dock powers the laptop (over thunderbolt). > And did you need to install a separate driver like DisplayLink > to get it to work? No, I don't even know about its existence. > Could you also add > QT_LOGGING_RULES="kwin_*.debug=true;kwin_libinput.debug=false" > to /etc/environment, reboot and provide the same file again in the following > situations: > 1. without any crash or unplug (to check for the other error) > 2. when you plug it out, wait for 10 seconds and plug it in again > 3. with the crash > > That should tell us whether or not it's on unplug or hotplug, and how much > time between the two events being processed by KWin passed. I set the env var and will restart the session later, but I answered the question I think. I looked into it a bit more and there's a bunch of
> failed to open drm device at ""
in the wayland session log which mean that KWin is detecting a GPU hotplug (not unplug!) of a device with an empty path, but failing to use the device (as intended, as the path is nonsense).
When it crashes adding a hotplugged device seems to suceed but it then fails updating the outputs on that device.
As to what device gets added or how that would cause a crash, 5.22.1 contains some more and improved debug logging for the drm stuff and specifically for hot(un)plugging GPUs, so if you use the env var and 5.22.1 that could yield some more useful information in the wayland-session log
*** Bug 439208 has been marked as a duplicate of this bug. *** Created attachment 139913 [details] ~/.local/share/sddm/wayland-session.log (In reply to Zamundaaa from comment #3) > Could you also add > QT_LOGGING_RULES="kwin_*.debug=true;kwin_libinput.debug=false" > to /etc/environment, reboot and provide the same file again in the following > situations: ... > 3. with the crash I believe this is "3." log. Happened during unplug: > kwin_wayland_drm: failed to open drm device at "" And a lot of: > kwin_wayland_drm: drmModeAddFB2 and drmModeAddFB both failed! Nepřípustný argument $ errno -l|grep 'Nepřípustný argument' EINVAL 22 Nepřípustný argument But those second messages are there even long before the crash. It seems like the logging rules aren't applied, did you add them? You can check if it worked with echo $QT_LOGGING_RULES it should print out the "kwin_*.debug=true;kwin_libinput.debug=false" line (In reply to Zamundaaa from comment #8) > It seems like the logging rules aren't applied, did you add them? Ah, I am stupid. I am not using sddm for a couple of weeks as it doesn't start any session, so the log was old. I am using this from console: /usr/lib64/libexec/plasma-dbus-run-session-if-needed /usr/bin/startplasma-wayland I assume the output is logged nowhere. Let me redirect the output to a file. > You can check if it worked with > echo $QT_LOGGING_RULES That's correctly set: $ echo $QT_LOGGING_RULES kwin_*.debug=true;kwin_libinput.debug=false BTW I also applied the patch from bug 439208#c3, but kwin still crashes with the very same backtrace. (In reply to Jiri Slaby from comment #9) > BTW I also applied the patch from bug 439208#c3, but kwin still crashes with > the very same backtrace. Just checked with the core file: > (gdb) l DrmConnector::DrmConnector > 25 if (m_conn) { > 26 for (int i = 0; i < m_conn->count_encoders; ++i) { > 27 m_encoders << m_conn->encoders[i]; > 28 } > 29 } else { > 30 qCWarning(KWIN_DRM) << "drmModeGetConnector failed!" << strerror(errno); > 31 } > 32 } > 33 > 34 DrmConnector::~DrmConnector() = default; Created attachment 139952 [details]
wayland-session.log
Created with kwin 5.22.1 and QT_LOGGING_RULES="kwin_*.debug=true;kwin_libinput.debug=false" on gentoo. Crash happend while undocking
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1164 Thanks for all the information, was really helpful in pinning it down. (In reply to Zamundaaa from comment #13) > Thanks for all the information, was really helpful in pinning it down. Thanks, patched, waiting for no crashes :). I'll merge it now, if it does happen again please do reopen! Git commit 54ce400764184eee067dc4f3d8d81cee2ec25537 by Xaver Hugl. Committed on 11/07/2021 at 22:56. Pushed by zamundaaa into branch 'Plasma/5.22'. platforms/drm: don't delete connectors in DrmGpu::removeOutput In DrmGpu::updateOutputs the connector is in the oldConnectors vector, in DrmGpu::~DrmGpu it's in m_connectors. In both cases that's causing a double free. M +0 -2 src/plugins/platforms/drm/drm_gpu.cpp https://invent.kde.org/plasma/kwin/commit/54ce400764184eee067dc4f3d8d81cee2ec25537 |