Created attachment 148425 [details] Log of plasmashell --replace with it crashing SUMMARY When VSCodium is launched or already running, plasmashell instantly crashes with SIGSEGV. STEPS TO REPRODUCE 1. Launch VSCodium OBSERVED RESULT Plasmashell crashes EXPECTED RESULT Plasmashell to not crash SOFTWARE/OS VERSIONS Linux/KDE Plasma: Alpine Linux (available in About System) KDE Plasma Version: 5.24.4 KDE Frameworks Version: 5.93.0 Qt Version: 5.15.3 with KDE patches ADDITIONAL INFORMATION Since my host is Alpine Linux which uses Musl libc and Electron applications do not work with it, I run VSCodium in https://github.com/89luca89/distrobox. However other graphical applications like Firefox run just fine, so I doubt that has much to do with it.
I don't see a crash in the attached log. Can you get a backtrace?
Created attachment 148452 [details] Backtrace of plasmashell SIGSEGV'ing Seems it goes wrong somewhere in KWayland? Please let me know if I need to get debug symbols for libQt5Core.
Each call to readData allocates > 4KiB on stack, which with recursion that deep might blow the limits of the thread. Can you somehow increase the thread's default stack size to ~2MiB? The function could be improved to avoid recursion (and unbounded delay), can you try that? diff --git a/src/client/plasmawindowmanagement.cpp b/src/client/plasmawindowmanagement.cpp index 0098c728..903e5342 100644 --- a/src/client/plasmawindowmanagement.cpp +++ b/src/client/plasmawindowmanagement.cpp @@ -631,16 +631,14 @@ static int readData(int fd, QByteArray &data) int n; while (true) { n = QT_READ(fd, buf, sizeof buf); - if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) { + f (n > 0) { + data.append(buf, n); + } else if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) { usleep(1000); } else { break; } } - if (n > 0) { - data.append(buf, n); - n = readData(fd, data); - } return n; }
(In reply to Fabian Vogt from comment #3) > - if (n == -1 && (errno == EAGAIN) && ++retryCount < 1000) { > + f (n > 0) { Copy-paste error. I just opened a draft MR: https://invent.kde.org/frameworks/kwayland/-/merge_requests/61
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please mark the bug as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Not sure what info it needs more. https://invent.kde.org/frameworks/kwayland/-/merge_requests/61 fixes the issue and I have been shipping it on Alpine Linux so far, hoping it or something comparable gets merged eventually.
Git commit d0edf838f142114d9074c1ff54f420da47cc92c3 by Fabian Vogt. Committed on 23/09/2022 at 10:18. Pushed by fvogt into branch 'master'. PlasmaWindowManagement: Avoid unbounded recursion and delay in readData It recurses for each partial read, which can lead to unbounded recursion depth and delay (retryCount isn't passed). Convert the code to be iterative to fix that, which is also much simpler. M +3 -5 src/client/plasmawindowmanagement.cpp https://invent.kde.org/frameworks/kwayland/commit/d0edf838f142114d9074c1ff54f420da47cc92c3