zink: zink_kopper.c:596: zink_kopper_acquire_submit: Assertion `cdt->swapchain->images[res->obj->dt_idx].acquire' failed
Running darkplaces-sdl (a Quake 1 sourceport) in benchmark mode (darkplaces-sdl -benchmarkruns 3 -benchmark demo1) under Zink hits the assertion. Running darkplaces in normal non-benchmark mode works fine tho.
While I am no expert, the assert looks suspicious to me
595 assert(res->obj->dt_idx != UINT32_MAX);
596 assert(cdt->swapchain->images[res->obj->dt_idx].acquire);
597 cdt->swapchain->images[res->obj->dt_idx].acquired = true;
598 /* this is now owned by the batch */
Perhaps it should be assert(!cdt->swapchain->images[res->obj->dt_idx].acquired) instead? I tentatively tested this change and it seems to work, but obviously my understanding of the issue is limited.
GDB backtrace:
Starting program: /home/ccr/bin/darkplaces-sdl -basedir /usr/share/games/quake/ -benchmarkruns 3 -benchmark demo1
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
Thread 1 "darkplaces-sdl" received signal SIGABRT, Aborted.
__pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
44 ./nptl/pthread_kill.c: No such file or directory.
+bt
#0 __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1 0x00007ffff7a8989f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2 0x00007ffff7a3da52 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3 0x00007ffff7a28469 in __GI_abort () at ./stdlib/abort.c:79
#4 0x00007ffff7a28395 in __assert_fail_base (fmt=0x7ffff7bb5c30 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff450a460 "cdt->swapchain->images[res->obj->dt_idx].acquire",
file=0x7ffff4509e50 "../src/gallium/drivers/zink/zink_kopper.c", line=596, function=<optimized out>) at ./assert/assert.c:92
#5 0x00007ffff7a36b02 in __GI___assert_fail (assertion=assertion@entry=0x7ffff450a460 "cdt->swapchain->images[res->obj->dt_idx].acquire", file=file@entry=0x7ffff4509e50 "../src/gallium/drivers/zink/zink_kopper.c",
line=line@entry=596, function=function@entry=0x7ffff450a910 <__PRETTY_FUNCTION__.9> "zink_kopper_acquire_submit") at ./assert/assert.c:101
#6 0x00007ffff3c7c5a7 in zink_kopper_acquire_submit (screen=screen@entry=0x555557ad49a0, res=res@entry=0x555557b0be40) at ../src/gallium/drivers/zink/zink_kopper.c:596
#7 0x00007ffff3c7c9ad in zink_kopper_present_readback (ctx=<optimized out>, res=0x555557b0be40) at ../src/gallium/drivers/zink/zink_kopper.c:816
#8 0x00007ffff3c7cb71 in zink_kopper_acquire_readback (ctx=ctx@entry=0x555557a906c0, res=res@entry=0x555557b0be40) at ../src/gallium/drivers/zink/zink_kopper.c:783
#9 0x00007ffff3c839db in zink_flush_frontbuffer (pscreen=0x555557ad49a0, pctx=0x555557dea100, pres=0x555557b0be40, level=<optimized out>, layer=<optimized out>, winsys_drawable_handle=<optimized out>, sub_box=0x0)
at ../src/gallium/drivers/zink/zink_screen.c:1475
#10 0x00007ffff366a0f2 in kopper_present_texture (sub_box=0x0, ptex=0x555557b0be40, dPriv=0x555557aa1cd0, pipe=<optimized out>) at ../src/gallium/frontends/dri/kopper.c:697
#11 kopper_copy_to_front (ptex=0x555557b0be40, dPriv=0x555557aa1cd0, pipe=<optimized out>) at ../src/gallium/frontends/dri/kopper.c:705
#12 kopperSwapBuffers (dPriv=0x555557aa1cd0) at ../src/gallium/frontends/dri/kopper.c:917
#13 0x00007ffff4dfa030 in glXSwapBuffers (dpy=0x55555775b650, drawable=23068689) at ../src/glx/glxcmds.c:857
#14 0x00007ffff7d84ee3 in X11_GL_SwapWindow (_this=<optimized out>, window=<optimized out>) at ./src/video/x11/SDL_x11opengl.c:954
#15 0x000055555559fe7f in VID_Finish () at ../../../vid_sdl.c:1693
#16 0x000055555562f300 in SCR_UpdateLoadingScreen (clear=true, startup=false) at ../../../cl_screen.c:2139
#17 0x000055555562e3a3 in SCR_UpdateLoadingScreenIfShown () at ../../../cl_screen.c:1831
#18 0x000055555562e548 in SCR_PushLoadingScreen (msg=0x5555558c1f3f "Loading precaches", len_in_parent=1) at ../../../cl_screen.c:1856
#19 0x00005555556007f5 in CL_BeginDownloads (aborteddownload=false) at ../../../cl_parse.c:1100
#20 0x000055555560235c in CL_SignonReply () at ../../../cl_parse.c:1630
#21 0x000055555560c736 in CL_ParseServerMessage () at ../../../cl_parse.c:4139
#22 0x00005555555ddfe8 in CL_ReadDemoMessage () at ../../../cl_demo.c:273
#23 0x00005555555fcf73 in CL_Frame (time=1.9097933545708656e-07) at ../../../cl_main.c:2898
#24 0x00005555556e36aa in Host_Frame (time=1.9097933545708656e-07) at ../../../host.c:647
#25 0x00005555556e3a48 in Host_Main () at ../../../host.c:736
#26 0x000055555559a1dc in main (argc=7, argv=0x7fffffffdeb8) at ../../../sys_sdl.c:222
+up
#1 0x00007ffff7a8989f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
78 in ./nptl/pthread_kill.c
+up
#2 0x00007ffff7a3da52 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
26 ../sysdeps/posix/raise.c: No such file or directory.
+up
#3 0x00007ffff7a28469 in __GI_abort () at ./stdlib/abort.c:79
79 ./stdlib/abort.c: No such file or directory.
+up
#4 0x00007ffff7a28395 in __assert_fail_base (fmt=0x7ffff7bb5c30 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff450a460 "cdt->swapchain->images[res->obj->dt_idx].acquire",
file=0x7ffff4509e50 "../src/gallium/drivers/zink/zink_kopper.c", line=596, function=<optimized out>) at ./assert/assert.c:92
92 ./assert/assert.c: No such file or directory.
+up
#5 0x00007ffff7a36b02 in __GI___assert_fail (assertion=assertion@entry=0x7ffff450a460 "cdt->swapchain->images[res->obj->dt_idx].acquire", file=file@entry=0x7ffff4509e50 "../src/gallium/drivers/zink/zink_kopper.c",
line=line@entry=596, function=function@entry=0x7ffff450a910 <__PRETTY_FUNCTION__.9> "zink_kopper_acquire_submit") at ./assert/assert.c:101
101 in ./assert/assert.c
+up
#6 0x00007ffff3c7c5a7 in zink_kopper_acquire_submit (screen=screen@entry=0x555557ad49a0, res=res@entry=0x555557b0be40) at ../src/gallium/drivers/zink/zink_kopper.c:596
596 assert(cdt->swapchain->images[res->obj->dt_idx].acquire);
+list
591 struct kopper_displaytarget *cdt = res->obj->dt;
592 assert(res->obj->dt_idx != UINT32_MAX);
593 if (cdt->swapchain->images[res->obj->dt_idx].dt_has_data)
594 return VK_NULL_HANDLE;
595 assert(res->obj->dt_idx != UINT32_MAX);
596 assert(cdt->swapchain->images[res->obj->dt_idx].acquire);
597 cdt->swapchain->images[res->obj->dt_idx].acquired = true;
598 /* this is now owned by the batch */
599 VkSemaphore acquire = cdt->swapchain->images[res->obj->dt_idx].acquire;
600 cdt->swapchain->images[res->obj->dt_idx].acquire = VK_NULL_HANDLE;
+quit
System information:
- Linux distribution: Debian GNU/Linux bookworm/sid
- System architecture: amd64 Foreign architectures: i386
- Machine: Asus H97M-PLUS, Intel(R) Core(TM) i7-4770 CPU @ 3.40GHz
- Kernel version: 5.19.4
- Chipset: Intel Corporation Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics Controller (rev 06)
- Display connector(s): HDMI (2560x1440)
- Window manager: WindowMaker 0.95.9-3
- xf86-video-intel: GIT head
- X server: Xorg 2:21.1.4-1
- Mesa: GIT head efb504e4
- libpixman: 0.40.0-1
- libdrm version: 2.4.112-3 (also tested with GIT head)
- darkplaces is latest GIT head