ThreadSanitizer: data race lib/dns/adb.c:3509:2 in dump_entry
Test system:clang:tsan
/fetchlimit
(job #2602753) failed for v9_18
.
I encountered this during an attempted clang update to version 14.0.6-++20220622053050+f28c006a5895-1~exp1~20220622173135.152
(from version 14.0.5-++20220610033153+c12386ae247c-1~exp1~20220610153237.151
that's currently in CI).
WARNING: ThreadSanitizer: data race
Read of size 4 at 0x000000000001 by thread T1 (mutexes: write M2, write M2):
#0 dump_entry lib/dns/adb.c:3509:2 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#1 print_namehook_list lib/dns/adb.c:3623:3 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#2 dump_adb lib/dns/adb.c:3448:4
#3 dns_adb_dump lib/dns/adb.c:3364:2
#4 dumpdone bin/named/server.c:11643:4 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#5 named_server_dumpdb bin/named/server.c (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#6 named_control_docommand bin/named/control.c:217:3 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#7 control_command bin/named/controlconf.c:391:17 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#8 task_run lib/isc/task.c:821:5 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#9 isc_task_run lib/isc/task.c:901:10
#10 isc__nm_async_task lib/isc/netmgr/netmgr.c:834:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#11 process_netievent lib/isc/netmgr/netmgr.c (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#12 process_queue lib/isc/netmgr/netmgr.c:998:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#13 process_all_queues lib/isc/netmgr/netmgr.c:753:25 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#14 async_cb lib/isc/netmgr/netmgr.c:782:6
#15 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#16 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Previous write of size 4 at 0x000000000001 by thread T2 (mutexes: write M3):
#0 adjustsrtt lib/dns/adb.c:4166:20 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#1 dns_adb_adjustsrtt lib/dns/adb.c:4126:2
#2 fctx_cancelquery lib/dns/resolver.c:1413:3 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#3 rctx_done lib/dns/resolver.c:9822:2 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#4 rctx_timedout lib/dns/resolver.c:8123:3 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#5 resquery_response lib/dns/resolver.c:7611:11
#6 udp_recv lib/dns/dispatch.c:593:3 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#7 isc__nm_async_readcb lib/isc/netmgr/netmgr.c:2788:2 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#8 isc__nm_readcb lib/isc/netmgr/netmgr.c:2761:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#9 isc__nmsocket_readtimeout_cb lib/isc/netmgr/netmgr.c:2064:4 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#10 uv__run_timers /usr/src/libuv-v1.44.1/src/timer.c:178:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#11 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Location is heap block of size 280 at 0x000000000024 allocated by thread T3:
#0 malloc <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 mallocx lib/isc/./jemalloc_shim.h:35:10 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 mem_get lib/isc/mem.c:344:8
#3 isc__mem_get lib/isc/mem.c:759:8
#4 new_adbentry lib/dns/adb.c:1828:6 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#5 import_rdataset lib/dns/adb.c:945:12 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#6 fetch_callback lib/dns/adb.c:3970:11 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#7 task_run lib/isc/task.c:821:5 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#8 isc_task_run lib/isc/task.c:901:10
#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:834:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#10 process_netievent lib/isc/netmgr/netmgr.c (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#11 process_queue lib/isc/netmgr/netmgr.c:998:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#12 process_all_queues lib/isc/netmgr/netmgr.c:753:25 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#13 async_cb lib/isc/netmgr/netmgr.c:782:6
#14 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#15 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Mutex M3 (0x000000000030) created at:
#0 pthread_mutex_init <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc__mutex_init lib/isc/mutex.c:52:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 dns_adb_create lib/dns/adb.c:2592:2 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#3 dns_view_createresolver lib/dns/view.c:844:11 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#4 configure_view bin/named/server.c:4773:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#5 load_configuration bin/named/server.c:9336:3 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#6 run_server bin/named/server.c:10048:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#7 task_run lib/isc/task.c:821:5 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#8 isc_task_run lib/isc/task.c:901:10
#9 isc__nm_async_task lib/isc/netmgr/netmgr.c:834:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#10 process_netievent lib/isc/netmgr/netmgr.c (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#11 process_queue lib/isc/netmgr/netmgr.c:998:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#12 process_all_queues lib/isc/netmgr/netmgr.c:753:25 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#13 async_cb lib/isc/netmgr/netmgr.c:782:6
#14 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#15 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Mutex M3 (0x000000000038) created at:
#0 pthread_mutex_init <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc__mutex_init lib/isc/mutex.c:52:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 isc_mutexblock_init lib/isc/mutexblock.c:24:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#3 dns_adb_create lib/dns/adb.c:2626:2 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#4 dns_view_createresolver lib/dns/view.c:844:11 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#5 configure_view bin/named/server.c:4773:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#6 load_configuration bin/named/server.c:9336:3 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#7 run_server bin/named/server.c:10048:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#8 task_run lib/isc/task.c:821:5 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#9 isc_task_run lib/isc/task.c:901:10
#10 isc__nm_async_task lib/isc/netmgr/netmgr.c:834:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#11 process_netievent lib/isc/netmgr/netmgr.c (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#12 process_queue lib/isc/netmgr/netmgr.c:998:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#13 process_all_queues lib/isc/netmgr/netmgr.c:753:25 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#14 async_cb lib/isc/netmgr/netmgr.c:782:6
#15 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#16 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Mutex M3 (0x000000000041) created at:
#0 pthread_mutex_init <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc__mutex_init lib/isc/mutex.c:52:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 isc_mutexblock_init lib/isc/mutexblock.c:24:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#3 dns_adb_create lib/dns/adb.c:2642:2 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#4 dns_view_createresolver lib/dns/view.c:844:11 (BuildId: eceb8edd9aed511f6e4a029347f576b4a7ccfe7b)
#5 configure_view bin/named/server.c:4773:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#6 load_configuration bin/named/server.c:9336:3 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#7 run_server bin/named/server.c:10048:2 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#8 task_run lib/isc/task.c:821:5 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#9 isc_task_run lib/isc/task.c:901:10
#10 isc__nm_async_task lib/isc/netmgr/netmgr.c:834:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#11 process_netievent lib/isc/netmgr/netmgr.c (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#12 process_queue lib/isc/netmgr/netmgr.c:998:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#13 process_all_queues lib/isc/netmgr/netmgr.c:753:25 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#14 async_cb lib/isc/netmgr/netmgr.c:782:6
#15 uv__async_io /usr/src/libuv-v1.44.1/src/unix/async.c:163:5 (BuildId: 120c450d14885aa5308bc95c4ea77de2c2b1cc36)
#16 isc__trampoline_run lib/isc/trampoline.c:189:11 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
Thread T1 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc_thread_create lib/isc/thread.c:81:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 isc__netmgr_create lib/isc/netmgr/netmgr.c:311:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#3 isc_managers_create lib/isc/managers.c:31:2 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#4 create_managers bin/named/main.c:925:11 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#5 setup bin/named/main.c:1189:11
#6 main bin/named/main.c:1457:2
Thread T2 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc_thread_create lib/isc/thread.c:81:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 isc__netmgr_create lib/isc/netmgr/netmgr.c:311:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#3 isc_managers_create lib/isc/managers.c:31:2 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#4 create_managers bin/named/main.c:925:11 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#5 setup bin/named/main.c:1189:11
#6 main bin/named/main.c:1457:2
Thread T3 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#1 isc_thread_create lib/isc/thread.c:81:8 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#2 isc__netmgr_create lib/isc/netmgr/netmgr.c:311:3 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#3 isc_managers_create lib/isc/managers.c:31:2 (BuildId: 2cc4193627d6055c0448e9780e5aeffcf21be151)
#4 create_managers bin/named/main.c:925:11 (BuildId: 9a5d6ed49c2850712bc2b880dbcd672b96adabdf)
#5 setup bin/named/main.c:1189:11
#6 main bin/named/main.c:1457:2
SUMMARY: ThreadSanitizer: data race lib/dns/adb.c:3509:2 in dump_entry