1. 22 Sep, 2020 12 commits
    • Mark Andrews's avatar
      Break lock order loop by sending TAT in an event · 3c4b68af
      Mark Andrews authored
      The dotat() function has been changed to send the TAT
      query asynchronously, so there's no lock order loop
      because we initialize the data first and then we schedule
      the TAT send to happen asynchronously.
      
      This breaks following lock-order loops:
      
      zone->lock (dns_zone_setviewcommit) while holding view->lock
      (dns_view_setviewcommit)
      
      keytable->lock (dns_keytable_find) while holding zone->lock
      (zone_asyncload)
      
      view->lock (dns_view_findzonecut) while holding keytable->lock
      (dns_keytable_forall)
      3c4b68af
    • Mark Andrews's avatar
      Merge branch... · 2bb27e4a
      Mark Andrews authored
      Merge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread_rwlock_wrlock' into 'main'
      
      Resolve "ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock"
      
      Closes #2157
      
      See merge request !4158
      2bb27e4a
    • Mark Andrews's avatar
      Address lock-order-inversion · 10908766
      Mark Andrews authored
          WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
          Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M1
      
          Mutex M2 acquired here while holding mutex M1 in thread T1:
          #0 pthread_rwlock_wrlock <null>
          #1 isc_rwlock_lock lib/isc/rwlock.c:52:4
          #2 zone_postload lib/dns/zone.c:5101:2
          #3 receive_secure_db lib/dns/zone.c:16206:11
          #4 dispatch lib/isc/task.c:1152:7
          #5 run lib/isc/task.c:1344:2
      
          Mutex M1 previously acquired by the same thread here:
          #0 pthread_mutex_lock <null>
          #1 receive_secure_db lib/dns/zone.c:16204:2
          #2 dispatch lib/isc/task.c:1152:7
          #3 run lib/isc/task.c:1344:2
      
          Mutex M1 acquired here while holding mutex M2 in thread T1:
          #0 pthread_mutex_lock <null>
          #1 get_raw_serial lib/dns/zone.c:2518:2
          #2 zone_gotwritehandle lib/dns/zone.c:2559:4
          #3 dispatch lib/isc/task.c:1152:7
          #4 run lib/isc/task.c:1344:2
      
          Mutex M2 previously acquired by the same thread here:
          #0 pthread_rwlock_rdlock <null>
          #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
          #2 zone_gotwritehandle lib/dns/zone.c:2552:2
          #3 dispatch lib/isc/task.c:1152:7
          #4 run lib/isc/task.c:1344: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_taskmgr_create lib/isc/task.c:1434:3
          #3 create_managers bin/named/main.c:915:11
          #4 setup bin/named/main.c:1223:11
          #5 main bin/named/main.c:1523:2
      
          SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) in pthread_rwlock_wrlock
      10908766
    • Ondřej Surý's avatar
      Merge branch '2144-double-attach-when-prefetching' into 'main' · 52b0186b
      Ondřej Surý authored
      Resolve "double-attach when prefetching"
      
      Closes #2144
      
      See merge request !4124
      52b0186b
    • Ondřej Surý's avatar
      Add separate prefetch nmhandle to ns_client_t · d4976e0e
      Ondřej Surý authored
      As the query_prefetch() or query_rpzfetch() could be called during
      "regular" fetch, we need to introduce separate storage for attaching
      the nmhandle during prefetching the records.  The query_prefetch()
      and query_rpzfetch() are guarded for re-entrance by .query.prefetch
      member of ns_client_t, so we can reuse the same .prefetchhandle for
      both.
      d4976e0e
    • Matthijs Mekking's avatar
      Merge branch '2127-xml2rst-add-missing-updates' into 'main' · e60370ba
      Matthijs Mekking authored
      Resolve "Update ARM with lost changes since the conversion to RST files"
      
      Closes #2127
      
      See merge request !4112
      e60370ba
    • Matthijs Mekking's avatar
      Improve language in documentation · 49e76c15
      Matthijs Mekking authored
      Various language specific improvements, from Suzanne Goldlust's
      review.
      49e76c15
    • Matthijs Mekking's avatar
      Update DNSSEC documentation · 0b032036
      Matthijs Mekking authored
      This was originally done in commit
      da0ae529 but was lost when the
      documentation was converted to RST files.
      0b032036
    • Matthijs Mekking's avatar
      Add a note on DNSSEC sign metrics in the ARM · 3a3ace0f
      Matthijs Mekking authored
      This was added previously in commit
      3a3f40e3 but was lost when the
      documentation was converted to RST files.
      3a3ace0f
    • Matthijs Mekking's avatar
      Remove leftover 'dnssec-keys' references · e6b335c2
      Matthijs Mekking authored
      The option 'dnssec-keys' was introduced in 9.15 and also renamed to
      'trust-anchors'. Rename the leftover references to 'trust-anchors'.
      e6b335c2
    • Michał Kępień's avatar
      Merge branch 'michal/minimize-stdout-logging-in-pairwise-testing-jobs' into 'main' · 5ca1b9be
      Michał Kępień authored
      Minimize stdout logging in pairwise testing jobs
      
      See merge request !4159
      5ca1b9be
    • Michał Kępień's avatar
      Minimize stdout logging in pairwise testing jobs · a8dd69a4
      Michał Kępień authored
      The size of the log generated by each GitLab CI job is limited to 4 MB
      by default.  While this limit is configurable, it makes little sense to
      print build logs to standard output if they are being captured to files
      anyway.  Limit use of "tee" in util/pairwise-testing.sh to printing the
      combination of configure switches used for a given build.  This way the
      job should never exceed the default 4 MB log size limit, yet it will
      still indicate its progress in a concise way.
      a8dd69a4
  2. 21 Sep, 2020 19 commits
    • Michał Kępień's avatar
      Merge branch 'michal/extend-the-artifact-list-for-the-pairwise-ci-job' into 'main' · f6e2d6ce
      Michał Kępień authored
      Extend the artifact list for the "pairwise" CI job
      
      See merge request !4156
      f6e2d6ce
    • Michał Kępień's avatar
      Extend the artifact list for the "pairwise" CI job · 9d181b8d
      Michał Kępień authored
      Include the log file generated by the last failed pairwise build among
      the artifacts produced by the "pairwise" GitLab CI job in order to
      simplify troubleshooting pairwise build failures.
      9d181b8d
    • Michał Kępień's avatar
      Merge branch 'matthijs-fix-deprected-typo' into 'main' · 3cb9ecc9
      Michał Kępień authored
      Fix deprected typo
      
      See merge request !4155
      3cb9ecc9
    • Michał Kępień's avatar
      Merge branch 'mnowak/pairwise-configure-testing' into 'main' · 3ec72c49
      Michał Kępień authored
      Add pairwise testing
      
      Closes isc-private/bind-qa#21
      
      See merge request !3784
      3ec72c49
    • Matthijs Mekking's avatar
      Fix 'deprected' typo · 0a8cb3fa
      Matthijs Mekking authored
      0a8cb3fa
    • Michal Nowak's avatar
      Add pairwise testing · 420986bf
      Michal Nowak authored
      Pairwise testing is a test case generation technique based on the
      observation that most faults are caused by interactions of at most two
      factors.  For BIND, its configure options can be thought of as such
      factors.
      
      Process BIND configure options into a model that is subsequently
      processed by the PICT tool in order to find an effective test vector.
      That test vector is then used for configuring and building BIND using
      various combinations of configure options.
      420986bf
    • Mark Andrews's avatar
      Merge branch '2158-threadsanitizer-data-race-in-memmove' into 'main' · 2430dff4
      Mark Andrews authored
      Resolve "ThreadSanitizer: data race in memmove"
      
      Closes #2158
      
      See merge request !4149
      2430dff4
    • Mark Andrews's avatar
      Remove the memmove call on dns_rbtnode_t structure that contains atomics · 48d54368
      Mark Andrews authored
      Calling the plain memmove on the structure that contains atomic members
      triggers following TSAN warning (even when we don't really use the
      atomic members in the code):
      
          WARNING: ThreadSanitizer: data race
            Read of size 8 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
      	#0 memmove <null>
      	#1 memmove /usr/include/x86_64-linux-gnu/bits/string_fortified.h:40:10
      	#2 deletefromlevel lib/dns/rbt.c:2675:3
      	#3 dns_rbt_deletenode lib/dns/rbt.c:2143:2
      	#4 delete_node lib/dns/rbtdb.c
      	#5 decrement_reference lib/dns/rbtdb.c:2202:4
      	#6 prune_tree lib/dns/rbtdb.c:2259:3
      	#7 dispatch lib/isc/task.c:1152:7
      	#8 run lib/isc/task.c:1344:2
      
            Previous atomic write of size 8 at 0x000000000001 by thread T2 (mutexes: read M3):
      	#0 __tsan_atomic64_fetch_sub <null>
      	#1 decrement_reference lib/dns/rbtdb.c:2103:7
      	#2 detachnode lib/dns/rbtdb.c:5440:6
      	#3 dns_db_detachnode lib/dns/db.c:588:2
      	#4 qctx_clean lib/ns/query.c:5104:3
      	#5 ns_query_done lib/ns/query.c:10868:2
      	#6 query_sign_nodata lib/ns/query.c
      	#7 query_nodata lib/ns/query.c:8438:11
      	#8 query_gotanswer lib/ns/query.c
      	#9 query_lookup lib/ns/query.c:5624:10
      	#10 ns__query_start lib/ns/query.c:5500:10
      	#11 query_setup lib/ns/query.c:5224:11
      	#12 ns_query_start lib/ns/query.c:11357:8
      	#13 ns__client_request lib/ns/client.c:2166:3
      	#14 udp_recv_cb lib/isc/netmgr/udp.c:414:2
      	#15 uv__udp_recvmsg /home/ondrej/Projects/tsan/libuv/src/unix/udp.c
      	#16 uv__udp_io /home/ondrej/Projects/tsan/libuv/src/unix/udp.c:180:5
      	#17 uv__io_poll /home/ondrej/Projects/tsan/libuv/src/unix/linux-core.c:461:11
      	#18 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:385:5
      	#19 nm_thread lib/isc/netmgr/netmgr.c:500:11
      
            Location is heap block of size 132 at 0x000000000030 allocated by thread T3:
      	#0 malloc <null>
      	#1 default_memalloc lib/isc/mem.c:713:8
      	#2 mem_get lib/isc/mem.c:622:8
      	#3 mem_allocateunlocked lib/isc/mem.c:1268:8
      	#4 isc___mem_allocate lib/isc/mem.c:1288:7
      	#5 isc__mem_allocate lib/isc/mem.c:2453:10
      	#6 isc___mem_get lib/isc/mem.c:1037:11
      	#7 isc__mem_get lib/isc/mem.c:2432:10
      	#8 create_node lib/dns/rbt.c:2239:9
      	#9 dns_rbt_addnode lib/dns/rbt.c:1435:12
      	#10 findnodeintree lib/dns/rbtdb.c:2895:12
      	#11 findnode lib/dns/rbtdb.c:2941:10
      	#12 dns_db_findnode lib/dns/db.c:439:11
      	#13 diff_apply lib/dns/diff.c:306:5
      	#14 dns_diff_apply lib/dns/diff.c:459:10
      	#15 do_one_tuple lib/ns/update.c:444:11
      	#16 update_one_rr lib/ns/update.c:495:10
      	#17 update_action lib/ns/update.c:3123:6
      	#18 dispatch lib/isc/task.c:1152:7
      	#19 run lib/isc/task.c:1344:2
      
            Mutex M1 is already destroyed.
      
            Mutex M2 is already destroyed.
      
            Mutex M3 is already destroyed.
      
            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_taskmgr_create lib/isc/task.c:1434:3
      	#3 create_managers bin/named/main.c:915:11
      	#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:223: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 T3 (running) created by main thread at:
      	#0 pthread_create <null>
      	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
      	#2 isc_taskmgr_create lib/isc/task.c:1434:3
      	#3 create_managers bin/named/main.c:915:11
      	#4 setup bin/named/main.c:1223:11
      	#5 main bin/named/main.c:1523:2
      
          SUMMARY: ThreadSanitizer: data race in memmove
      48d54368
    • Ondřej Surý's avatar
      Merge branch '2166-bind-9-16-7-trap-divide-error' into 'main' · 317af42a
      Ondřej Surý authored
      Resolve "bind 9.16.7 trap divide error"
      
      Closes #2166
      
      See merge request !4141
      317af42a
    • Ondřej Surý's avatar
      Add CHANGES and release note for GL #2166 · 2869ca14
      Ondřej Surý authored
      2869ca14
    • Ondřej Surý's avatar
      Handle the errors from sysconf() call in isc_meminfo_totalphys() · 79ca724d
      Ondřej Surý authored
      isc_meminfo_totalphys() would return invalid memory size when sysconf()
      call would fail, because ((size_t)-1 * -1) is very large number.
      79ca724d
    • Mark Andrews's avatar
      Merge branch... · 08dd2838
      Mark Andrews authored
      Merge branch '2164-threadsanitizer-data-race-bin-named-controlconf-c-257-22-in-control_senddone' into 'main'
      
      Resolve "ThreadSanitizer: data race bin/named/controlconf.c:257:22 in control_senddone"
      
      Closes #2164
      
      See merge request !4147
      08dd2838
    • Ondřej Surý's avatar
      Remove .listener member of controlistener struct · ee40b963
      Ondřej Surý authored
      In the new netmgr code, the .listener member was mostly functionally
      only duplicating the .exiting member and was unneeded.  This also
      resolves following ThreadSanitizer (harmless) warning:
      
          WARNING: ThreadSanitizer: data race
            Write of size 1 at 0x000000000001 by thread T1:
      	#0 control_senddone bin/named/controlconf.c:257:22
      	#1 tcp_send_cb lib/isc/netmgr/tcp.c:1027:2
      	#2 uv__write_callbacks /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:953:7
      	#3 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1330:5
      	#4 uv__run_pending /home/ondrej/Projects/tsan/libuv/src/unix/core.c:812:5
      	#5 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:377:19
      	#6 nm_thread lib/isc/netmgr/netmgr.c:500:11
      
            Previous write of size 1 at 0x000000000001 by thread T2:
      	#0 control_senddone bin/named/controlconf.c:257:22
      	#1 tcp_send_cb lib/isc/netmgr/tcp.c:1027:2
      	#2 uv__write_callbacks /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:953:7
      	#3 uv__stream_io /home/ondrej/Projects/tsan/libuv/src/unix/stream.c:1330:5
      	#4 uv__run_pending /home/ondrej/Projects/tsan/libuv/src/unix/core.c:812:5
      	#5 uv_run /home/ondrej/Projects/tsan/libuv/src/unix/core.c:377:19
      	#6 nm_thread lib/isc/netmgr/netmgr.c:500:11
      
            Location is heap block of size 265 at 0x000000000009 allocated by thread T3:
      	#0 malloc <null>
      	#1 default_memalloc lib/isc/mem.c:713:8
      	#2 mem_get lib/isc/mem.c:622:8
      	#3 isc___mem_get lib/isc/mem.c:1044:9
      	#4 isc__mem_get lib/isc/mem.c:2432:10
      	#5 add_listener bin/named/controlconf.c:1133:13
      	#6 named_controls_configure bin/named/controlconf.c:1331:6
      	#7 load_configuration bin/named/server.c:9133:2
      	#8 run_server bin/named/server.c:9771:2
      	#9 dispatch lib/isc/task.c:1152:7
      	#10 run lib/isc/task.c:1344: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:223: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:223: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 T3 (running) created by main thread at:
      	#0 pthread_create <null>
      	#1 isc_thread_create lib/isc/pthreads/thread.c:73:8
      	#2 isc_taskmgr_create lib/isc/task.c:1434:3
      	#3 create_managers bin/named/main.c:915:11
      	#4 setup bin/named/main.c:1223:11
      	#5 main bin/named/main.c:1523:2
      
          SUMMARY: ThreadSanitizer: data race bin/named/controlconf.c:257:22 in control_senddone
      ee40b963
    • Michał Kępień's avatar
      Merge branch '2169-fix-updating-summary-rpz-db-for-mixed-case-rpzs' into 'main' · 78304690
      Michał Kępień authored
      Fix updating summary RPZ DB for mixed-case RPZs
      
      Closes #2169
      
      See merge request !4146
      78304690
    • Michał Kępień's avatar
      Add CHANGES entry · e6e4922f
      Michał Kępień authored
      e6e4922f
    • Michał Kępień's avatar
      Add release note · 853a51d4
      Michał Kępień authored
      853a51d4
    • Michał Kępień's avatar
      Fix updating summary RPZ DB for mixed-case RPZs · dc8a7791
      Michał Kępień authored
      Each dns_rpz_zone_t structure keeps a hash table of the names this RPZ
      database contains.  Here is what happens when an RPZ is updated:
      
        - a new hash table is prepared for the new version of the RPZ by
          iterating over it; each name found is added to the summary RPZ
          database,
      
        - every name added to the new hash table is searched for in the old
          hash table; if found, it is removed from the old hash table,
      
        - the old hash table is iterated over; all names found in it are
          removed from the summary RPZ database (because at that point the old
          hash table should only contain names which are not present in the
          new version of the RPZ),
      
        - the new hash table replaces the old hash table.
      
      When the new version of the RPZ is iterated over, if a given name is
      spelled using a different letter case than in the old version of the
      RPZ, the new variant will hash to a different value than the old
      variant, which means it will not be removed from the old hash table.
      When the old hash table is subsequently iterated over to remove
      seemingly deleted names, the old variant of the name will still be
      there, causing the name to be deleted from the summary RPZ database
      (which effectively causes a given rule to be ignored).
      
      The issue can be triggered not just by altering the case of existing
      names in an RPZ, but also by adding sibling names spelled with a
      different letter case.  This is because RBT code preserves case when
      node splitting occurs.  The end result is that when the RPZ is iterated
      over, a given name may be using a different case than in the zone file
      (or XFR contents).
      
      Fix by downcasing all names found in the RPZ database before adding them
      to the summary RPZ database.
      dc8a7791
    • Mark Andrews's avatar
      Merge branch... · 91a46bda
      Mark Andrews authored
      Merge branch '2160-threadsanitizer-data-race-bin-named-controlconf-c-422-37-in-control_recvmessage' into 'main'
      
      Resolve "ThreadSanitizer: data race bin/named/controlconf.c:422:37 in control_recvmessage"
      
      Closes #2160
      
      See merge request !4148
      91a46bda
    • Mark Andrews's avatar
      make controls->shuttingdown an atomic_bool · 631617d4
      Mark Andrews authored
      631617d4
  3. 17 Sep, 2020 9 commits
    • Ondřej Surý's avatar
      Merge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put' into 'main' · 46d2a36c
      Ondřej Surý authored
      Exclude isc_mem_isovermem from ThreadSanitizer
      
      Closes #2163
      
      See merge request !4140
      46d2a36c
    • Ondřej Surý's avatar
      Exclude isc_mem_isovermem from ThreadSanitizer · 0110d1ab
      Ondřej Surý authored
      The .is_overmem member of isc_mem_t structure is intentionally accessed
      unlocked as 100% accuracy isn't necessary here.
      
      Without the attribute, following TSAN warning would show up:
      
          WARNING: ThreadSanitizer: data race
            Write of size 1 at 0x000000000001 by thread T1 (mutexes: write M1, write M2):
      	#0 isc___mem_put lib/isc/mem.c:1119:19
      	#1 isc__mem_put lib/isc/mem.c:2439:2
      	#2 dns_rdataslab_fromrdataset lib/dns/rdataslab.c:327:2
      	#3 addrdataset lib/dns/rbtdb.c:6761:11
      	#4 dns_db_addrdataset lib/dns/db.c:719:10
      	#5 cache_name lib/dns/resolver.c:6538:13
      	#6 cache_message lib/dns/resolver.c:6628:14
      	#7 resquery_response lib/dns/resolver.c:7883:13
      	#8 dispatch lib/isc/task.c:1152:7
      	#9 run lib/isc/task.c:1344:2
      
            Previous read of size 1 at 0x000000000001 by thread T2 (mutexes: write M3):
      	#0 isc_mem_isovermem lib/isc/mem.c:1553:15
      	#1 addrdataset lib/dns/rbtdb.c:6866:25
      	#2 dns_db_addrdataset lib/dns/db.c:719:10
      	#3 addoptout lib/dns/ncache.c:281:10
      	#4 dns_ncache_add lib/dns/ncache.c:101:10
      	#5 ncache_adderesult lib/dns/resolver.c:6668:12
      	#6 ncache_message lib/dns/resolver.c:6845:11
      	#7 rctx_ncache lib/dns/resolver.c:9174:11
      	#8 resquery_response lib/dns/resolver.c:7894:2
      	#9 dispatch lib/isc/task.c:1152:7
      	#10 run lib/isc/task.c:1344:2
      
            Location is heap block of size 328 at 0x000000000020 allocated by thread T3:
      	#0 malloc <null>
      	#1 default_memalloc lib/isc/mem.c:713:8
      	#2 mem_create lib/isc/mem.c:763:8
      	#3 isc_mem_create lib/isc/mem.c:2425:2
      	#4 configure_view bin/named/server.c:4494:4
      	#5 load_configuration bin/named/server.c:9062:3
      	#6 run_server bin/named/server.c:9771:2
      	#7 dispatch lib/isc/task.c:1152:7
      	#8 run lib/isc/task.c:1344:2
      
          [...]
      
          SUMMARY: ThreadSanitizer: data race lib/isc/mem.c:1119:19 in isc___mem_put
      0110d1ab
    • Michał Kępień's avatar
      Merge branch 'michal/update-release-checklist' into 'main' · ed9a133b
      Michał Kępień authored
      Update release checklist
      
      See merge request !4142
      ed9a133b
    • Michał Kępień's avatar
      Update release checklist · 66a1fa77
      Michał Kępień authored
      Add an item to the release checklist to make sure eligible customers get
      notified about the location of the latest version of BIND Subscription
      Edition upon its release.
      66a1fa77
    • Mark Andrews's avatar
      Merge branch '2131-tsan-data-race-in-accessing-controls-symtab' into 'main' · d83ddea5
      Mark Andrews authored
      Resolve "TSAN data race in accessing controls->symtab"
      
      Closes #2131
      
      See merge request !4098
      d83ddea5
    • Mark Andrews's avatar
      Lock access to control->symtab to prevent data race · 0450acc1
      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
      0450acc1
    • Mark Andrews's avatar
      Merge branch '2123-lock-order-inversions-in-main' into 'main' · 56ff7bec
      Mark Andrews authored
      Resolve "Lock order inversions in main"
      
      Closes #2123
      
      See merge request !4090
      56ff7bec
    • Mark Andrews's avatar
      Pause dbiterator ealier to prevent lock-order-inversion · 9e584a45
      Mark Andrews authored
          WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
          Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000000) => M1
      
          Mutex M2 acquired here while holding mutex M1 in thread T1:
          #0 pthread_rwlock_rdlock <null>
          #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
          #2 findnodeintree lib/dns/rbtdb.c:2877:2
          #3 findnode lib/dns/rbtdb.c:2941:10
          #4 dns_db_findnode lib/dns/db.c:439:11
          #5 resume_addnsec3chain lib/dns/zone.c:3776:11
          #6 rss_post lib/dns/zone.c:20659:3
          #7 setnsec3param lib/dns/zone.c:20471:3
          #8 dispatch lib/isc/task.c:1152:7
          #9 run lib/isc/task.c:1344:2
      
          Mutex M1 previously acquired by the same thread here:
          #0 pthread_mutex_lock <null>
          #1 rss_post lib/dns/zone.c:20658:3
          #2 setnsec3param lib/dns/zone.c:20471:3
          #3 dispatch lib/isc/task.c:1152:7
          #4 run lib/isc/task.c:1344:2
      
          Mutex M1 acquired here while holding mutex M2 in thread T2:
          #0 pthread_mutex_lock <null>
          #1 zone_nsec3chain lib/dns/zone.c:8666:5
          #2 zone_maintenance lib/dns/zone.c:11063:4
          #3 zone_timer lib/dns/zone.c:14098:2
          #4 dispatch lib/isc/task.c:1152:7
          #5 run lib/isc/task.c:1344:2
      
          Mutex M2 previously acquired by the same thread here:
          #0 pthread_rwlock_rdlock <null>
          #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
          #2 resume_iteration lib/dns/rbtdb.c:9357:2
          #3 dbiterator_next lib/dns/rbtdb.c:9647:3
          #4 dns_dbiterator_next lib/dns/dbiterator.c:87:10
          #5 zone_nsec3chain lib/dns/zone.c:8656:13
          #6 zone_maintenance lib/dns/zone.c:11063:4
          #7 zone_timer lib/dns/zone.c:14098:2
          #8 dispatch lib/isc/task.c:1152:7
          #9 run lib/isc/task.c:1344:2
      9e584a45
    • Mark Andrews's avatar
      2e63de94