Bug 455630

Summary: kwin_wayland crashed in VMs using the llvmpipe graphics driver
Product: [Plasma] kwin Reporter: Matt Fagnani <matt.fagnani>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED UPSTREAM    
Severity: crash CC: nate
Priority: NOR    
Version: 5.25.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Matt Fagnani 2022-06-20 05:02:15 UTC
SUMMARY

kwin_wayland crashed at least 10 times in Fedora Rawhide/37 GNOME Boxes QEMU-KVM VMs using the llvmpipe graphics driver from mesa 22.1.2 and virtio gpu. The crashes sometimes happened when I was using Firefox, Konsole, Dolphin, and kwrite. Some crashes were when I right-clicked on text in Konsole, Firefox, and kwrite and tried to copy and paste it such as when trying the report this problem here. One crash happened when I right-clicked on a file in Dolphin and tried to copy and paste. Other crashes seemed random. The trace of the crashes seemed consistent.

Core was generated by `/usr/bin/kwin_wayland --wayland-fd 7 --socket wayland-0 --xwayland-fd 8 --xwayl'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x00007feb9e9f9670 in ?? ()
[Current thread is 1 (Thread 0x7feb7a5fc640 (LWP 3064))]
(gdb) thread apply all bt

Thread 14 (Thread 0x7feb7adfd640 (LWP 3063)):
#0  0x00007feb9e9f9670 in ?? ()
#1  0x0000000000000000 in ?? ()

Thread 13 (Thread 0x7feb59b78640 (LWP 3071)):
#0  0x00007feb9c71cf1f in poll () from /lib64/libc.so.6
#1  0x00007feb9ab7421d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007feb9ab1c930 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007feb9d8f88da in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007feb9d8a669a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007feb9d6e718a in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007feb9e74a469 in QQmlThreadPrivate::run() () from /lib64/libQt5Qml.so.5
#7  0x00007feb9d6e8487 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#9  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 12 (Thread 0x7feb78df9640 (LWP 3067)):
#0  0x00007feb9c6a5a89 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007feb9c6a8280 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007feb82cb83d3 in cnd_wait (mtx=0x56513e6c9690, cond=0x56513e6c96b8) at ../include/c11/threads_posix.h:155
#3  lp_cs_tpool_worker (data=data@entry=0x56513e6c9690) at ../src/gallium/drivers/llvmpipe/lp_cs_tpool.c:49
#4  0x00007feb82cb834b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#5  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#6  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 11 (Thread 0x7feb79dfb640 (LWP 3065)):
#0  0x00007feb9c6a5a89 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007feb9c6a8280 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007feb82cb83d3 in cnd_wait (mtx=0x56513e6c9690, cond=0x56513e6c96b8) at ../include/c11/threads_posix.h:155
#3  lp_cs_tpool_worker (data=data@entry=0x56513e6c9690) at ../src/gallium/drivers/llvmpipe/lp_cs_tpool.c:49
#4  0x00007feb82cb834b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
--Type <RET> for more, q to quit, c to continue without paging--c
#5  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#6  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 10 (Thread 0x7feb89538640 (LWP 3058)):
#0  0x00007feb9c71cf1f in poll () from /lib64/libc.so.6
#1  0x00007feb9ab7421d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007feb9ab1c930 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007feb9d8f88da in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007feb9d8a669a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007feb9d6e718a in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007feb9d6e8487 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#7  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#8  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 9 (Thread 0x7feb7bdff640 (LWP 3061)):
#0  0x00007feb9c6a7299 in pthread_barrier_wait@GLIBC_2.2.5 () from /lib64/libc.so.6
#1  0x00007feb82cbb907 in util_barrier_wait (barrier=0x56513e6bfe60) at ../src/util/u_thread.h:298
#2  thread_function (init_data=init_data@entry=0x56513e6be7d8) at ../src/gallium/drivers/llvmpipe/lp_rast.c:1229
#3  0x00007feb82cbae2b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#4  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#5  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 8 (Thread 0x7feb9e25f980 (LWP 3039)):
#0  0x00007feb9c76fe04 in __memset_avx2_unaligned_erms () from /lib64/libc.so.6
#1  0x00007feb82cc7e67 in memset (__len=1572864, __ch=0, __dest=0x7feb5a69acc0) at /usr/include/bits/string_fortified.h:59
#2  lp_scene_end_rasterization (scene=0x7feb5a69a8a8) at ../src/gallium/drivers/llvmpipe/lp_scene.c:251
#3  0x00007feb82cc9ee8 in lp_setup_get_empty_scene (setup=<optimized out>) at ../src/gallium/drivers/llvmpipe/lp_setup.c:91
#4  set_scene_state (setup=setup@entry=0x56513e91dbc0, new_state=new_state@entry=SETUP_CLEARED, reason=<optimized out>) at ../src/gallium/drivers/llvmpipe/lp_setup.c:349
#5  0x00007feb82cc9fe9 in lp_setup_try_clear_color_buffer (setup=setup@entry=0x56513e91dbc0, color=color@entry=0x7feb88c842ec, cbuf=cbuf@entry=0) at ../src/gallium/drivers/llvmpipe/lp_setup.c:480
#6  0x00007feb82cca657 in lp_setup_clear (setup=0x56513e91dbc0, color=0x7feb88c842ec, depth=<optimized out>, stencil=<optimized out>, flags=4) at ../src/gallium/drivers/llvmpipe/lp_setup.c:585
#7  0x00007feb82933457 in st_Clear (ctx=0x7feb88c6e010, mask=128) at ../src/mesa/state_tracker/st_cb_clear.c:543
#8  0x000056513c842b3a in KWin::WindowScreenCastSource::render (this=0x56513f7a0a40, target=<optimized out>) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/plugins/screencast/windowscreencastsource.cpp:63
#9  0x000056513c84299f in KWin::WindowScreenCastSource::render (this=0x56513f7a0a40, image=0x7ffd12d09e70) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/plugins/screencast/windowscreencastsource.cpp:47
#10 0x000056513c83f9d5 in KWin::ScreenCastStream::recordFrame (this=0x56513f6551e0, damagedRegion=...) at /usr/include/qt5/QtCore/qscopedpointer.h:116
#11 0x000056513c8335ce in KWin::WindowStream::bufferToStream (this=0x56513f6551e0) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/plugins/screencast/screencastmanager.cpp:79
#12 0x00007feb9d8db216 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#13 0x00007feb9ec64e95 in KWin::Scene::paintScreen (this=0x56513e64f800, region=...) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/scene.cpp:488
#14 0x00007feb9ed39138 in KWin::SceneOpenGL::paint (this=0x56513e64f800, renderTarget=<optimized out>, region=...) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/scenes/opengl/scene_opengl.cpp:98
#15 0x00007feb9ec637f3 in KWin::SceneDelegate::paint (this=<optimized out>, renderTarget=0x7ffd12d0a220, region=...) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/scene.cpp:126
#16 0x00007feb9ebbdd58 in KWin::Compositor::paintPass (this=this@entry=0x56513e64d490, layer=layer@entry=0x56513f49bbd0, target=target@entry=0x7ffd12d0a220, region=...) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/composite.cpp:728
#17 0x00007feb9ebbf66c in KWin::Compositor::composite (this=0x56513e64d490, renderLoop=0x56513eb0f8c0) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/composite.cpp:672
#18 0x00007feb9d8db216 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#19 0x00007feb9eb86016 in KWin::RenderLoop::frameRequested (this=<optimized out>, _t1=<optimized out>) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/redhat-linux-build/src/kwin_autogen/EWIEGA46WW/moc_renderloop.cpp:206
#20 0x00007feb9ec578e7 in KWin::RenderLoopPrivate::dispatch (this=0x56513eb11340) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/renderloop.cpp:151
#21 0x00007feb9d8db216 in void doActivate<false>(QObject*, int, void**) () from /lib64/libQt5Core.so.5
#22 0x00007feb9d8de5ae in QTimer::timeout(QTimer::QPrivateSignal) () from /lib64/libQt5Core.so.5
#23 0x00007feb9d8d1b05 in QObject::event(QEvent*) () from /lib64/libQt5Core.so.5
#24 0x00007feb9cdaec42 in QApplicationPrivate::notify_helper(QObject*, QEvent*) () from /lib64/libQt5Widgets.so.5
#25 0x00007feb9d8a7c38 in QCoreApplication::notifyInternal2(QObject*, QEvent*) () from /lib64/libQt5Core.so.5
#26 0x00007feb9d8f7c61 in QTimerInfoList::activateTimers() () from /lib64/libQt5Core.so.5
#27 0x00007feb9d8f6210 in QEventDispatcherUNIX::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#28 0x000056513c8e50a1 in QUnixEventDispatcherQPA::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
#29 0x00007feb9d8a669a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#30 0x00007feb9d8ae742 in QCoreApplication::exec() () from /lib64/libQt5Core.so.5
#31 0x000056513c810367 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/kwin-5.25.0-1.fc37.x86_64/src/main_wayland.cpp:642

Thread 7 (Thread 0x7feb5b7fe640 (LWP 3069)):
#0  0x00007feb9c6a5a89 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007feb9c6a8280 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007feb826c18eb in cnd_wait (mtx=0x56513e681f58, cond=0x56513e681f80) at ../include/c11/threads_posix.h:155
#3  util_queue_thread_func (input=input@entry=0x56513e672670) at ../src/util/u_queue.c:294
#4  0x00007feb826c153b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#5  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#6  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 6 (Thread 0x7feb5a379640 (LWP 4906)):
#0  0x00007feb9c728c4e in epoll_wait () from /lib64/libc.so.6
#1  0x00007feb43396ac8 in impl_pollfd_wait () from /usr/lib64/spa-0.2/support/libspa-support.so
#2  0x00007feb43389331 in loop_iterate () from /usr/lib64/spa-0.2/support/libspa-support.so
#3  0x00007feb9d3943a7 in do_loop () from /lib64/libpipewire-0.3.so.0
#4  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#5  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 5 (Thread 0x7feb5bfff640 (LWP 3068)):
#0  0x00007feb9c6a5a89 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007feb9c6a8280 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007feb82cb83d3 in cnd_wait (mtx=0x56513e6c9690, cond=0x56513e6c96b8) at ../include/c11/threads_posix.h:155
#3  lp_cs_tpool_worker (data=data@entry=0x56513e6c9690) at ../src/gallium/drivers/llvmpipe/lp_cs_tpool.c:49
#4  0x00007feb82cb834b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#5  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#6  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 4 (Thread 0x7feb795fa640 (LWP 3066)):
#0  0x00007feb9c6a5a89 in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1  0x00007feb9c6a8280 in pthread_cond_wait@@GLIBC_2.3.2 () from /lib64/libc.so.6
#2  0x00007feb82cb83d3 in cnd_wait (mtx=0x56513e6c9690, cond=0x56513e6c96b8) at ../include/c11/threads_posix.h:155
#3  lp_cs_tpool_worker (data=data@entry=0x56513e6c9690) at ../src/gallium/drivers/llvmpipe/lp_cs_tpool.c:49
#4  0x00007feb82cb834b in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#5  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#6  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 3 (Thread 0x7feb7b5fe640 (LWP 3062)):
#0  0x00007feb9e9f9670 in ?? ()
#1  0x0000000000000000 in ?? ()

Thread 2 (Thread 0x7feb8a041640 (LWP 3049)):
#0  0x00007feb9c71cf1f in poll () from /lib64/libc.so.6
#1  0x00007feb9ab7421d in g_main_context_iterate.constprop () from /lib64/libglib-2.0.so.0
#2  0x00007feb9ab1c930 in g_main_context_iteration () from /lib64/libglib-2.0.so.0
#3  0x00007feb9d8f88da in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#4  0x00007feb9d8a669a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) () from /lib64/libQt5Core.so.5
#5  0x00007feb9d6e718a in QThread::exec() () from /lib64/libQt5Core.so.5
#6  0x00007feb9efcdaeb in QDBusConnectionManager::run() () from /lib64/libQt5DBus.so.5
#7  0x00007feb9d6e8487 in QThreadPrivate::start(void*) () from /lib64/libQt5Core.so.5
#8  0x00007feb9c6a8e9d in start_thread () from /lib64/libc.so.6
#9  0x00007feb9c729680 in clone3 () from /lib64/libc.so.6

Thread 1 (Thread 0x7feb7a5fc640 (LWP 3064)):
#0  0x00007feb9e9f9670 in ?? ()
#1  0x0000000000000000 in ?? ()

The crashing thread had ??s instead of the function namesin gdb so I'll include the trace in this form which didn't.

Stack trace of thread 3064:
                #0  0x00007feb9e9f9670 n/a (n/a + 0x0)
                #1  0x00007feb82cbc712 shade_quads_mask (virtio_gpu_dri.so + 0x6bc712)
                #2  0x00007feb82cbc91a lp_rast_linear_rect_fallback (virtio_gpu_dri.so + 0x6bc91a)
                #3  0x00007feb82cbc4b2 lp_rast_linear_rect (virtio_gpu_dri.so + 0x6bc4b2)
                #4  0x00007feb82cbc586 lp_linear_rasterize_bin (virtio_gpu_dri.so + 0x6bc586)
                #5  0x00007feb82cbb810 rasterize_scene (virtio_gpu_dri.so + 0x6bb810)
                #6  0x00007feb82cbb913 thread_function (virtio_gpu_dri.so + 0x6bb913)
                #7  0x00007feb82cbae2b impl_thrd_routine (virtio_gpu_dri.so + 0x6bae2b)
                #8  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #9  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3049:
                #0  0x00007feb9c71cf1f __poll (libc.so.6 + 0xfaf1f)
                #1  0x00007feb9ab7421d g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa21d)
                #2  0x00007feb9ab1c930 g_main_context_iteration (libglib-2.0.so.0 + 0x52930)
                #3  0x00007feb9d8f88da _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2f88da)
                #4  0x00007feb9d8a669a _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2a669a)
                #5  0x00007feb9d6e718a _ZN7QThread4execEv (libQt5Core.so.5 + 0xe718a)
                #6  0x00007feb9efcdaeb _ZN22QDBusConnectionManager3runEv (libQt5DBus.so.5 + 0x1baeb)
                #7  0x00007feb9d6e8487 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xe8487)
                #8  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #9  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3062:
                #0  0x00007feb9e9f9670 n/a (n/a + 0x0)
                #1  0x00007feb82cbc712 shade_quads_mask (virtio_gpu_dri.so + 0x6bc712)
                #2  0x00007feb82cbc91a lp_rast_linear_rect_fallback (virtio_gpu_dri.so + 0x6bc91a)
                #3  0x00007feb82cbc4b2 lp_rast_linear_rect (virtio_gpu_dri.so + 0x6bc4b2)
                #4  0x00007feb82cbc586 lp_linear_rasterize_bin (virtio_gpu_dri.so + 0x6bc586)
                #5  0x00007feb82cbb810 rasterize_scene (virtio_gpu_dri.so + 0x6bb810)
                #6  0x00007feb82cbb913 thread_function (virtio_gpu_dri.so + 0x6bb913)
                #7  0x00007feb82cbae2b impl_thrd_routine (virtio_gpu_dri.so + 0x6bae2b)
                #8  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #9  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3066:
                #0  0x00007feb9c6a5a89 __futex_abstimed_wait_common (libc.so.6 + 0x83a89)
                #1  0x00007feb9c6a8280 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x86280)
                #2  0x00007feb82cb83d3 lp_cs_tpool_worker (virtio_gpu_dri.so + 0x6b83d3)
                #3  0x00007feb82cb834b impl_thrd_routine (virtio_gpu_dri.so + 0x6b834b)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3068:
                #0  0x00007feb9c6a5a89 __futex_abstimed_wait_common (libc.so.6 + 0x83a89)
                #1  0x00007feb9c6a8280 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x86280)
                #2  0x00007feb82cb83d3 lp_cs_tpool_worker (virtio_gpu_dri.so + 0x6b83d3)
                #3  0x00007feb82cb834b impl_thrd_routine (virtio_gpu_dri.so + 0x6b834b)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 4906:
                #0  0x00007feb9c728c4e epoll_wait (libc.so.6 + 0x106c4e)
                #1  0x00007feb43396ac8 impl_pollfd_wait (libspa-support.so + 0x14ac8)
                #2  0x00007feb43389331 loop_iterate (libspa-support.so + 0x7331)
                #3  0x00007feb9d3943a7 do_loop (libpipewire-0.3.so.0 + 0x423a7)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3069:
                #0  0x00007feb9c6a5a89 __futex_abstimed_wait_common (libc.so.6 + 0x83a89)
                #1  0x00007feb9c6a8280 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x86280)
                #2  0x00007feb826c18eb util_queue_thread_func (virtio_gpu_dri.so + 0xc18eb)
                #3  0x00007feb826c153b impl_thrd_routine (virtio_gpu_dri.so + 0xc153b)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3039:
                #0  0x00007feb9c76fe04 __memset_avx2_unaligned_erms (libc.so.6 + 0x14de04)
                #1  0x00007feb82cc7e67 lp_scene_end_rasterization (virtio_gpu_dri.so + 0x6c7e67)
                #2  0x00007feb82cc9ee8 set_scene_state.constprop.0 (virtio_gpu_dri.so + 0x6c9ee8)
                #3  0x00007feb82cc9fe9 lp_setup_try_clear_color_buffer (virtio_gpu_dri.so + 0x6c9fe9)
                #4  0x00007feb82cca657 lp_setup_clear (virtio_gpu_dri.so + 0x6ca657)
                #5  0x00007feb82933457 st_Clear (virtio_gpu_dri.so + 0x333457)
                #6  0x000056513c842b3a _ZN4KWin22WindowScreenCastSource6renderEPNS_13GLFramebufferE (kwin_wayland + 0x8ab3a)
                #7  0x000056513c84299f _ZN4KWin22WindowScreenCastSource6renderEP6QImage (kwin_wayland + 0x8a99f)
                #8  0x000056513c83f9d5 _ZN4KWin16ScreenCastStream11recordFrameERK7QRegion (kwin_wayland + 0x879d5)
                #9  0x000056513c8335ce _ZN4KWin12WindowStream14bufferToStreamEv (kwin_wayland + 0x7b5ce)
                #10 0x00007feb9d8db216 _Z10doActivateILb0EEvP7QObjectiPPv (libQt5Core.so.5 + 0x2db216)
                #11 0x00007feb9ec64e95 _ZN4KWin5Scene11paintScreenERK7QRegion (libkwin.so.5 + 0x264e95)
                #12 0x00007feb9ed39138 _ZN4KWin11SceneOpenGL5paintEPNS_12RenderTargetERK7QRegion (libkwin.so.5 + 0x339138)
                #13 0x00007feb9ec637f3 _ZN4KWin13SceneDelegate5paintEPNS_12RenderTargetERK7QRegion (libkwin.so.5 + 0x2637f3)
                #14 0x00007feb9ebbdd58 _ZN4KWin10Compositor9paintPassEPNS_11RenderLayerEPNS_12RenderTargetERK7QRegion (libkwin.so.5 + 0x1bdd58)
                #15 0x00007feb9ebbf66c _ZN4KWin10Compositor9compositeEPNS_10RenderLoopE (libkwin.so.5 + 0x1bf66c)
                #16 0x00007feb9d8db216 _Z10doActivateILb0EEvP7QObjectiPPv (libQt5Core.so.5 + 0x2db216)
                #17 0x00007feb9eb86016 _ZN4KWin10RenderLoop14frameRequestedEPS0_ (libkwin.so.5 + 0x186016)
                #18 0x00007feb9ec578e7 _ZN4KWin17RenderLoopPrivate8dispatchEv (libkwin.so.5 + 0x2578e7)
                #19 0x00007feb9d8db216 _Z10doActivateILb0EEvP7QObjectiPPv (libQt5Core.so.5 + 0x2db216)
                #20 0x00007feb9d8de5ae _ZN6QTimer7timeoutENS_14QPrivateSignalE (libQt5Core.so.5 + 0x2de5ae)
                #21 0x00007feb9d8d1b05 _ZN7QObject5eventEP6QEvent (libQt5Core.so.5 + 0x2d1b05)
                #22 0x00007feb9cdaec42 _ZN19QApplicationPrivate13notify_helperEP7QObjectP6QEvent (libQt5Widgets.so.5 + 0x1aec42)
                #23 0x00007feb9d8a7c38 _ZN16QCoreApplication15notifyInternal2EP7QObjectP6QEvent (libQt5Core.so.5 + 0x2a7c38)
                #24 0x00007feb9d8f7c61 _ZN14QTimerInfoList14activateTimersEv (libQt5Core.so.5 + 0x2f7c61)
                #25 0x00007feb9d8f6210 _ZN20QEventDispatcherUNIX13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2f6210)
                #26 0x000056513c8e50a1 _ZN23QUnixEventDispatcherQPA13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (kwin_wayland + 0x12d0a1)
                #27 0x00007feb9d8a669a _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2a669a)
                #28 0x00007feb9d8ae742 _ZN16QCoreApplication4execEv (libQt5Core.so.5 + 0x2ae742)
                #29 0x000056513c810367 main (kwin_wayland + 0x58367)
                #30 0x00007feb9c645550 __libc_start_call_main (libc.so.6 + 0x23550)
                #31 0x00007feb9c645609 __libc_start_main@@GLIBC_2.34 (libc.so.6 + 0x23609)
                #32 0x000056513c8119e5 _start (kwin_wayland + 0x599e5)
                
                Stack trace of thread 3061:
                #0  0x00007feb9c6a7299 pthread_barrier_wait@@GLIBC_2.34 (libc.so.6 + 0x85299)
                #1  0x00007feb82cbb907 thread_function (virtio_gpu_dri.so + 0x6bb907)
                #2  0x00007feb82cbae2b impl_thrd_routine (virtio_gpu_dri.so + 0x6bae2b)
                #3  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #4  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3058:
                #0  0x00007feb9c71cf1f __poll (libc.so.6 + 0xfaf1f)
                #1  0x00007feb9ab7421d g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa21d)
                #2  0x00007feb9ab1c930 g_main_context_iteration (libglib-2.0.so.0 + 0x52930)
                #3  0x00007feb9d8f88da _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2f88da)
                #4  0x00007feb9d8a669a _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2a669a)
                #5  0x00007feb9d6e718a _ZN7QThread4execEv (libQt5Core.so.5 + 0xe718a)
                #6  0x00007feb9d6e8487 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xe8487)
                #7  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #8  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3065:
                #0  0x00007feb9c6a5a89 __futex_abstimed_wait_common (libc.so.6 + 0x83a89)
                #1  0x00007feb9c6a8280 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x86280)
                #2  0x00007feb82cb83d3 lp_cs_tpool_worker (virtio_gpu_dri.so + 0x6b83d3)
                #3  0x00007feb82cb834b impl_thrd_routine (virtio_gpu_dri.so + 0x6b834b)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3067:
                #0  0x00007feb9c6a5a89 __futex_abstimed_wait_common (libc.so.6 + 0x83a89)
                #1  0x00007feb9c6a8280 pthread_cond_wait@@GLIBC_2.3.2 (libc.so.6 + 0x86280)
                #2  0x00007feb82cb83d3 lp_cs_tpool_worker (virtio_gpu_dri.so + 0x6b83d3)
                #3  0x00007feb82cb834b impl_thrd_routine (virtio_gpu_dri.so + 0x6b834b)
                #4  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #5  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3071:
                #0  0x00007feb9c71cf1f __poll (libc.so.6 + 0xfaf1f)
                #1  0x00007feb9ab7421d g_main_context_iterate.constprop.0 (libglib-2.0.so.0 + 0xaa21d)
                #2  0x00007feb9ab1c930 g_main_context_iteration (libglib-2.0.so.0 + 0x52930)
                #3  0x00007feb9d8f88da _ZN20QEventDispatcherGlib13processEventsE6QFlagsIN10QEventLoop17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2f88da)
                #4  0x00007feb9d8a669a _ZN10QEventLoop4execE6QFlagsINS_17ProcessEventsFlagEE (libQt5Core.so.5 + 0x2a669a)
                #5  0x00007feb9d6e718a _ZN7QThread4execEv (libQt5Core.so.5 + 0xe718a)
                #6  0x00007feb9e74a469 _ZN17QQmlThreadPrivate3runEv (libQt5Qml.so.5 + 0x34a469)
                #7  0x00007feb9d6e8487 _ZN14QThreadPrivate5startEPv (libQt5Core.so.5 + 0xe8487)
                #8  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #9  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)
                
                Stack trace of thread 3063:
                #0  0x00007feb9e9f9670 n/a (n/a + 0x0)
                #1  0x00007feb82cbc712 shade_quads_mask (virtio_gpu_dri.so + 0x6bc712)
                #2  0x00007feb82cbc91a lp_rast_linear_rect_fallback (virtio_gpu_dri.so + 0x6bc91a)
                #3  0x00007feb82cbc4b2 lp_rast_linear_rect (virtio_gpu_dri.so + 0x6bc4b2)
                #4  0x00007feb82cbc586 lp_linear_rasterize_bin (virtio_gpu_dri.so + 0x6bc586)
                #5  0x00007feb82cbb810 rasterize_scene (virtio_gpu_dri.so + 0x6bb810)
                #6  0x00007feb82cbb913 thread_function (virtio_gpu_dri.so + 0x6bb913)
                #7  0x00007feb82cbae2b impl_thrd_routine (virtio_gpu_dri.so + 0x6bae2b)
                #8  0x00007feb9c6a8e9d start_thread (libc.so.6 + 0x86e9d)
                #9  0x00007feb9c729680 __clone3 (libc.so.6 + 0x107680)


STEPS TO REPRODUCE
1.  Boot a Fedora 36 KDE Plasma installation 
2.  Log in to Plasma on Wayland
3.  install GNOME Boxes if it isn't already with sudo dnf install gnome-boxes
4.  Download Fedora-KDE-Live-x86_64-Rawhide-20220617.n.0.iso from https://koji.fedoraproject.org/koji/buildinfo?buildID=1986249
5. Start GNOME Boxes
6. Start a QEMU-KVM VM with Fedora-KDE-Live-x86_64-Rawhide-20220617.n.0.iso in GNOME Boxes with 3 GB RAM, 3D acceleration disabled (the default), and EFI enabled
7. Start Firefox in Plasma
8. Start konsole
9. Use Firefox and Konsole until the crash happens which is usually within 5-10 minutes. Right-click on text in konsole and firefox and try to copy and paste to the other.


OBSERVED RESULT


EXPECTED RESULT


SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Fedora Rawhide/37
(available in About System)
KDE Plasma Version: 5.25.0
KDE Frameworks Version: 5.94.0
Qt Version: 5.15.4

ADDITIONAL INFORMATION
These crashes didn't happen when using the same Fedora Rawhide KDE Plasma image on bare metal with the radeonsi mesa driver and amdgpu kernel driver with an integrated Radeon R5 GPU or in a GNOME Boxes QEMU-KVM VM with 3D acceleration enabled using the virgl driver and virtio gpu. The problem might involve the llvmpipe driver.
Comment 1 Vlad Zahorodnii 2022-06-20 07:52:02 UTC
> The problem might involve the llvmpipe driver.

Indeed, this looks something something llvmpipy.

The crash occurs when kwin calls glClear() over here https://invent.kde.org/plasma/kwin/-/blob/4699f8c0e2be8edce24133fb2678ef9f7a07cafa/src/plugins/screencast/windowscreencastsource.cpp
Comment 2 Matt Fagnani 2022-06-21 02:14:02 UTC
(In reply to Vlad Zahorodnii from comment #1)
> > The problem might involve the llvmpipe driver.
> 
> Indeed, this looks something something llvmpipy.
> 
> The crash occurs when kwin calls glClear() over here
> https://invent.kde.org/plasma/kwin/-/blob/
> 4699f8c0e2be8edce24133fb2678ef9f7a07cafa/src/plugins/screencast/
> windowscreencastsource.cpp

Thanks. I reported this problem to Mesa at https://gitlab.freedesktop.org/mesa/mesa/-/issues/6710 and Fedora at https://bugzilla.redhat.com/show_bug.cgi?id=2098535