ThreadSanitizer: data race astack.c:64 in isc_astack_pop
Binary: named
Commit: eba576dd
Tests: dnssec
WARNING: ThreadSanitizer: data race (pid=64356)
Read of size 8 at 0x7b54000205a0 by thread T5 (mutexes: write M68216):
#0 isc_astack_pop astack.c:64 (libisc.1503.dylib:x86_64+0x5e31)
#1 nmsocket_cleanup netmgr.c:527 (libisc.1503.dylib:x86_64+0x2750f)
#2 nmsocket_maybe_destroy netmgr.c:601 (libisc.1503.dylib:x86_64+0x25964)
#3 isc_nmhandle_unref netmgr.c:903 (libisc.1503.dylib:x86_64+0x26a93)
#4 fetch_callback query.c:5680 (libns.1501.dylib:x86_64+0x1619c)
#5 run task.c:1134 (libisc.1503.dylib:x86_64+0x3b141)
Previous write of size 8 at 0x7b54000205a0 by thread T2 (mutexes: write M361549470804084136):
#0 isc_astack_pop astack.c:67 (libisc.1503.dylib:x86_64+0x5e47)
#1 nmsocket_cleanup netmgr.c:527 (libisc.1503.dylib:x86_64+0x2750f)
#2 nmsocket_maybe_destroy netmgr.c:601 (libisc.1503.dylib:x86_64+0x25964)
#3 isc__nmsocket_prep_destroy netmgr.c:645 (libisc.1503.dylib:x86_64+0x25721)
#4 isc_nmsocket_detach netmgr.c:671 (libisc.1503.dylib:x86_64+0x25aaf)
#5 dnslisten_readcb tcpdns.c:109 (libisc.1503.dylib:x86_64+0x2b926)
#6 read_cb tcp.c:355 (libisc.1503.dylib:x86_64+0x2851d)
#7 uv__stream_io <null>:5822832 (libuv.1.dylib:x86_64+0xf05c)
Mutex M68216 (0x7b54000205a8) created at:
#0 pthread_mutex_lock <null>:5822720 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x39f8e)
#1 isc_astack_pop astack.c:62 (libisc.1503.dylib:x86_64+0x5e25)
#2 nmsocket_cleanup netmgr.c:527 (libisc.1503.dylib:x86_64+0x2750f)
#3 nmsocket_maybe_destroy netmgr.c:601 (libisc.1503.dylib:x86_64+0x25964)
#4 isc_nmhandle_unref netmgr.c:903 (libisc.1503.dylib:x86_64+0x26a93)
#5 fetch_callback query.c:5680 (libns.1501.dylib:x86_64+0x1619c)
#6 run task.c:1134 (libisc.1503.dylib:x86_64+0x3b141)
Mutex M361549470804084136 is already destroyed.
Thread T5 (tid=7195628, running) created by main thread at:
#0 pthread_create <null>:5822912 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x580a1)
#2 isc_taskmgr_create task.c:1410 (libisc.1503.dylib:x86_64+0x3a630)
#3 main main.c:902 (named:x86_64+0x10000df36)
Thread T2 (tid=7195593, running) created by main thread at:
#0 pthread_create <null>:5822912 (libclang_rt.tsan_osx_dynamic.dylib:x86_64h+0x2a9cd)
#1 isc_thread_create thread.c:75 (libisc.1503.dylib:x86_64+0x580a1)
#2 isc_nm_start netmgr.c:127 (libisc.1503.dylib:x86_64+0x23e37)
#3 main main.c:895 (named:x86_64+0x10000dede)
SUMMARY: ThreadSanitizer: data race astack.c:64 in isc_astack_pop
The warning seems weird on the code inspection, but I found an error in the other part of the code.