Data race in pthread_mutex_destroy (xferquota)
Job #3387972 failed for 15eaf9d3.
The xferquota
system test produces TSAN error in system:clang:tsan
CI job.
WARNING: ThreadSanitizer: data race
Write of size 1 at 0x000000000001 by thread T1:
#0 pthread_mutex_destroy <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 qpmulti_destroy_cb lib/dns/qp.c:1442:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#2 <null> <null> (BuildId: 317457052cc2fe394e6cea9241fff1d4303f7d0a)
Previous atomic read of size 1 at 0x000000000001 by thread T2 (mutexes: write M1):
#0 pthread_mutex_unlock <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 reclaim_chunks_cb lib/dns/qp.c:668:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#2 <null> <null> (BuildId: 317457052cc2fe394e6cea9241fff1d4303f7d0a)
Location is heap block of size 168 at 0x000000000007 allocated by main thread:
#0 malloc <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 mallocx lib/isc/./jemalloc_shim.h:65:14 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#2 mem_get lib/isc/mem.c:305:8
#3 isc__mem_get lib/isc/mem.c:674:8 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#4 dns_qpmulti_create lib/dns/qp.c:1375:25 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#5 dns_zt_create lib/dns/zt.c:104:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#6 dns_view_create lib/dns/view.c:137:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#7 create_view bin/named/server.c:6440:11 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#8 load_configuration bin/named/server.c:9140:12 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#9 run_server bin/named/server.c:9982:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#10 isc__async_cb lib/isc/async.c:112:3 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#11 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#12 thread_body lib/isc/thread.c:87:8 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#13 isc_thread_main lib/isc/thread.c:118:2
#14 isc_loopmgr_run lib/isc/loop.c:452:2 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#15 main bin/named/main.c:1532:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
Mutex M1 (0x000000000001) created at:
#0 pthread_mutex_init <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 dns_qpmulti_create lib/dns/qp.c:1380:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#2 dns_zt_create lib/dns/zt.c:104:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#3 dns_view_create lib/dns/view.c:137:2 (BuildId: a40b420aa20f73afe0e46a58e58153e948670aef)
#4 create_view bin/named/server.c:6440:11 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#5 load_configuration bin/named/server.c:9140:12 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#6 run_server bin/named/server.c:9982:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#7 isc__async_cb lib/isc/async.c:112:3 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#8 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#9 thread_body lib/isc/thread.c:87:8 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#10 isc_thread_main lib/isc/thread.c:118:2
#11 isc_loopmgr_run lib/isc/loop.c:452:2 (BuildId: 177803d1e9f1786301abb0f570f88676ff9a5f04)
#12 main bin/named/main.c:1532:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
Thread T1 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 <null> <null> (BuildId: 317457052cc2fe394e6cea9241fff1d4303f7d0a)
#2 main bin/named/main.c:1532:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
Thread T2 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
#1 <null> <null> (BuildId: 317457052cc2fe394e6cea9241fff1d4303f7d0a)
#2 main bin/named/main.c:1532:2 (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098)
SUMMARY: ThreadSanitizer: data race (BuildId: 7e82076ead252161dd1e856775766c8d7ccea098) in pthread_mutex_destroy
In daily CI pipelines, it started on Saturday when the fanf-urcu-qp
branch was merged, and happens with 75 % reliability since.