TSAN error in dispatch.c accessing disp->portentry
Job #1237048 failed for 33ea90f7:
WARNING: ThreadSanitizer: data race
Write of size 8 at 0x000000000001 by thread T1 (mutexes: write M1):
#0 deref_portentry lib/dns/dispatch.c:630
#1 deactivate_dispsocket lib/dns/dispatch.c:861
#2 udp_recv lib/dns/dispatch.c:1105
#3 udp_exrecv lib/dns/dispatch.c:1028
#4 dispatch lib/isc/task.c:1152
#5 run lib/isc/task.c:1344
#6 <null> <null>
Previous read of size 8 at 0x000000000001 by thread T2 (mutexes: write M1, write M2):
#0 socket_search lib/dns/dispatch.c:661
#1 get_dispsocket lib/dns/dispatch.c:744
#2 dns_dispatch_addresponse lib/dns/dispatch.c:3120
#3 resquery_send lib/dns/resolver.c:2467
#4 fctx_query lib/dns/resolver.c:2217
#5 fctx_try lib/dns/resolver.c:4245
#6 fctx_timeout lib/dns/resolver.c:4570
#7 dispatch lib/isc/task.c:1152
#8 run lib/isc/task.c:1344
#9 <null> <null>
Location is heap block of size 249 at 0x000000000013 allocated by thread T2:
#0 malloc <null>
#1 default_memalloc lib/isc/mem.c:713
#2 mem_get lib/isc/mem.c:622
#3 isc__mempool_get lib/isc/mem.c:1775
#4 get_dispsocket lib/dns/dispatch.c:712
#5 dns_dispatch_addresponse lib/dns/dispatch.c:3120
#6 resquery_send lib/dns/resolver.c:2467
#7 fctx_query lib/dns/resolver.c:2217
#8 fctx_try lib/dns/resolver.c:4245
#9 fctx_start lib/dns/resolver.c:4761
#10 dispatch lib/isc/task.c:1152
#11 run lib/isc/task.c:1344
#12 <null> <null>
Mutex M1 (0x000000000019) created at:
#0 pthread_mutex_init <null>
#1 isc__mutex_init pthreads/mutex.c:288
#2 dispatch_allocate lib/dns/dispatch.c:2358
#3 dispatch_createudp lib/dns/dispatch.c:2855
#4 dns_dispatchset_create lib/dns/dispatch.c:3666
#5 dns_resolver_create lib/dns/resolver.c:10190
#6 dns_view_createresolver lib/dns/view.c:811
#7 configure_view bin/named/server.c:4571
#8 load_configuration bin/named/server.c:9110
#9 loadconfig bin/named/server.c:10310
#10 named_server_reconfigcommand bin/named/server.c:10693
#11 named_control_docommand bin/named/control.c:250
#12 control_command bin/named/controlconf.c:392
#13 dispatch lib/isc/task.c:1152
#14 run lib/isc/task.c:1344
#15 <null> <null>
Mutex M2 is already destroyed.
Thread T1 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create pthreads/thread.c:73
#2 isc_taskmgr_create lib/isc/task.c:1434
#3 create_managers bin/named/main.c:915
#4 setup bin/named/main.c:1223
#5 main bin/named/main.c:1523
Thread T2 (running) created by main thread at:
#0 pthread_create <null>
#1 isc_thread_create pthreads/thread.c:73
#2 isc_taskmgr_create lib/isc/task.c:1434
#3 create_managers bin/named/main.c:915
#4 setup bin/named/main.c:1223
#5 main bin/named/main.c:1523
SUMMARY: ThreadSanitizer: data race lib/dns/dispatch.c:630 in deref_portentry
Edited by Mark Andrews