A crash in radeonsi driver
38:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] [1002:15dd] (rev c6) kernel 5.15.16 Mesa 21.3.4 xserver 21.1.3
In a Unity game run through wine (yes, quite a few levels of indirection right here), I'm getting a repeatable crash with following backtrace:
#0 si_update_fb_dirtiness_after_rendering (sctx=sctx@entry=0xdaf822e0) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_state.c:2693
#1 0xf6618922 in si_update_fb_dirtiness_after_rendering (sctx=0xdaf822e0) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_state.c:2676
#2 0xf664e6cd in si_launch_grid (ctx=0xdaf822e0, info=0xe52fef08) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_compute.c:913
#3 0xf664f972 in si_launch_grid_internal (sctx=0xdaf822e0, info=0xe52fef08, shader=0xdab00020, flags=47) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_compute_blit.c:94
#4 0xf6650c2d in si_compute_copy_image (sctx=0xdaf822e0, dst=0xdabd2880, dst_level=0, src=0xdabd2880, src_level=0, dstx=0, dsty=0, dstz=0, src_box=0xe52fefbc, is_dcc_decompress=true, flags=15) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_compute_blit.c:560
#5 0xf6647d07 in si_decompress_dcc (sctx=0xdaf822e0, tex=0xdabd2880) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_blit.c:1382
--Type <RET> for more, q to quit, c to continue without paging--
#6 0xf662df70 in si_texture_disable_dcc (sctx=<optimized out>, tex=<optimized out>) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_texture.c:406
#7 0xf6616d91 in si_set_framebuffer_state (ctx=0xdaf822e0, state=0xdafd58a8) at ../mesa-21.3.4/src/gallium/drivers/radeonsi/si_state.c:2792
#8 0xf6355ed5 in tc_call_set_framebuffer_state (pipe=0xdaf822e0, call=0xdafd58a4, last=0xdafd5a34) at ../mesa-21.3.4/src/gallium/auxiliary/util/u_threaded_context.c:1049
#9 0xf63551ce in tc_batch_execute (job=0xdafd585c, gdata=0x0, thread_index=0) at ../mesa-21.3.4/src/gallium/auxiliary/util/u_threaded_context.c:213
#10 0xf5dc9b7b in util_queue_thread_func (input=<optimized out>) at ../mesa-21.3.4/src/util/u_queue.c:313
#11 0xf7f81f1f in start_thread (arg=<optimized out>) at pthread_create.c:481
#12 0xf7e83866 in clone () at ../sysdeps/unix/sysv/linux/i386/clone.S:108
Looking at the code, this would suggest u_bit_scan is returning a value that in sctx->framebuffer.state.cbufs array is NULL, but that tells nothing about why it does that. Adding a NULL check would likely prevent the crash, but would also just hide the reason for it.
Edited by Marcin Ślusarz