WM hang inside _mesa_draw_arrays / DRI2GetBuffersWithFormat
I don't know how long this has been happening because I've only recently realised that KWin was set to use XRender backend for compositing. I switched to OpenGL (2.0 or 3.1) and the experience is smoother, except for the hang below. I also note I have yet to reproduce the hang before the first suspend-to-RAM on this system, but it could simply be a matter of luck / timing.
Steps to reproduce:
- Start KDE Plasma shell, with kwin_x11 with compositor enabled, OpenGL mode
- suspend to ram
- resume from RAM
- use computer for some time (doesn't seem to be relate to any specific application running)
I usually have KMail, Chrome (--disable-gpu, for other reasons) and Firefox running, alongside a few Konsole windows with transparency on.
As soon as this hang happens, the destop becoms unusable (completely frozen, but the mouse cursor does move and does react to the windows behind) as the compositor and WM is hung. I have to flip to a virtual console, kill it (-9) and start it again. The desktop appears to work fine for some time after this, until the hang happens again.
I do sometimes notice some drawing glitches with the compositor active: I see some checkerboard pattern drawn for a frame or two before it gets replaced with the correct content. This happens when using the desktop effects to switch virtual desktops, for example. Disabling and re-enabling compositing in KWin seems to solve this problem, until it is restarted. This may be unrelated.
I've needed to restart KWin twice between starting this text and finishing this post.
#4 0x00007f05efb8383f in __GI___poll (fds=fds@entry=0x7ffe05eae798, nfds=nfds@entry=1, timeout=timeout@entry=-1) at ../sysdeps/unix/sysv/linux/poll.c:29
#5 0x00007f05efe47862 in poll (__timeout=-1, __nfds=1, __fds=0x7ffe05eae798) at /usr/include/bits/poll2.h:46
#6 _xcb_conn_wait (c=0x55e8350a5e20, vector=0x0, count=0x0, cond=<optimized out>) at xcb_conn.c:480
#7 0x00007f05efe47f21 in _xcb_conn_wait (count=0x0, vector=0x0, cond=0x7ffe05eae8c0, c=0x55e8350a5e20) at xcb_conn.c:446
#8 wait_for_reply (c=c@entry=0x55e8350a5e20, request=request@entry=363430, e=e@entry=0x7ffe05eae980) at xcb_in.c:516
#9 0x00007f05efe48f02 in xcb_wait_for_reply64 (c=0x55e8350a5e20, request=363430, e=0x7ffe05eae980) at xcb_in.c:560
#10 0x00007f05ee34d3c8 in _XReply () at /usr/lib64/libX11.so.6
#11 0x00007f05e185f1cb in DRI2GetBuffersWithFormat (outCount=0x7ffe05eaeab8, count=<optimized out>, attachments=0x7ffe05eaeae0, height=0x55e8354e30ec, width=0x55e8354e30e8, drawable=167772216, dpy=0x55e8350a3a30) at ../src/glx/dri2.c:485
#12 dri2GetBuffersWithFormat (driDrawable=<optimized out>, width=0x55e8354e30e8, height=0x55e8354e30ec, attachments=0x7ffe05eaeae0, count=<optimized out>, out_count=0x7ffe05eaeab8, loaderPrivate=0x55e83555ce00) at ../src/glx/dri2_glx.c:907
#13 0x00007f05c73cd561 in intel_query_dri2_buffers (buffer_count=0x7ffe05eaeab8, buffers=<synthetic pointer>, drawable=0x55e8354e30c0, brw=0x55e83574d350) at ../src/mesa/drivers/dri/i965/brw_context.c:1629
#14 intel_update_dri2_buffers (drawable=0x55e8354e30c0, brw=0x55e83574d350) at ../src/mesa/drivers/dri/i965/brw_context.c:1460
#15 intel_update_renderbuffers.isra.0 (drawable=0x55e8354e30c0, context=<optimized out>, context=<optimized out>) at ../src/mesa/drivers/dri/i965/brw_context.c:1516
#16 0x00007f05c6b7d666 in intel_prepare_render(brw_context*) (brw=brw@entry=0x55e83574d350) at ../src/mesa/drivers/dri/i965/brw_context.c:1535
#17 0x00007f05c6b81c50 in brw_prepare_drawing (max_index=23, min_index=0, index_bounds_valid=<optimized out>, ib=0x0, ctx=0x55e83574d350) at ../src/mesa/drivers/dri/i965/brw_draw.c:864
#18 brw_draw_prims(gl_context*, _mesa_prim const*, GLuint, _mesa_index_buffer const*, GLboolean, GLuint, GLuint, GLuint, GLuint, gl_transform_feedback_object*, unsigned int) (ctx=0x55e83574d350, prims=0x7ffe05eaec50, nr_prims=1, ib=0x0, index_bounds_valid=<optimized out>, min_index=<optimized out>, max_index=<optimized out>, num_instances=1, base_instance=0, gl_xfb_obj=0x0, stream=0) at ../src/mesa/drivers/dri/i965/brw_draw.c:1187
#19 0x00007f05c735ab84 in _mesa_draw_arrays (drawID=0, baseInstance=<optimized out>, numInstances=<optimized out>, count=<optimized out>, start=<optimized out>, mode=<optimized out>, ctx=<optimized out>) at ../src/mesa/main/draw.c:367
#20 _mesa_draw_arrays.constprop.0 (ctx=<optimized out>, mode=<optimized out>, start=<optimized out>, count=<optimized out>, numInstances=<optimized out>, baseInstance=<optimized out>, drawID=<optimized out>) at ../src/mesa/main/draw.c:348
#21 0x00007f05ef205517 in KWin::GLVertexBuffer::render(QRegion const&, unsigned int, bool) () at /usr/lib64/libkwinglutils.so.12
- OS: OpenSUSE Tumbleweed 20201211 (but since at least one week before)
- kernel: 5.9.12
- Mesa: 20.2.4
- CPU: Intel(R) Core(TM) i7-6560U (a SKL)
- GPU: Intel Corporation Iris Graphics 540