Data race in free
From the doth
system test on gcc:tsan
on v9.18.
WARNING: ThreadSanitizer: data race
Write of size 8 at 0x000000000001 by thread T0001:
#0 free <null> (BuildId: 4037c6a3ca411fc7713f28ef5e1cb780845c5d8e)
#1 CRYPTO_free crypto/mem.c:282 (BuildId: afed677f65051b05f25c31a8caf0bd643e406fef)
#2 X509_STORE_free crypto/x509/x509_lu.c:253 (BuildId: afed677f65051b05f25c31a8caf0bd643e406fef)
#3 SSL_CTX_free ssl/ssl_lib.c:4150 (BuildId: f4ad27c0407b8ebb3772262ddd0054a4cd37c886)
#4 SSL_CTX_free ssl/ssl_lib.c:4119
#5 isc_tlsctx_free lib/isc/tls.c:186 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#6 isc_tlsctx_client_session_cache_detach lib/isc/tls.c:1493 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#7 isc__nm_tlsdns_cleanup_data netmgr/tlsdns.c:2409 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#8 nmsocket_cleanup netmgr/netmgr.c:1329 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#9 nmsocket_maybe_destroy netmgr/netmgr.c:1405 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#10 isc___nmsocket_prep_destroy netmgr/netmgr.c:1469 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#11 tlsdns_close_sock netmgr/tlsdns.c:2088 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#12 tlsdns_close_cb netmgr/tlsdns.c:2096 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#13 uv__finish_close src/unix/core.c:351 (BuildId: 14a6f2780ed7d1a14ef3e9047a5f805571e2a626)
#14 uv__run_closing_handles src/unix/core.c:365
#15 uv_run src/unix/core.c:463
#16 nm_thread netmgr/netmgr.c:711 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#17 isc__trampoline_run lib/isc/trampoline.c:190 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
Previous atomic write of size 4 at 0x000000000001 by main thread:
#0 CRYPTO_DOWN_REF include/internal/refcount.h:51 (BuildId: afed677f65051b05f25c31a8caf0bd643e406fef)
#1 X509_STORE_free crypto/x509/x509_lu.c:234
#2 isc_tls_cert_store_free lib/isc/tls.c:1072 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#3 tlsctx_cache_entry_destroy lib/isc/tls.c:1154 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#4 tlsctx_cache_destroy lib/isc/tls.c:1174
#5 isc_tlsctx_cache_detach lib/isc/tls.c:1195
#6 _destroy_lookup bin/dig/dighost.c:1643 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
#7 destroy_lookup bin/dig/dighost.c:1705 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
#8 dig_shutdown bin/dig/dig.c:3080 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
#9 main bin/dig/dig.c:3098 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
Thread T0001 (running) created by main thread at:
#0 pthread_create <null> (BuildId: 4037c6a3ca411fc7713f28ef5e1cb780845c5d8e)
#1 isc_thread_create lib/isc/thread.c:73 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#2 isc__netmgr_create netmgr/netmgr.c:324 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#3 isc_managers_create lib/isc/managers.c:31 (BuildId: 9e62e4e671ca2e6386442bba556e9e6c3b3fce0b)
#4 setup_libs bin/dig/dighost.c:1400 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
#5 dig_setup bin/dig/dig.c:3042 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
#6 main bin/dig/dig.c:3095 (BuildId: a302939e9b2600e726c9a5235b769f01f574ade5)
SUMMARY: ThreadSanitizer: data race (BuildId: 4037c6a3ca411fc7713f28ef5e1cb780845c5d8e) in free
From the doth
system test on clang:tsan
on v9.18:
WARNING: ThreadSanitizer: data race
Write of size 8 at 0x000000000001 by thread T0001:
#0 free <null> (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#1 CRYPTO_free /usr/src/openssl-3.3.1/crypto/mem.c:282:5 (BuildId: fdbe864abdc6d4754d0acd26aa6be734a0ba5805)
#2 X509_STORE_free /usr/src/openssl-3.3.1/crypto/x509/x509_lu.c:253:5 (BuildId: fdbe864abdc6d4754d0acd26aa6be734a0ba5805)
#3 SSL_CTX_free /usr/src/openssl-3.3.1/ssl/ssl_lib.c:4150:5 (BuildId: c2cd17c16f159ec83aa984d63662def01a894f15)
#4 SSL_CTX_free /usr/src/openssl-3.3.1/ssl/ssl_lib.c:4119:6
#5 isc_tlsctx_free lib/isc/tls.c:186:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#6 isc_tlsctx_client_session_cache_detach lib/isc/tls.c:1493:2
#7 isc__nm_tlsdns_cleanup_data lib/isc/netmgr/tlsdns.c:2409:4 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#8 nmsocket_cleanup lib/isc/netmgr/netmgr.c:1329:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#9 nmsocket_maybe_destroy lib/isc/netmgr/netmgr.c:1405:3 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#10 isc___nmsocket_prep_destroy lib/isc/netmgr/netmgr.c:1469:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#11 tlsdns_close_sock lib/isc/netmgr/tlsdns.c:2088:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#12 tlsdns_close_cb lib/isc/netmgr/tlsdns.c:2096:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#13 uv__finish_close /usr/src/libuv-v1.48.0/src/unix/core.c:351:5 (BuildId: 49267e58904a72ff4c1a28aee97ff70106a49b8f)
#14 uv__run_closing_handles /usr/src/libuv-v1.48.0/src/unix/core.c:365:5
#15 uv_run /usr/src/libuv-v1.48.0/src/unix/core.c:463:5
#16 nm_thread lib/isc/netmgr/netmgr.c:711:11 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#17 isc__trampoline_run lib/isc/trampoline.c:190:11 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
Previous atomic write of size 4 at 0x000000000001 by main thread:
#0 CRYPTO_DOWN_REF /usr/src/openssl-3.3.1/include/internal/refcount.h:51:12 (BuildId: fdbe864abdc6d4754d0acd26aa6be734a0ba5805)
#1 X509_STORE_free /usr/src/openssl-3.3.1/crypto/x509/x509_lu.c:234:5
#2 isc_tls_cert_store_free lib/isc/tls.c:1072:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#3 tlsctx_cache_entry_destroy lib/isc/tls.c:1154:3
#4 tlsctx_cache_destroy lib/isc/tls.c:1174:3
#5 isc_tlsctx_cache_detach lib/isc/tls.c:1195:3
#6 _destroy_lookup bin/dig/dighost.c:1643:3 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#7 destroy_lookup bin/dig/dighost.c:1705:2 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#8 dig_shutdown bin/dig/dig.c:3080:2 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#9 main bin/dig/dig.c:3098:2
Thread T0001 (running) created by main thread at:
#0 pthread_create <null> (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#1 isc_thread_create lib/isc/thread.c:73:8 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#2 isc__netmgr_create lib/isc/netmgr/netmgr.c:324:3 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#3 isc_managers_create lib/isc/managers.c:31:2 (BuildId: b034506298ddf977927f2a0789f88a4696f09975)
#4 setup_libs bin/dig/dighost.c:1400:2 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#5 dig_setup bin/dig/dig.c:3042:2 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
#6 main bin/dig/dig.c:3095:2 (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0)
SUMMARY: ThreadSanitizer: data race (BuildId: b41117d83d2fda3dc25188bdfc98153c148146b0) in free