Bug 448162 - Every time I screencast the screen, Plasma crashes in GLVertexBufferPrivate::interleaveArrays()
Summary: Every time I screencast the screen, Plasma crashes in GLVertexBufferPrivate::...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.23.5
Platform: Arch Linux Linux
: NOR crash
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 435042 449599 (view as bug list)
Depends on:
Blocks:
 
Reported: 2022-01-09 13:56 UTC by Allexus J
Modified: 2022-02-14 09:45 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.24.1
Sentry Crash Report:


Attachments
core dump with kwin recompiled with debug symbols (42.35 KB, text/plain)
2022-01-09 13:56 UTC, Allexus J
Details
journalctl of the crash (125.21 KB, text/plain)
2022-01-09 14:16 UTC, Allexus J
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Allexus J 2022-01-09 13:56:35 UTC
Created attachment 145265 [details]
core dump with kwin recompiled with debug symbols

SUMMARY
I switched from GNOME to KDE, and I realized this bug that doesn't allow me to share the screen at all. Every time I share the screen, after some seconds or minutes, Plasma crashes.
I recompiled kwin to add debug symbols and reproduced the crash again, I've uploaded the core dump as attachment. Tell me if I have to recompile something else with debug symbols, I don't know if the core dump is really clear. 
The bug only happens with Wayland.


STEPS TO REPRODUCE
1. Share the screen
2. Wait some time(minutes, but even seconds)
3. Plasma crashes and gives core dump

OBSERVED RESULT
Plasma crashes

EXPECTED RESULT
Shouldn't crash

SOFTWARE/OS VERSIONS
ArchLinux, kernel 5.15.13
KDE Plasma: 5.23.5
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
Comment 1 Allexus J 2022-01-09 14:08:30 UTC
UPDATE:
I notice this crash only when I share the screen on Chrome. For example I tried MS Teams, and Discord (screencast via Pipewire chrome flag) and they both make Plasma crash. On Firefox, it seems that it does not crash
Comment 2 Allexus J 2022-01-09 14:16:11 UTC
Created attachment 145267 [details]
journalctl of the crash
Comment 3 Allexus J 2022-01-09 18:15:43 UTC
UPDATE2:
I confirm that this does not happen on Firefox. It happens on Chrome.
Comment 4 David Edmundson 2022-01-09 21:22:27 UTC
                Stack trace of thread 637:
                #0  0x00007f49a90fc7a0 _ZN4KWin21GLVertexBufferPrivate16interleaveArraysEPfiPKfS3_i (libkwinglutils.so.13 + 0x167a0)
                #1  0x00007f49a90fd801 _ZN4KWin14GLVertexBuffer7setDataEiiPKfS2_ (libkwinglutils.so.13 + 0x17801)
                #2  0x00007f49a90f7edc _ZN4KWin9GLTexture6renderERK7QRegionRK5QRectb (libkwinglutils.so.13 + 0x11edc)
                #3  0x00005584ff5b4dbe _ZN4KWin14PipeWireStream11recordFrameEPNS_9GLTextureERK7QRegion (kwin_wayland + 0x57dbe)
                #4  0x00005584ff5b5949 operator() (kwin_wayland + 0x58949)
                #5  0x00007f49a7c5dc03 n/a (libQt5Core.so.5 + 0x2bbc03)
                #6  0x00007f49a9331a2c _ZN4KWin7Cursors15positionChangedEPNS_6CursorERK6QPoint (libkwin.so.5 + 0xd8a2c)
                #7  0x00007f49a7c5dc03 n/a (libQt5Core.so.5 + 0x2bbc03)
Comment 5 p d 2022-02-03 20:09:46 UTC
I have the same issue. Firefox doesn't make it crash, only Chromium does.

Operating System: Fedora Linux 35
KDE Plasma Version: 5.23.5
KDE Frameworks Version: 5.90.0
Qt Version: 5.15.2
Kernel Version: 5.15.18-200.fc35.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 4 × Intel® Core™ i5-7300U CPU @ 2.60GHz
Memory: 7.6 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 620
Comment 6 Vlad Zahorodnii 2022-02-04 15:04:30 UTC
*** Bug 449599 has been marked as a duplicate of this bug. ***
Comment 7 Bug Janitor Service 2022-02-10 15:05:05 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/kwin/-/merge_requests/1995
Comment 8 Vlad Zahorodnii 2022-02-11 09:49:08 UTC
Git commit 12427932dee29bdcb6831bc906d5a14df3a31461 by Vlad Zahorodnii, on behalf of David Edmundson.
Committed on 11/02/2022 at 09:24.
Pushed by vladz into branch 'master'.

Make openGL context current when recording frame triggered by cursor move

recordFrame requires an openGL context. This is typically done after a
frame is rendered, but when we send a frame after a cursor move this is
not guaranteed.

M  +5    -0    src/plugins/screencast/screencaststream.cpp

https://invent.kde.org/plasma/kwin/commit/12427932dee29bdcb6831bc906d5a14df3a31461
Comment 9 Vlad Zahorodnii 2022-02-11 09:50:02 UTC
Git commit 8f2ba3ef13ecdd6c93ba1ab537d4841bedbef495 by Vlad Zahorodnii, on behalf of David Edmundson.
Committed on 11/02/2022 at 09:49.
Pushed by vladz into branch 'Plasma/5.24'.

Make openGL context current when recording frame triggered by cursor move

recordFrame requires an openGL context. This is typically done after a
frame is rendered, but when we send a frame after a cursor move this is
not guaranteed.


(cherry picked from commit 12427932dee29bdcb6831bc906d5a14df3a31461)

M  +5    -0    src/plugins/screencast/screencaststream.cpp

https://invent.kde.org/plasma/kwin/commit/8f2ba3ef13ecdd6c93ba1ab537d4841bedbef495
Comment 10 Vlad Zahorodnii 2022-02-14 09:45:42 UTC
*** Bug 435042 has been marked as a duplicate of this bug. ***