• Mark Andrews's avatar
    Lock access to control->symtab to prevent data race · 7e39ead1
    Mark Andrews authored
    WARNING: ThreadSanitizer: data race
      Read of size 8 at 0x000000000001 by thread T1:
        #0 isccc_symtab_foreach lib/isccc/symtab.c:277:14
        #1 isccc_cc_cleansymtab lib/isccc/cc.c:954:2
        #2 control_recvmessage bin/named/controlconf.c:477:2
        #3 recv_data lib/isccc/ccmsg.c:110:2
        #4 read_cb lib/isc/netmgr/tcp.c:769:4
        #5 <null> <null>
    
      Previous write of size 8 at 0x000000000001 by thread T2:
        #0 isccc_symtab_define lib/isccc/symtab.c:242:2
        #1 isccc_cc_checkdup lib/isccc/cc.c:1026:11
        #2 control_recvmessage bin/named/controlconf.c:478:11
        #3 recv_data lib/isccc/ccmsg.c:110:2
        #4 read_cb lib/isc/netmgr/tcp.c:769:4
        #5 <null> <null>
    
      Location is heap block of size 190352 at 0x000000000011 allocated by main thread:
        #0 malloc <null>
        #1 isccc_symtab_create lib/isccc/symtab.c:76:18
        #2 isccc_cc_createsymtab lib/isccc/cc.c:948:10
        #3 named_controls_create bin/named/controlconf.c:1483:11
        #4 named_server_create bin/named/server.c:10057:2
        #5 setup bin/named/main.c:1256:2
        #6 main bin/named/main.c:1523:2
    
      Thread T1 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
        #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
        #3 create_managers bin/named/main.c:909:15
        #4 setup bin/named/main.c:1223:11
        #5 main bin/named/main.c:1523:2
    
      Thread T2 (running) created by main thread at:
        #0 pthread_create <null>
        #1 isc_thread_create lib/isc/pthreads/thread.c:73:8
        #2 isc_nm_start lib/isc/netmgr/netmgr.c:215:3
        #3 create_managers bin/named/main.c:909:15
        #4 setup bin/named/main.c:1223:11
        #5 main bin/named/main.c:1523:2
    
    SUMMARY: ThreadSanitizer: data race lib/isccc/symtab.c:277:14 in isccc_symtab_foreach
    7e39ead1
controlconf.c 40.2 KB