Created attachment 134607 [details] kwin_x11 crash log SUMMARY Since Mesa 20.3 release, Kwin 5.20.4 has not been able to run with OpenGL support on rk3399 ARM boards, like the Rock Pi 4 and Pinebook Pro. I did a git bisect on mesa to see what commit of theirs caused this behaviour and found it to be: https://gitlab.freedesktop.org/mesa/mesa/-/commit/60ebeb4608a871ba89ba081c1c6e7ebdd5efec9a While, undoing this commit, does indeed give me back OpenGL compositing, the Mesa devs pointed out in my bug report to them, that it's likely a kwin issue instead. Mesa bug report: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4042 STEPS TO REPRODUCE 1. Install Mesa 20.3 on an rk3399 based device (Pinebook Pro was used here) 2. Make sure OpenGL 2.0 is selected in System Settings -> Display -> Compositor 3. Reboot OBSERVED RESULT When the Plasma session starts, Kwin_x11 immediately crashes with the attached output in the crash handler. EXPECTED RESULT OpenGL compositing should work just as it does on mesa 20.2. SOFTWARE/OS VERSIONS Linux/KDE Plasma: (available in About System) KDE Plasma Version: 5.20.4 KDE Frameworks Version: 5.77.0 Qt Version: 5.15.2 ADDITIONAL INFORMATION
Could you build KWin with debug symbols (easiest with kdesrc-build) and generate a full backtrace?
(In reply to Zamundaaa from comment #1) > Could you build KWin with debug symbols (easiest with kdesrc-build) and > generate a full backtrace? I don't really know how to do this. Building kwin with debug, I need to add something to the build options, right? Right now we have: cmake -B build -S $pkgname-$pkgver \ -DCMAKE_INSTALL_LIBEXECDIR=lib \ -DBUILD_TESTING=OFF cmake --build build What option do I need to add for debug symbols?
You need to add -DCMAKE_BUILD_TYPE=Debug or -DCMAKE_BUILD_TYPE=RelWithDebInfo to the cmake command.
(In reply to Vlad Zahorodnii from comment #3) > You need to add -DCMAKE_BUILD_TYPE=Debug or > -DCMAKE_BUILD_TYPE=RelWithDebInfo to the cmake command. Thanks. And how to do a full backtrace?
gdb /path/to/kwin_x11 Then use the command "run" to start kwin_x11 and once it crashes, use the command "bt" to obtain the backtrace.
(In reply to Zamundaaa from comment #5) > gdb /path/to/kwin_x11 > > Then use the command "run" to start kwin_x11 and once it crashes, use the > command "bt" to obtain the backtrace. Okay. I just built kwin 5.10.5 with "-DCMAKE_BUILD_TYPE=RelWithDebInfo". When running gdb /usr/bin/kwin_x11 after install of that kwin package, it tells me it can't find any debugging symbols in kwin_x11. And when I try "run" I get a FATAL error, that a kwin is already running (if in a GUI session) and a FATAL error saying no displays found (if running from a CLi session).
You probably forgot to pass "--replace" option. Since the screen will freeze when a debugger is attached to the kwin process, you should probably attach a debugger from a ssh session. I'm not sure that you need to attach a debugger though. If kwin crashes, you can retrieve the backtrace by clicking sad icon (drkonqi) in the system tray.
(In reply to Vlad Zahorodnii from comment #7) > You probably forgot to pass "--replace" option. Since the screen will freeze > when a debugger is attached to the kwin process, you should probably attach > a debugger from a ssh session. > > I'm not sure that you need to attach a debugger though. If kwin crashes, you > can retrieve the backtrace by clicking sad icon (drkonqi) in the system tray. That makes sense. Yeah. But if the debugger says there's no debugging info in kwin_x11, even though I built it with the option, wouldn't it just create the same backtrace as before?
(In reply to Dan Johansen from comment #6) > When running gdb /usr/bin/kwin_x11 after install of that kwin package, it > tells me it can't find any debugging symbols in kwin_x11. Unless you changed CMake options, programs are usually installed to /usr/local/bin, so try using /usr/local/bin/kwin_x11 instead. It's also possible that installing kwin stripped the debug symbols, so you could also search for kwin_x11 in the build directory and use that copy.
(In reply to Dan Johansen from comment #8) > Yeah. But if the debugger says there's no debugging info in kwin_x11, even > though I built it with the option, wouldn't it just create the same > backtrace as before? Did you run `kwin_x11 --replace` after building and installing kwin package?
No, I rebooted, which should hopefully do about the same.
Okay. I figured out why my kwin build was still missing debug symbols, so I added the backtrace from drkonqi with debug symbols.
Created attachment 135026 [details] kwin_x11 crash log with debug symbols
Weird. Kwin crashes when it sets the swap interval. Does kwin crash when vsync is disabled?
(In reply to Vlad Zahorodnii from comment #14) > Weird. Kwin crashes when it sets the swap interval. Does kwin crash when > vsync is disabled? Just tried. Can confirm, that yes it does crash with Vsync option in Compositor set to Never.
Can you post the backtrace of the crash when vsync is disabled?
I would love to, but the Crash Handler always crashes "unexpectedly" now and gdb /usr/bin/kwin_x11 + run --replace either freezes the device (if run from the plasma session) or says it can't connect to the display (if run from TTY/SSH).
I just found this "old" merge request in the KDE gitlab. https://invent.kde.org/plasma/kwin/-/merge_requests/145 Does this mean it has been merged, but not released yet?
Another thought just hit me. Is it actually what caused this issue? The above commits seems to be in both 5.20 and 5.21. And it started happening in 5.20 with the update to mesa 20.3, where they implemented some generalization around GLX swap control.
Plasma 5.21 just got into our repositories, so I just tested with kwin 5.21 and Mesa 20.3.4 from Arch. Issue seems to be resolved. There's no crash, and the OpenGL stuff seems to work. Closing issue and thanks for the help.