ThreadSanitizer: data race lib/dns/message.c
Multiple issues found (all in rpz test):
WARNING: ThreadSanitizer: data race (pid=15310)
Write of size 4 at 0x7b50000c0008 by thread T1:
#0 msginitheader /home/ondrej/Projects/bind9/lib/dns/message.c:362 (libdns.so.1505+0xc2cdd)
#1 msginit /home/ondrej/Projects/bind9/lib/dns/message.c:408 (libdns.so.1505+0xc2cdd)
#2 msgreset /home/ondrej/Projects/bind9/lib/dns/message.c:656 (libdns.so.1505+0xc2cdd)
#3 dns_message_reset /home/ondrej/Projects/bind9/lib/dns/message.c:797 (libdns.so.1505+0xc325e)
#4 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:215 (libns.so.1502+0x122fa)
#5 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1528 (libns.so.1502+0x122fa)
#6 isc_nmhandle_unref /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1083 (libisc.so.1504+0x409eb)
#7 isc__nm_uvreq_put /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1218 (libisc.so.1504+0x41c3f)
#8 udp_send_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:439 (libisc.so.1504+0x46c8d)
#9 <null> <null> (libuv.so.1+0x1d283)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Previous read of size 4 at 0x7b50000c0008 by thread T12:
#0 ns_client_send /home/ondrej/Projects/bind9/lib/ns/client.c:665 (libns.so.1502+0x110db)
#1 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1559 (libns.so.1502+0x4ecb6)
#2 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1551 (libns.so.1502+0x4ecb6)
#3 updatedone_action /home/ondrej/Projects/bind9/lib/ns/update.c:3391 (libns.so.1502+0x4f598)
#4 dispatch /home/ondrej/Projects/bind9/lib/isc/task.c:1134 (libisc.so.1504+0x56fa6)
#5 run /home/ondrej/Projects/bind9/lib/isc/task.c:1319 (libisc.so.1504+0x56fa6)
#6 <null> <null> (libtsan.so.0+0x29b3d)
Location is heap block of size 497 at 0x7b50000c0000 allocated by thread T4:
#0 malloc <null> (libtsan.so.0+0x2b1a3)
#1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:685 (libisc.so.1504+0x33fee)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:598 (libisc.so.1504+0x3c001)
#3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1013 (libisc.so.1504+0x3c001)
#4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2365 (libisc.so.1504+0x3aef1)
#5 dns_message_create /home/ondrej/Projects/bind9/lib/dns/message.c:715 (libdns.so.1505+0xbcc0e)
#6 ns__client_setup /home/ondrej/Projects/bind9/lib/ns/client.c:2250 (libns.so.1502+0x132d3)
#7 ns__client_request /home/ondrej/Projects/bind9/lib/ns/client.c:1634 (libns.so.1502+0x13d2a)
#8 udp_recv_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:317 (libisc.so.1504+0x46926)
#9 <null> <null> (libuv.so.1+0x1d6d4)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Thread T1 'isc-net-0000' (tid=15325, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
Thread T12 'isc-worker0003' (tid=15336, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_taskmgr_create /home/ondrej/Projects/bind9/lib/isc/task.c:1410 (libisc.so.1504+0x59d63)
#3 create_managers main.c:902 (named+0x1aeec)
#4 setup main.c:1235 (named+0x1aeec)
#5 main main.c:1515 (named+0x1aeec)
Thread T4 'isc-net-0003' (tid=15328, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/message.c:362 in msginitheader
WARNING: ThreadSanitizer: data race (pid=15310)
Write of size 2 at 0x7b50000c000c by thread T1:
#0 msginitheader /home/ondrej/Projects/bind9/lib/dns/message.c:363 (libdns.so.1505+0xc2ced)
#1 msginit /home/ondrej/Projects/bind9/lib/dns/message.c:408 (libdns.so.1505+0xc2ced)
#2 msgreset /home/ondrej/Projects/bind9/lib/dns/message.c:656 (libdns.so.1505+0xc2ced)
#3 dns_message_reset /home/ondrej/Projects/bind9/lib/dns/message.c:797 (libdns.so.1505+0xc325e)
#4 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:215 (libns.so.1502+0x122fa)
#5 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1528 (libns.so.1502+0x122fa)
#6 isc_nmhandle_unref /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1083 (libisc.so.1504+0x409eb)
#7 isc__nm_uvreq_put /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1218 (libisc.so.1504+0x41c3f)
#8 udp_send_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:439 (libisc.so.1504+0x46c8d)
#9 <null> <null> (libuv.so.1+0x1d283)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Previous read of size 2 at 0x7b50000c000c by thread T12:
#0 ns_client_send /home/ondrej/Projects/bind9/lib/ns/client.c:652 (libns.so.1502+0x10fee)
#1 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1559 (libns.so.1502+0x4ecb6)
#2 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1551 (libns.so.1502+0x4ecb6)
#3 updatedone_action /home/ondrej/Projects/bind9/lib/ns/update.c:3391 (libns.so.1502+0x4f598)
#4 dispatch /home/ondrej/Projects/bind9/lib/isc/task.c:1134 (libisc.so.1504+0x56fa6)
#5 run /home/ondrej/Projects/bind9/lib/isc/task.c:1319 (libisc.so.1504+0x56fa6)
#6 <null> <null> (libtsan.so.0+0x29b3d)
Location is heap block of size 497 at 0x7b50000c0000 allocated by thread T4:
#0 malloc <null> (libtsan.so.0+0x2b1a3)
#1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:685 (libisc.so.1504+0x33fee)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:598 (libisc.so.1504+0x3c001)
#3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1013 (libisc.so.1504+0x3c001)
#4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2365 (libisc.so.1504+0x3aef1)
#5 dns_message_create /home/ondrej/Projects/bind9/lib/dns/message.c:715 (libdns.so.1505+0xbcc0e)
#6 ns__client_setup /home/ondrej/Projects/bind9/lib/ns/client.c:2250 (libns.so.1502+0x132d3)
#7 ns__client_request /home/ondrej/Projects/bind9/lib/ns/client.c:1634 (libns.so.1502+0x13d2a)
#8 udp_recv_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:317 (libisc.so.1504+0x46926)
#9 <null> <null> (libuv.so.1+0x1d6d4)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Thread T1 'isc-net-0000' (tid=15325, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
Thread T12 'isc-worker0003' (tid=15336, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_taskmgr_create /home/ondrej/Projects/bind9/lib/isc/task.c:1410 (libisc.so.1504+0x59d63)
#3 create_managers main.c:902 (named+0x1aeec)
#4 setup main.c:1235 (named+0x1aeec)
#5 main main.c:1515 (named+0x1aeec)
Thread T4 'isc-net-0003' (tid=15328, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/message.c:363 in msginitheader
WARNING: ThreadSanitizer: data race (pid=15310)
Write of size 8 at 0x7b50000c0170 by thread T1:
#0 msginittsig /home/ondrej/Projects/bind9/lib/dns/message.c:394 (libdns.so.1505+0xc2edd)
#1 msginit /home/ondrej/Projects/bind9/lib/dns/message.c:410 (libdns.so.1505+0xc2edd)
#2 msgreset /home/ondrej/Projects/bind9/lib/dns/message.c:656 (libdns.so.1505+0xc2edd)
#3 dns_message_reset /home/ondrej/Projects/bind9/lib/dns/message.c:797 (libdns.so.1505+0xc325e)
#4 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:215 (libns.so.1502+0x122fa)
#5 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1528 (libns.so.1502+0x122fa)
#6 isc_nmhandle_unref /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1083 (libisc.so.1504+0x409eb)
#7 isc__nm_uvreq_put /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1218 (libisc.so.1504+0x41c3f)
#8 udp_send_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:439 (libisc.so.1504+0x46c8d)
#9 <null> <null> (libuv.so.1+0x1d283)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Previous read of size 8 at 0x7b50000c0170 by thread T12:
#0 ns_client_send /home/ondrej/Projects/bind9/lib/ns/client.c:657 (libns.so.1502+0x11048)
#1 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1559 (libns.so.1502+0x4ecb6)
#2 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1551 (libns.so.1502+0x4ecb6)
#3 updatedone_action /home/ondrej/Projects/bind9/lib/ns/update.c:3391 (libns.so.1502+0x4f598)
#4 dispatch /home/ondrej/Projects/bind9/lib/isc/task.c:1134 (libisc.so.1504+0x56fa6)
#5 run /home/ondrej/Projects/bind9/lib/isc/task.c:1319 (libisc.so.1504+0x56fa6)
#6 <null> <null> (libtsan.so.0+0x29b3d)
Location is heap block of size 497 at 0x7b50000c0000 allocated by thread T4:
#0 malloc <null> (libtsan.so.0+0x2b1a3)
#1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:685 (libisc.so.1504+0x33fee)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:598 (libisc.so.1504+0x3c001)
#3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1013 (libisc.so.1504+0x3c001)
#4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2365 (libisc.so.1504+0x3aef1)
#5 dns_message_create /home/ondrej/Projects/bind9/lib/dns/message.c:715 (libdns.so.1505+0xbcc0e)
#6 ns__client_setup /home/ondrej/Projects/bind9/lib/ns/client.c:2250 (libns.so.1502+0x132d3)
#7 ns__client_request /home/ondrej/Projects/bind9/lib/ns/client.c:1634 (libns.so.1502+0x13d2a)
#8 udp_recv_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:317 (libisc.so.1504+0x46926)
#9 <null> <null> (libuv.so.1+0x1d6d4)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Thread T1 'isc-net-0000' (tid=15325, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
Thread T12 'isc-worker0003' (tid=15336, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_taskmgr_create /home/ondrej/Projects/bind9/lib/isc/task.c:1410 (libisc.so.1504+0x59d63)
#3 create_managers main.c:902 (named+0x1aeec)
#4 setup main.c:1235 (named+0x1aeec)
#5 main main.c:1515 (named+0x1aeec)
Thread T4 'isc-net-0003' (tid=15328, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/message.c:394 in msginittsig
WARNING: ThreadSanitizer: data race (pid=15310)
Write of size 8 at 0x7b50000c0190 by thread T1:
#0 msginittsig /home/ondrej/Projects/bind9/lib/dns/message.c:397 (libdns.so.1505+0xc2f21)
#1 msginit /home/ondrej/Projects/bind9/lib/dns/message.c:410 (libdns.so.1505+0xc2f21)
#2 msgreset /home/ondrej/Projects/bind9/lib/dns/message.c:656 (libdns.so.1505+0xc2f21)
#3 dns_message_reset /home/ondrej/Projects/bind9/lib/dns/message.c:797 (libdns.so.1505+0xc325e)
#4 ns_client_endrequest /home/ondrej/Projects/bind9/lib/ns/client.c:215 (libns.so.1502+0x122fa)
#5 ns__client_reset_cb /home/ondrej/Projects/bind9/lib/ns/client.c:1528 (libns.so.1502+0x122fa)
#6 isc_nmhandle_unref /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1083 (libisc.so.1504+0x409eb)
#7 isc__nm_uvreq_put /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:1218 (libisc.so.1504+0x41c3f)
#8 udp_send_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:439 (libisc.so.1504+0x46c8d)
#9 <null> <null> (libuv.so.1+0x1d283)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Previous read of size 8 at 0x7b50000c0190 by thread T12:
#0 ns_client_send /home/ondrej/Projects/bind9/lib/ns/client.c:661 (libns.so.1502+0x11093)
#1 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1559 (libns.so.1502+0x4ecb6)
#2 respond /home/ondrej/Projects/bind9/lib/ns/update.c:1551 (libns.so.1502+0x4ecb6)
#3 updatedone_action /home/ondrej/Projects/bind9/lib/ns/update.c:3391 (libns.so.1502+0x4f598)
#4 dispatch /home/ondrej/Projects/bind9/lib/isc/task.c:1134 (libisc.so.1504+0x56fa6)
#5 run /home/ondrej/Projects/bind9/lib/isc/task.c:1319 (libisc.so.1504+0x56fa6)
#6 <null> <null> (libtsan.so.0+0x29b3d)
Location is heap block of size 497 at 0x7b50000c0000 allocated by thread T4:
#0 malloc <null> (libtsan.so.0+0x2b1a3)
#1 default_memalloc /home/ondrej/Projects/bind9/lib/isc/mem.c:685 (libisc.so.1504+0x33fee)
#2 mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:598 (libisc.so.1504+0x3c001)
#3 isc___mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:1013 (libisc.so.1504+0x3c001)
#4 isc__mem_get /home/ondrej/Projects/bind9/lib/isc/mem.c:2365 (libisc.so.1504+0x3aef1)
#5 dns_message_create /home/ondrej/Projects/bind9/lib/dns/message.c:715 (libdns.so.1505+0xbcc0e)
#6 ns__client_setup /home/ondrej/Projects/bind9/lib/ns/client.c:2250 (libns.so.1502+0x132d3)
#7 ns__client_request /home/ondrej/Projects/bind9/lib/ns/client.c:1634 (libns.so.1502+0x13d2a)
#8 udp_recv_cb /home/ondrej/Projects/bind9/lib/isc/netmgr/udp.c:317 (libisc.so.1504+0x46926)
#9 <null> <null> (libuv.so.1+0x1d6d4)
#10 <null> <null> (libtsan.so.0+0x29b3d)
Thread T1 'isc-net-0000' (tid=15325, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
Thread T12 'isc-worker0003' (tid=15336, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_taskmgr_create /home/ondrej/Projects/bind9/lib/isc/task.c:1410 (libisc.so.1504+0x59d63)
#3 create_managers main.c:902 (named+0x1aeec)
#4 setup main.c:1235 (named+0x1aeec)
#5 main main.c:1515 (named+0x1aeec)
Thread T4 'isc-net-0003' (tid=15328, running) created by main thread at:
#0 pthread_create <null> (libtsan.so.0+0x2be1b)
#1 isc_thread_create /home/ondrej/Projects/bind9/lib/isc/pthreads/thread.c:75 (libisc.so.1504+0x7bcc4)
#2 isc_nm_start /home/ondrej/Projects/bind9/lib/isc/netmgr/netmgr.c:149 (libisc.so.1504+0x3ec7a)
#3 create_managers main.c:895 (named+0x1ae90)
#4 setup main.c:1235 (named+0x1ae90)
#5 main main.c:1515 (named+0x1ae90)
SUMMARY: ThreadSanitizer: data race /home/ondrej/Projects/bind9/lib/dns/message.c:397 in msginittsig
Edited by Ondřej Surý