khr_debug-push-pop-group_gl: ../src/util/simple_mtx.h:86: simple_mtx_lock: Assertion `c != _SIMPLE_MTX_INVALID_VALUE' failed.
The khr_debug-push-pop-group_gl
piglit test on radeonsi ends up attempting to lock an already destroyed mutex on a shader compile thread:
Thread 1 (Thread 0x7f2765ff3700 (LWP 2522)):
#0 __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1 0x00007f27792ca535 in __GI_abort () at abort.c:79
#2 0x00007f27792ca40f in __assert_fail_base (fmt=0x7f277942c710 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7f27770d52b0 "c != _SIMPLE_MTX_INVALID_VALUE", file=0x7f27770d5355 "../src/util/simple_mtx.h", line=86, function=<optimized out>) at assert.c:92
#3 0x00007f27792d7b92 in __GI___assert_fail (assertion=assertion@entry=0x7f27770d52b0 "c != _SIMPLE_MTX_INVALID_VALUE", file=file@entry=0x7f27770d5355 "../src/util/simple_mtx.h", line=line@entry=86, function=function@entry=0x7f27772cbda0 <__PRETTY_FUNCTION__.31161> "simple_mtx_lock") at assert.c:101
#4 0x00007f2776a79203 in simple_mtx_lock (mtx=0x55fd015f4594) at ../src/util/simple_mtx.h:80
#5 0x00007f2776a79397 in simple_mtx_lock (mtx=0x55fd015f4594) at ../src/util/simple_mtx.h:91
#6 _mesa_lock_debug_state (ctx=ctx@entry=0x55fd015e26b0) at ../src/mesa/main/debug_output.c:692
#7 0x00007f2776a79dfe in _mesa_log_msg (ctx=0x55fd015e26b0, source=MESA_DEBUG_SOURCE_SHADER_COMPILER, type=MESA_DEBUG_TYPE_OTHER, id=2, severity=MESA_DEBUG_SEVERITY_NOTIFICATION, len=129, buf=0x7f2765ff1b20 "Shader Stats: SGPRS: 96 VGPRS: 32 Code Size: 16 LDS: 0 Scratch: 0 Max Waves: 8 Spilled SGPRs: 0 Spilled VGPRs: 0 PrivMem VGPRs: 0") at ../src/mesa/main/debug_output.c:870
#8 0x00007f2776aa8213 in _mesa_gl_vdebugf (ctx=0x55fd015e26b0, id=0x7f27775ea48c <id>, source=MESA_DEBUG_SOURCE_SHADER_COMPILER, type=MESA_DEBUG_TYPE_OTHER, severity=MESA_DEBUG_SEVERITY_NOTIFICATION, fmtString=<optimized out>, args=0x7f2765ff2b88) at ../src/mesa/main/errors.c:238
#9 0x00007f27769ba8c0 in st_debug_message (data=<optimized out>, id=<optimized out>, ptype=<optimized out>, fmt=<optimized out>, args=<optimized out>) at ../src/mesa/state_tracker/st_debug.c:129
#10 0x00007f277670371d in _pipe_debug_message (cb=cb@entry=0x55fd0162bdd0, id=id@entry=0x7f27775ea48c <id>, type=type@entry=PIPE_DEBUG_TYPE_SHADER_INFO, fmt=fmt@entry=0x7f277713e3c0 "Shader Stats: SGPRS: %d VGPRS: %d Code Size: %d LDS: %d Scratch: %d Max Waves: %d Spilled SGPRs: %d Spilled VGPRs: %d PrivMem VGPRs: %d") at ../src/util/u_debug.c:77
#11 0x00007f27769259d9 in si_shader_dump_stats_for_shader_db (debug=0x55fd0162bdd0, shader=0x7f271005aa60, screen=0x55fd014c21e0) at ../src/gallium/drivers/radeonsi/si_shader.c:5215
#12 si_shader_dump_stats_for_shader_db (screen=screen@entry=0x55fd014c21e0, shader=shader@entry=0x7f271005aa60, debug=debug@entry=0x55fd0162bdd0) at ../src/gallium/drivers/radeonsi/si_shader.c:5404
#13 0x00007f27768d553d in si_init_shader_selector_async (job=job@entry=0x55fd0162bdb0, thread_index=thread_index@entry=8) at ../src/gallium/drivers/radeonsi/si_state_shaders.c:2528
#14 0x00007f2776d91107 in util_queue_thread_func (input=input@entry=0x55fd014c1ca0) at ../src/util/u_queue.c:292
#15 0x00007f2776d90b78 in impl_thrd_routine (p=<optimized out>) at ../include/c11/threads_posix.h:87
#16 0x00007f277879afb7 in start_thread (arg=<optimized out>) at pthread_create.c:486
#17 0x00007f277939f2df in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
The mutex was destroyed on the main thread:
Thread 1 "khr_debug-push-" hit Breakpoint 1, simple_mtx_destroy (mtx=0x55555570e464) at ../src/util/simple_mtx.h:76
76 mtx->val = _SIMPLE_MTX_INVALID_VALUE;
#0 simple_mtx_destroy (mtx=0x55555570e464) at ../src/util/simple_mtx.h:76
#1 _mesa_free_errors_data (ctx=ctx@entry=0x5555556fc580) at ../src/mesa/main/debug_output.c:1291
#2 0x00007ffff53a146a in _mesa_free_context_data (ctx=ctx@entry=0x5555556fc580) at ../src/mesa/main/context.c:1390
#3 0x00007ffff52e47b4 in st_destroy_context (st=0x5555557269d0) at ../src/mesa/state_tracker/st_context.c:1086
#4 0x00007ffff50343cc in dri_destroy_context (cPriv=<optimized out>) at ../src/gallium/state_trackers/dri/dri_context.c:245
#5 0x00007ffff502e03c in driDestroyContext (pcp=0x555555597bb0) at ../src/mesa/drivers/dri/common/dri_util.c:528
#6 0x00007ffff7a2cf32 in dri3_destroy_context (context=0x555555597a20) at ../src/glx/dri3_glx.c:181
#7 0x00007ffff7a1685a in glXDestroyContext (ctx=0x555555597a20, dpy=0x55555556b5d0) at ../src/glx/glxcmds.c:511
#8 glXDestroyContext (dpy=0x55555556b5d0, ctx=0x555555597a20) at ../src/glx/glxcmds.c:492
#9 0x00007ffff7a60646 in wrapped_glXDestroyContext () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#10 0x00007ffff7a606dd in glx_context_destroy () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#11 0x00007ffff7a59b92 in waffle_context_destroy () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#12 0x00007ffff7f0eea0 in piglit_wfl_framework_teardown (wfl_fw=0x55555556ae70) at tests/util/piglit-framework-gl/piglit_wfl_framework.c:638
#13 0x00007ffff7f0d502 in destroy (gl_fw=0x55555556ae70) at tests/util/piglit-framework-gl/piglit_fbo_framework.c:39
#14 0x00007ffff7efdf84 in destroy () at tests/util/piglit-framework-gl.c:210
#15 0x00007ffff7c0b720 in __run_exit_handlers (status=0, listp=0x7ffff7d88718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#16 0x00007ffff7c0b85a in __GI_exit (status=<optimized out>) at exit.c:139
#17 0x00007ffff7dc7d23 in piglit_report_result (result=PIGLIT_PASS) at tests/util/piglit-util.c:241
#18 0x0000555555555d1d in piglit_init (argc=1, argv=0x7fffffffe648) at tests/spec/khr_debug/debug-push-pop-group.c:338
#19 0x00007ffff7f0d556 in run_test (gl_fw=0x55555556ae70, argc=1, argv=0x7fffffffe648) at tests/util/piglit-framework-gl/piglit_fbo_framework.c:50
#20 0x00007ffff7efe038 in piglit_gl_test_run (argc=1, argv=0x7fffffffe648, config=0x7fffffffe500) at tests/util/piglit-framework-gl.c:229
#21 0x0000555555555280 in main (argc=1, argv=0x7fffffffe648) at tests/spec/khr_debug/debug-push-pop-group.c:49
#1 _mesa_free_errors_data (ctx=ctx@entry=0x5555556fc580) at ../src/mesa/main/debug_output.c:1291
1291 simple_mtx_destroy(&ctx->DebugMutex);
This is where the main thread waits for the shader compile thread to terminate:
#0 syscall () at ../sysdeps/unix/sysv/linux/x86_64/syscall.S:38
#1 0x00007f2776d90b2b in sys_futex (val3=-1, addr2=0x0, timeout=0x0, val1=2, op=9, addr1=0x55fd0162cc30) at ../src/util/futex.h:50
#2 futex_wait (timeout=0x0, value=2, addr=0x55fd0162cc30) at ../src/util/futex.h:50
#3 do_futex_fence_wait (fence=fence@entry=0x55fd0162cc30, timeout=timeout@entry=false, abs_timeout=abs_timeout@entry=0) at ../src/util/u_queue.c:120
#4 0x00007f2776d91b78 in _util_queue_fence_wait (fence=0x55fd0162cc30) at ../src/util/u_queue.c:135
#5 util_queue_fence_wait (fence=0x55fd0162cc30) at ../src/util/u_queue.h:161
#6 util_queue_fence_wait (fence=0x55fd0162cc30) at ../src/util/u_queue.h:158
#7 util_queue_drop_job (queue=<optimized out>, fence=fence@entry=0x55fd0162cc30) at ../src/util/u_queue.c:626
#8 0x00007f27768d734d in si_destroy_shader_selector (sctx=0x55fd0147ff40, sel=0x55fd0162cc20) at ../src/gallium/drivers/radeonsi/si_state_shaders.c:3280
#9 0x00007f27770586ef in tc_batch_execute (job=0x55fd015c41c0, thread_index=<optimized out>) at ../src/gallium/auxiliary/util/u_threaded_context.c:96
#10 0x00007f2777059906 in _tc_sync (tc=tc@entry=0x55fd015c3c40, func=<optimized out>, info=<optimized out>) at ../src/gallium/auxiliary/util/u_threaded_context.c:207
#11 0x00007f277705a2b2 in tc_destroy (_pipe=0x55fd015c3c40) at ../src/gallium/auxiliary/util/u_threaded_context.c:2526
#12 0x00007f27769b9318 in st_destroy_context_priv (st=st@entry=0x55fd0160cb00, destroy_pipe=destroy_pipe@entry=true) at ../src/mesa/state_tracker/st_context.c:468
#13 0x00007f27769ba7c1 in st_destroy_context (st=0x55fd0160cb00) at ../src/mesa/state_tracker/st_context.c:1090
#14 0x00007f277670a3cc in dri_destroy_context (cPriv=<optimized out>) at ../src/gallium/state_trackers/dri/dri_context.c:245
#15 0x00007f277670403c in driDestroyContext (pcp=0x55fd0147dbb0) at ../src/mesa/drivers/dri/common/dri_util.c:528
#16 0x00007f2779102f32 in dri3_destroy_context (context=0x55fd0147da20) at ../src/glx/dri3_glx.c:181
#17 0x00007f27790ec85a in glXDestroyContext (ctx=0x55fd0147da20, dpy=0x55fd014515d0) at ../src/glx/glxcmds.c:511
#18 glXDestroyContext (dpy=0x55fd014515d0, ctx=0x55fd0147da20) at ../src/glx/glxcmds.c:492
#19 0x00007f2779136646 in wrapped_glXDestroyContext () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#20 0x00007f27791366dd in glx_context_destroy () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#21 0x00007f277912fb92 in waffle_context_destroy () from /usr/local/lib/x86_64-linux-gnu/libwaffle-1.so.0
#22 0x00007f27795e4ea0 in piglit_wfl_framework_teardown (wfl_fw=0x55fd01450e70) at tests/util/piglit-framework-gl/piglit_wfl_framework.c:638
#23 0x00007f27795e3502 in destroy (gl_fw=0x55fd01450e70) at tests/util/piglit-framework-gl/piglit_fbo_framework.c:39
#24 0x00007f27795d3f84 in destroy () at tests/util/piglit-framework-gl.c:210
#25 0x00007f27792e1720 in __run_exit_handlers (status=0, listp=0x7f277945e718 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true, run_dtors=run_dtors@entry=true) at exit.c:108
#26 0x00007f27792e185a in __GI_exit (status=<optimized out>) at exit.c:139
#27 0x00007f277949dd23 in piglit_report_result (result=PIGLIT_PASS) at tests/util/piglit-util.c:241
#28 0x000055fd00d40d1d in piglit_init (argc=1, argv=0x7ffcb339af18) at tests/spec/khr_debug/debug-push-pop-group.c:338
#29 0x00007f27795e3556 in run_test (gl_fw=0x55fd01450e70, argc=1, argv=0x7ffcb339af18) at tests/util/piglit-framework-gl/piglit_fbo_framework.c:50
#30 0x00007f27795d4038 in piglit_gl_test_run (argc=1, argv=0x7ffcb339af18, config=0x7ffcb339add0) at tests/util/piglit-framework-gl.c:229
#31 0x000055fd00d40280 in main (argc=1, argv=0x7ffcb339af18) at tests/spec/khr_debug/debug-push-pop-group.c:49
Edited by Michel Dänzer