Bugzilla – Bug 1222064
Spectacle segfaults when screen recording on Wayland (pipewire)
Last modified: 2024-04-10 18:33:26 UTC
Created attachment 873856 [details] Output of GDB when segfaulting Current Tumbleweed (and every version since KDE Plasma 6) segfaults when trying to record the screen on Wayland. Reproduce: 1. Open Spectacle 2. Select "Record" 3. Choose any option (I chose rectangular area but it does not matter) 4. Start recording 5. Stop recording 6. See segfault on stop Error (using GDB for debug info): > Thread 191 "PipeWireProduce" received signal SIGSEGV, Segmentation fault. > [Switching to Thread 0x7fff996006c0 (LWP 22415)] > PipeWireRecordProduce::cleanup (this=0x555555f925e0) at /usr/src/debug/kpipewire-6.0.2/src/pipewirerecord.cpp:199 Hardware: IdeaPad 5 14ALC05 (AMD Ryzen 5 5500U with integrated graphics) Additional info: I can not use X11 on Plasma 6 because that uses 100% CPU when screen is locked (kwin). So I am forced to use Wayland.
> could not load multimedia backend "" > QtMultimedia is not currently supported on this platform or compiler. > Failed to create QVideoSink "Not available" > Failed to initialize QMediaPlayer "Not available" I don't think that's what causes your crash, but I'll add a qt6-multimedia Requires to spectacle's spec file I can't reproduce on wayland (with a NVidia card) and my spectacle version
(In reply to Christophe Marin from comment #1) > I don't think that's what causes your crash, but I'll add a qt6-multimedia > Requires to spectacle's spec file Yes I have installed that package, but it still segfaults. I suspect an issue in kpipewire ?
BTW in dmesg I receive this message on segfault: > [ 8912.656331] PipeWireProduce[14032]: segfault at 0 ip 00007f070ee878a0 sp 00007f0699bff050 error 4 in libKPipeWireRecord.so.6.0.2[7f070ee81000+d000] likely on CPU 0 (core 0, socket 0) > [ 8912.656363] Code: ff 66 0f 1f 84 00 00 00 00 00 48 8b 44 24 38 64 48 2b 04 25 28 00 00 00 75 32 48 83 c4 48 5b 5d c3 66 0f 1f 84 00 00 00 00 00 <48> 8b 04 25 00 00 00 00 0f 0b 66 0f 1f 44 00 00 e8 7b eb ff ff 0f
Can you provide a gdb trace: - zypper in systemd-coredump (if systemd-coredump is not installed yet) - make sure the systemd-coredump service is enabled. - Produce the crash by trying to record wayland screen. - coredumpctl list - coredumpctl gdb PID-of-Spectacle-process gdb> thread apply all bt I did a quick internet search. If you are using NVIDIA, it might be the same issue as upstream bug: https://bugs.kde.org/show_bug.cgi?id=481977
(In reply to Vasilis Liaskovitis from comment #4) > > I did a quick internet search. If you are using NVIDIA, it might be the same > issue as upstream bug: > > https://bugs.kde.org/show_bug.cgi?id=481977 The attached file indicates the reporter uses an AMD based card
Created attachment 873933 [details] GDB backtrace GDB backtrace
(In reply to Vasilis Liaskovitis from comment #4) > Can you provide a gdb trace Sure I added the backtrace. > I did a quick internet search. If you are using NVIDIA, it might be the same > issue as upstream bug: No as written in the initial comment I am using an AMD 5500U with integrated graphics.
It seems this is a regression of this commit: https://invent.kde.org/plasma/kpipewire/-/commit/09124fb076346d0134c631966cdf6513b851708c This: ``` if (!m_encoder) { // Clear the queue of encoded packets. m_encoder->receivePacket(); } ``` causes a null pointer de-reference and should be fixed to: ``` if (m_encoder) { // Clear the queue of encoded packets. m_encoder->receivePacket(); } ``` The segfault is then gone. There also seems to be an upstream bug report: https://bugs.kde.org/show_bug.cgi?id=484620
Fixed upstream. I wonder whether this is the cause or only a symptom of a deeper issue, m_encoder should probably not be null in the first place.
Still segfaults with current openSUSE Tumbleweed. (Tumbleweed 2024-04-24)