]> git.ipfire.org Git - thirdparty/bind9.git/log
thirdparty/bind9.git
5 years agoMerge branch '2157-threadsanitizer-lock-order-inversion-potential-deadlock-in-pthread...
Mark Andrews [Tue, 22 Sep 2020 12:06:00 +0000 (12:06 +0000)] 
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 isc-projects/bind9!4158

5 years agoAddress lock-order-inversion
Mark Andrews [Tue, 22 Sep 2020 06:24:06 +0000 (16:24 +1000)] 
Address lock-order-inversion

    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

5 years agoMerge branch '2144-double-attach-when-prefetching' into 'main'
Ondřej Surý [Tue, 22 Sep 2020 08:53:31 +0000 (08:53 +0000)] 
Merge branch '2144-double-attach-when-prefetching' into 'main'

Resolve "double-attach when prefetching"

Closes #2144

See merge request isc-projects/bind9!4124

5 years agoAdd separate prefetch nmhandle to ns_client_t
Ondřej Surý [Tue, 15 Sep 2020 10:55:03 +0000 (12:55 +0200)] 
Add separate prefetch nmhandle to ns_client_t

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.

5 years agoMerge branch '2127-xml2rst-add-missing-updates' into 'main'
Matthijs Mekking [Tue, 22 Sep 2020 07:28:01 +0000 (07:28 +0000)] 
Merge branch '2127-xml2rst-add-missing-updates' into 'main'

Resolve "Update ARM with lost changes since the conversion to RST files"

Closes #2127

See merge request isc-projects/bind9!4112

5 years agoImprove language in documentation
Matthijs Mekking [Mon, 21 Sep 2020 09:03:30 +0000 (11:03 +0200)] 
Improve language in documentation

Various language specific improvements, from Suzanne Goldlust's
review.

5 years agoUpdate DNSSEC documentation
Matthijs Mekking [Thu, 10 Sep 2020 11:48:04 +0000 (13:48 +0200)] 
Update DNSSEC documentation

This was originally done in commit
da0ae5299f51c0ffdd4edc3b880d105a64590cf6 but was lost when the
documentation was converted to RST files.

5 years agoAdd a note on DNSSEC sign metrics in the ARM
Matthijs Mekking [Thu, 10 Sep 2020 10:37:29 +0000 (12:37 +0200)] 
Add a note on DNSSEC sign metrics in the ARM

This was added previously in commit
3a3f40e3729e1e3ab32f6c18eeecfd4749812ffb but was lost when the
documentation was converted to RST files.

5 years agoRemove leftover 'dnssec-keys' references
Matthijs Mekking [Thu, 10 Sep 2020 09:38:07 +0000 (11:38 +0200)] 
Remove leftover 'dnssec-keys' references

The option 'dnssec-keys' was introduced in 9.15 and also renamed to
'trust-anchors'. Rename the leftover references to 'trust-anchors'.

5 years agoMerge branch 'michal/minimize-stdout-logging-in-pairwise-testing-jobs' into 'main'
Michał Kępień [Tue, 22 Sep 2020 06:41:08 +0000 (06:41 +0000)] 
Merge branch 'michal/minimize-stdout-logging-in-pairwise-testing-jobs' into 'main'

Minimize stdout logging in pairwise testing jobs

See merge request isc-projects/bind9!4159

5 years agoMinimize stdout logging in pairwise testing jobs
Michał Kępień [Tue, 22 Sep 2020 06:40:04 +0000 (08:40 +0200)] 
Minimize stdout logging in pairwise testing jobs

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.

5 years agoMerge branch 'michal/extend-the-artifact-list-for-the-pairwise-ci-job' into 'main'
Michał Kępień [Mon, 21 Sep 2020 10:11:16 +0000 (10:11 +0000)] 
Merge branch 'michal/extend-the-artifact-list-for-the-pairwise-ci-job' into 'main'

Extend the artifact list for the "pairwise" CI job

See merge request isc-projects/bind9!4156

5 years agoExtend the artifact list for the "pairwise" CI job
Michał Kępień [Mon, 21 Sep 2020 10:08:50 +0000 (12:08 +0200)] 
Extend the artifact list for the "pairwise" CI job

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.

5 years agoMerge branch 'matthijs-fix-deprected-typo' into 'main'
Michał Kępień [Mon, 21 Sep 2020 09:34:53 +0000 (09:34 +0000)] 
Merge branch 'matthijs-fix-deprected-typo' into 'main'

Fix deprected typo

See merge request isc-projects/bind9!4155

5 years agoMerge branch 'mnowak/pairwise-configure-testing' into 'main'
Michał Kępień [Mon, 21 Sep 2020 09:32:16 +0000 (09:32 +0000)] 
Merge branch 'mnowak/pairwise-configure-testing' into 'main'

Add pairwise testing

Closes isc-private/bind-qa#21

See merge request isc-projects/bind9!3784

5 years agoFix 'deprected' typo
Matthijs Mekking [Mon, 21 Sep 2020 09:26:52 +0000 (11:26 +0200)] 
Fix 'deprected' typo

5 years agoAdd pairwise testing
Michal Nowak [Wed, 1 Jul 2020 08:29:36 +0000 (10:29 +0200)] 
Add pairwise testing

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.

5 years agoMerge branch '2158-threadsanitizer-data-race-in-memmove' into 'main'
Mark Andrews [Mon, 21 Sep 2020 09:18:35 +0000 (09:18 +0000)] 
Merge branch '2158-threadsanitizer-data-race-in-memmove' into 'main'

Resolve "ThreadSanitizer: data race in memmove"

Closes #2158

See merge request isc-projects/bind9!4149

5 years agoRemove the memmove call on dns_rbtnode_t structure that contains atomics
Mark Andrews [Mon, 21 Sep 2020 04:52:53 +0000 (14:52 +1000)] 
Remove the memmove call on dns_rbtnode_t structure that contains atomics

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

5 years agoMerge branch '2166-bind-9-16-7-trap-divide-error' into 'main'
Ondřej Surý [Mon, 21 Sep 2020 08:57:12 +0000 (08:57 +0000)] 
Merge branch '2166-bind-9-16-7-trap-divide-error' into 'main'

Resolve "bind 9.16.7 trap divide error"

Closes #2166

See merge request isc-projects/bind9!4141

5 years agoAdd CHANGES and release note for GL #2166
Ondřej Surý [Thu, 17 Sep 2020 12:47:16 +0000 (14:47 +0200)] 
Add CHANGES and release note for GL #2166

5 years agoHandle the errors from sysconf() call in isc_meminfo_totalphys()
Ondřej Surý [Thu, 17 Sep 2020 12:37:24 +0000 (14:37 +0200)] 
Handle the errors from sysconf() call in isc_meminfo_totalphys()

isc_meminfo_totalphys() would return invalid memory size when sysconf()
call would fail, because ((size_t)-1 * -1) is very large number.

5 years agoMerge branch '2164-threadsanitizer-data-race-bin-named-controlconf-c-257-22-in-contro...
Mark Andrews [Mon, 21 Sep 2020 08:43:21 +0000 (08:43 +0000)] 
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 isc-projects/bind9!4147

5 years agoRemove .listener member of controlistener struct
Ondřej Surý [Mon, 21 Sep 2020 08:16:36 +0000 (10:16 +0200)] 
Remove .listener member of controlistener struct

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

5 years agoMerge branch '2169-fix-updating-summary-rpz-db-for-mixed-case-rpzs' into 'main'
Michał Kępień [Mon, 21 Sep 2020 07:32:09 +0000 (07:32 +0000)] 
Merge branch '2169-fix-updating-summary-rpz-db-for-mixed-case-rpzs' into 'main'

Fix updating summary RPZ DB for mixed-case RPZs

Closes #2169

See merge request isc-projects/bind9!4146

5 years agoAdd CHANGES entry
Michał Kępień [Mon, 21 Sep 2020 07:28:36 +0000 (09:28 +0200)] 
Add CHANGES entry

5 years agoAdd release note
Michał Kępień [Mon, 21 Sep 2020 07:28:36 +0000 (09:28 +0200)] 
Add release note

5 years agoFix updating summary RPZ DB for mixed-case RPZs
Michał Kępień [Mon, 21 Sep 2020 07:28:36 +0000 (09:28 +0200)] 
Fix updating summary RPZ DB for mixed-case RPZs

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.

5 years agoMerge branch '2160-threadsanitizer-data-race-bin-named-controlconf-c-422-37-in-contro...
Mark Andrews [Mon, 21 Sep 2020 03:41:49 +0000 (03:41 +0000)] 
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 isc-projects/bind9!4148

5 years agomake controls->shuttingdown an atomic_bool
Mark Andrews [Mon, 21 Sep 2020 02:48:10 +0000 (12:48 +1000)] 
make controls->shuttingdown an atomic_bool

5 years agoMerge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put...
Ondřej Surý [Thu, 17 Sep 2020 15:34:35 +0000 (15:34 +0000)] 
Merge branch '2163-threadsanitizer-data-race-lib-isc-mem-c-1119-19-in-isc___mem_put' into 'main'

Exclude isc_mem_isovermem from ThreadSanitizer

Closes #2163

See merge request isc-projects/bind9!4140

5 years agoExclude isc_mem_isovermem from ThreadSanitizer
Ondřej Surý [Thu, 17 Sep 2020 12:05:10 +0000 (14:05 +0200)] 
Exclude isc_mem_isovermem from ThreadSanitizer

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

5 years agoMerge branch 'michal/update-release-checklist' into 'main'
Michał Kępień [Thu, 17 Sep 2020 13:43:23 +0000 (13:43 +0000)] 
Merge branch 'michal/update-release-checklist' into 'main'

Update release checklist

See merge request isc-projects/bind9!4142

5 years agoUpdate release checklist
Michał Kępień [Thu, 17 Sep 2020 13:39:11 +0000 (15:39 +0200)] 
Update release checklist

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.

5 years agoMerge branch '2131-tsan-data-race-in-accessing-controls-symtab' into 'main'
Mark Andrews [Thu, 17 Sep 2020 09:28:40 +0000 (09:28 +0000)] 
Merge branch '2131-tsan-data-race-in-accessing-controls-symtab' into 'main'

Resolve "TSAN data race in accessing controls->symtab"

Closes #2131

See merge request isc-projects/bind9!4098

5 years agoLock access to control->symtab to prevent data race
Mark Andrews [Tue, 8 Sep 2020 02:11:06 +0000 (12:11 +1000)] 
Lock access to control->symtab to prevent data race

    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

5 years agoMerge branch '2123-lock-order-inversions-in-main' into 'main'
Mark Andrews [Thu, 17 Sep 2020 08:12:21 +0000 (08:12 +0000)] 
Merge branch '2123-lock-order-inversions-in-main' into 'main'

Resolve "Lock order inversions in main"

Closes #2123

See merge request isc-projects/bind9!4090

5 years agoPause dbiterator ealier to prevent lock-order-inversion
Mark Andrews [Tue, 8 Sep 2020 03:42:07 +0000 (13:42 +1000)] 
Pause dbiterator ealier to prevent lock-order-inversion

    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

5 years agoPause the database iterator to release rwlock
Mark Andrews [Tue, 8 Sep 2020 03:16:28 +0000 (13:16 +1000)] 
Pause the database iterator to release rwlock

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 06:40:51 +0000 (16:40 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000000) => M2 (0x000000000001) => 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 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11119:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11089:2
    #2 update_action lib/ns/update.c:3376: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 T1:
    #0 pthread_mutex_lock <null>
    #1 zone_nsec3chain lib/dns/zone.c:8502:3
    #2 zone_maintenance lib/dns/zone.c:11056:4
    #3 zone_timer lib/dns/zone.c:14091: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_current lib/dns/rbtdb.c:9695:3
    #4 dns_dbiterator_current lib/dns/dbiterator.c:101:10
    #5 zone_nsec3chain lib/dns/zone.c:8539:3
    #6 zone_maintenance lib/dns/zone.c:11056:4
    #7 zone_timer lib/dns/zone.c:14091:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 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_rdlock

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 06:07:57 +0000 (16:07 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => 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 zone_sign lib/dns/zone.c:9247:3
    #3 zone_maintenance lib/dns/zone.c:11047:4
    #4 zone_timer lib/dns/zone.c:14090:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 run lib/isc/task.c:1344:2

    Mutex M1 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_sign lib/dns/zone.c:9488:13
    #6 zone_maintenance lib/dns/zone.c:11047:4
    #7 zone_timer lib/dns/zone.c:14090:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T2:
    #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 dns_db_getsoaserial lib/dns/db.c:780:11
    #6 dump_done lib/dns/zone.c:11428:15
    #7 dump_quantum lib/dns/masterdump.c:1487:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 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 dump_done lib/dns/zone.c:11426:4
    #3 dump_quantum lib/dns/masterdump.c:1487:2
    #4 dispatch lib/isc/task.c:1152:7
    #5 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

    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_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_rdlock

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 05:23:13 +0000 (15:23 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    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 getsigningtime lib/dns/rbtdb.c:8198:2
    #3 dns_db_getsigningtime lib/dns/db.c:979:11
    #4 set_resigntime lib/dns/zone.c:3887:11
    #5 dns_zone_markdirty lib/dns/zone.c:11115:4
    #6 update_action lib/ns/update.c:3376:3
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null>
    #1 dns_zone_markdirty lib/dns/zone.c:11085:2
    #2 update_action lib/ns/update.c:3376: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:8274:3
    #2 zone_maintenance lib/dns/zone.c:11052:4
    #3 zone_timer lib/dns/zone.c:14087: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:8412:13
    #6 zone_maintenance lib/dns/zone.c:11052:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 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

    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_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_rdlock

5 years agoPause dbiterator to release rwlock to prevent lock-order-inversion.
Mark Andrews [Fri, 4 Sep 2020 04:18:17 +0000 (14:18 +1000)] 
Pause dbiterator to release rwlock to prevent lock-order-inversion.

    WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock)
    Cycle in lock order graph: M1 (0x000000000001) => M2 (0x000000000002) => M3 (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 copy_non_dnssec_records lib/dns/zone.c:16031:11
    #6 receive_secure_db lib/dns/zone.c:16163:12
    #7 dispatch lib/isc/task.c:1152:7
    #8 run lib/isc/task.c:1344:2

    Mutex M1 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_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 receive_secure_db lib/dns/zone.c:16160:16
    #6 dispatch lib/isc/task.c:1152:7
    #7 run lib/isc/task.c:1344:2

    Mutex M3 acquired here while holding mutex M2 in thread T2:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_sign lib/dns/zone.c:9244:3
    #3 zone_maintenance lib/dns/zone.c:11044:4
    #4 zone_timer lib/dns/zone.c:14087:2
    #5 dispatch lib/isc/task.c:1152:7
    #6 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_sign lib/dns/zone.c:9485:13
    #6 zone_maintenance lib/dns/zone.c:11044:4
    #7 zone_timer lib/dns/zone.c:14087:2
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M3 in thread T3:
    #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 zone_get_from_db lib/dns/zone.c:5602:11
    #6 get_raw_serial lib/dns/zone.c:2520:12
    #7 zone_gotwritehandle lib/dns/zone.c:2559:4
    #8 dispatch lib/isc/task.c:1152:7
    #9 run lib/isc/task.c:1344:2

    Mutex M3 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

    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_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 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: lock-order-inversion (potential deadlock) in pthread_rwlock_rdlock

5 years agoAddress lock-order-inversion between the keytable and the db locks.
Mark Andrews [Fri, 4 Sep 2020 02:50:42 +0000 (12:50 +1000)] 
Address lock-order-inversion between the keytable and the db locks.

    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 dns_keytable_find lib/dns/keytable.c:522:2
    #3 sync_keyzone lib/dns/zone.c:4560:12
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 run lib/isc/task.c:1344:2

    Mutex M1 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_first lib/dns/rbtdb.c:9407:3
    #4 dns_dbiterator_first lib/dns/dbiterator.c:43:10
    #5 dns_rriterator_first lib/dns/rriterator.c:71:15
    #6 sync_keyzone lib/dns/zone.c:4543:16
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 run lib/isc/task.c:1344:2

    Mutex M1 acquired here while holding mutex M2 in thread T1:
    #0 pthread_rwlock_rdlock <null>
    #1 isc_rwlock_lock lib/isc/rwlock.c:48:3
    #2 zone_find lib/dns/rbtdb.c:4029:2
    #3 dns_db_find lib/dns/db.c:500:11
    #4 addifmissing lib/dns/zone.c:4481:11
    #5 dns_keytable_forall lib/dns/keytable.c:786:4
    #6 sync_keyzone lib/dns/zone.c:4586:2
    #7 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #8 mkey_refresh bin/named/server.c:15423:2
    #9 named_server_mkeys bin/named/server.c:15727:4
    #10 named_control_docommand bin/named/control.c:236:12
    #11 control_command bin/named/controlconf.c:365:17
    #12 dispatch lib/isc/task.c:1152:7
    #13 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 dns_keytable_forall lib/dns/keytable.c:770:2
    #3 sync_keyzone lib/dns/zone.c:4586:2
    #4 dns_zone_synckeyzone lib/dns/zone.c:4635:11
    #5 mkey_refresh bin/named/server.c:15423:2
    #6 named_server_mkeys bin/named/server.c:15727:4
    #7 named_control_docommand bin/named/control.c:236:12
    #8 control_command bin/named/controlconf.c:365:17
    #9 dispatch lib/isc/task.c:1152:7
    #10 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_rdlock

5 years agoMerge branch '2155-reference-leak-on-error-in-controlconf-c-control_respond' into...
Mark Andrews [Thu, 17 Sep 2020 07:00:33 +0000 (07:00 +0000)] 
Merge branch '2155-reference-leak-on-error-in-controlconf-c-control_respond' into 'main'

Resolve "reference leak on error in controlconf.c:control_respond"

Closes #2155

See merge request isc-projects/bind9!4135

5 years agocontrol_respond fails to detach from cmdhandle on error
Mark Andrews [Thu, 17 Sep 2020 05:52:19 +0000 (15:52 +1000)] 
control_respond fails to detach from cmdhandle on error

5 years agoMerge branch '2151-use-after-free-in-named' into 'main'
Mark Andrews [Thu, 17 Sep 2020 06:32:18 +0000 (06:32 +0000)] 
Merge branch '2151-use-after-free-in-named' into 'main'

Resolve "Use after free in named"

Closes #2151

See merge request isc-projects/bind9!4134

5 years agoCleanup connection before detaching
Mark Andrews [Thu, 17 Sep 2020 05:18:27 +0000 (15:18 +1000)] 
Cleanup connection before detaching

5 years agoMerge branch 'v9_17_5-release' into 'main'
Michał Kępień [Wed, 16 Sep 2020 20:46:53 +0000 (20:46 +0000)] 
Merge branch 'v9_17_5-release' into 'main'

Merge 9.17.5 release branch

See merge request isc-projects/bind9!4131

5 years agoSet up release notes for BIND 9.17.6
Michał Kępień [Wed, 16 Sep 2020 20:41:35 +0000 (22:41 +0200)] 
Set up release notes for BIND 9.17.6

5 years agoBump BIND_BASELINE_VERSION for ABI checks
Michał Kępień [Wed, 16 Sep 2020 20:41:35 +0000 (22:41 +0200)] 
Bump BIND_BASELINE_VERSION for ABI checks

5 years agoUpdate BIND version to 9.17.5
Michał Kępień [Fri, 4 Sep 2020 07:21:07 +0000 (09:21 +0200)] 
Update BIND version to 9.17.5

5 years agoAdd a CHANGES marker
Michał Kępień [Fri, 4 Sep 2020 07:21:07 +0000 (09:21 +0200)] 
Add a CHANGES marker

5 years agoUpdate library API versions
Michał Kępień [Fri, 4 Sep 2020 07:21:07 +0000 (09:21 +0200)] 
Update library API versions

5 years agoMerge branch 'michal/prepare-release-notes-for-bind-9.17.5' into 'v9_17_5-release'
Michał Kępień [Fri, 4 Sep 2020 05:49:50 +0000 (05:49 +0000)] 
Merge branch 'michal/prepare-release-notes-for-bind-9.17.5' into 'v9_17_5-release'

Prepare release notes for BIND 9.17.5

See merge request isc-private/bind9!208

5 years agoPrepare release notes for BIND 9.17.5
Michał Kępień [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Prepare release notes for BIND 9.17.5

5 years agoAdd release note for OSS-Fuzz fixes
Michał Kępień [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Add release note for OSS-Fuzz fixes

5 years agoAdd release note for GL #2074
Michał Kępień [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Add release note for GL #2074

5 years agoTweak and reword release notes
Michał Kępień [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Tweak and reword release notes

5 years agoTweak and reword recent CHANGES entries
Michał Kępień [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Tweak and reword recent CHANGES entries

5 years agoMiscellaneous formatting and wording tweaks
Michal Nowak [Thu, 3 Sep 2020 11:10:48 +0000 (13:10 +0200)] 
Miscellaneous formatting and wording tweaks

5 years agoMerge branch '2146-deprecate-the-glue-cache-option' into 'main'
Michał Kępień [Wed, 16 Sep 2020 09:19:15 +0000 (09:19 +0000)] 
Merge branch '2146-deprecate-the-glue-cache-option' into 'main'

Deprecate the "glue-cache" option

Closes #2146

See merge request isc-projects/bind9!4123

5 years agoAdd CHANGES for GL #2146
Michał Kępień [Wed, 16 Sep 2020 09:18:07 +0000 (11:18 +0200)] 
Add CHANGES for GL #2146

5 years agoAdd release note for #2146
Michał Kępień [Wed, 16 Sep 2020 09:18:07 +0000 (11:18 +0200)] 
Add release note for #2146

5 years agoDeprecate the "glue-cache" option
Michał Kępień [Wed, 16 Sep 2020 09:18:07 +0000 (11:18 +0200)] 
Deprecate the "glue-cache" option

No issues with the glue cache feature have been reported since its
introduction in BIND 9.12.  As the rationale for introducing the
"glue-cache" option was to have a safety switch readily available in
case the glue cache turns out to cause problems, it is time to deprecate
the option.  Glue cache will be permanently enabled in a future release,
at which point the "glue-cache" option will be made obsolete.

5 years agoMerge branch 'ondrej/fix-split-string-warnings-clang-12' into 'main'
Michał Kępień [Wed, 16 Sep 2020 09:13:00 +0000 (09:13 +0000)] 
Merge branch 'ondrej/fix-split-string-warnings-clang-12' into 'main'

Fix the clang 12 warnings with multi-line strings in string arrays

See merge request isc-projects/bind9!4130

5 years agoFix the clang 12 warnings with multi-line strings in string arrays
Ondřej Surý [Wed, 16 Sep 2020 08:33:01 +0000 (10:33 +0200)] 
Fix the clang 12 warnings with multi-line strings in string arrays

The clang 12 has a new warning that warns when using multi-line strings
in the string arrays, f.e.:

    { "aa",
      "b"
      "b",
      "cc" }

would generate warning like this:

    private_test.c:162:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "33333/RSASHA1" };
                                      ^
    private_test.c:161:7: note: place parentheses around the string literal to silence warning
                                      "Done removing signatures for key "
                                      ^
    private_test.c:197:7: error: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Werror,-Wstring-concatenation]
                                      "NSEC chain",
                                      ^
    private_test.c:196:7: note: place parentheses around the string literal to silence warning
                                      "Removing NSEC3 chain 1 0 30 DEAF / creating "
                                      ^
    2 errors generated.

5 years agoMerge branch 'each-copyright-header' into 'main'
Evan Hunt [Mon, 14 Sep 2020 23:46:38 +0000 (23:46 +0000)] 
Merge branch 'each-copyright-header' into 'main'

copyright header typos

See merge request isc-projects/bind9!4119

5 years agoupdate all copyright headers to eliminate the typo
Evan Hunt [Mon, 14 Sep 2020 23:20:40 +0000 (16:20 -0700)] 
update all copyright headers to eliminate the typo

5 years agofix a typo in copyright headers, and change "http" to "https"
Evan Hunt [Mon, 14 Sep 2020 23:19:37 +0000 (16:19 -0700)] 
fix a typo in copyright headers, and change "http" to "https"

5 years agoMerge branch '2145-minor-documentation-updates' into 'main'
Evan Hunt [Mon, 14 Sep 2020 23:13:31 +0000 (23:13 +0000)] 
Merge branch '2145-minor-documentation-updates' into 'main'

Resolve "Minor documentation updates"

Closes #2145

See merge request isc-projects/bind9!4118

5 years agoFix typos and change http to https
Suzanne Goldlust [Mon, 14 Sep 2020 21:04:19 +0000 (21:04 +0000)] 
Fix typos and change http to https

Fixed minor typographical errors and changed URLs from "http" to
"https" where appropriate.

5 years agoMerge branch '2142-write-after-free-in-unit-test-lib-ns-tests-query_test-c' into...
Mark Andrews [Mon, 14 Sep 2020 05:28:47 +0000 (05:28 +0000)] 
Merge branch '2142-write-after-free-in-unit-test-lib-ns-tests-query_test-c' into 'main'

Resolve "write after free in unit test lib/ns/tests/query_test.c"

Closes #2142

See merge request isc-projects/bind9!4116

5 years agoTSAN errors on unit tests should now be fatal
Mark Andrews [Mon, 14 Sep 2020 02:03:45 +0000 (12:03 +1000)] 
TSAN errors on unit tests should now be fatal

5 years agoclear pointer before subtracting reference
Mark Andrews [Mon, 14 Sep 2020 01:02:33 +0000 (11:02 +1000)] 
clear pointer before subtracting reference

5 years agoMerge branch '2122-netmgr-refcount-cleanup' into 'main'
Evan Hunt [Fri, 11 Sep 2020 20:16:28 +0000 (20:16 +0000)] 
Merge branch '2122-netmgr-refcount-cleanup' into 'main'

Resolve "clean up netmgr reference counting"

Closes #2122

See merge request isc-projects/bind9!4089

5 years agoCHANGES
Evan Hunt [Thu, 3 Sep 2020 22:44:33 +0000 (15:44 -0700)] 
CHANGES

5 years agotracing of active sockets and handles
Witold Kręcicki [Wed, 2 Sep 2020 15:57:44 +0000 (17:57 +0200)] 
tracing of active sockets and handles

If NETMGR_TRACE is defined, we now maintain a list of active sockets
in the netmgr object and a list of active handles in each socket
object; by walking the list and printing `backtrace` in a debugger
we can see where they were created, to assist in in debugging of
reference counting errors.

On shutdown, if netmgr finds there are still active sockets after
waiting, isc__nm_dump_active() will be called to log the list of
active sockets and their underlying handles, along with some details
about them.

5 years agolimit the time we wait for netmgr to be destroyed
Evan Hunt [Thu, 16 Jul 2020 00:57:58 +0000 (17:57 -0700)] 
limit the time we wait for netmgr to be destroyed

if more than 10 seconds pass while we wait for netmgr events to
finish running on shutdown, something is almost certainly wrong
and we should assert and crash.

5 years agoadd more logging to the shutdown system test
Evan Hunt [Thu, 16 Jul 2020 22:47:58 +0000 (15:47 -0700)] 
add more logging to the shutdown system test

the test server running in shutdown/resolver was not logging
any debug info, which made it difficult to diagnose test failures.

5 years agoproperly lock the setting/unsetting of callbacks in isc_nmsocket_t
Ondřej Surý [Fri, 11 Sep 2020 08:53:31 +0000 (10:53 +0200)] 
properly lock the setting/unsetting of callbacks in isc_nmsocket_t

changes to socket callback functions were not thread safe.

5 years agochange from isc_nmhandle_ref/unref to isc_nmhandle attach/detach
Evan Hunt [Thu, 3 Sep 2020 20:31:27 +0000 (13:31 -0700)] 
change from isc_nmhandle_ref/unref to isc_nmhandle attach/detach

Attaching and detaching handle pointers will make it easier to
determine where and why reference counting errors have occurred.

A handle needs to be referenced more than once when multiple
asynchronous operations are in flight, so callers must now maintain
multiple handle pointers for each pending operation. For example,
ns_client objects now contain:

        - reqhandle:    held while waiting for a request callback (query,
                        notify, update)
        - sendhandle:   held while waiting for a send callback
        - fetchhandle:  held while waiting for a recursive fetch to
                        complete
        - updatehandle: held while waiting for an update-forwarding
                        task to complete

control channel connection objects now contain:

        - readhandle: held while waiting for a read callback
        - sendhandle: held while waiting for a send callback
        - cmdhandle:  held while an rndc command is running

httpd connections contain:

        - readhandle: held while waiting for a read callback
        - sendhandle: held while waiting for a send callback

5 years agofix LD_WRAP test in configure
Evan Hunt [Sat, 5 Sep 2020 19:10:35 +0000 (12:10 -0700)] 
fix LD_WRAP test in configure

The LD_WRAP test in configure was broken, and failed to
indicate LD_WRAP support correctly, resulting in some unit
tests failing to run.

5 years agoassorted small netmgr-related changes
Witold Kręcicki [Wed, 10 Jun 2020 09:32:39 +0000 (11:32 +0200)] 
assorted small netmgr-related changes

- rename isc_nmsocket_t->tcphandle to statichandle
- cancelread functions now take handles instead of sockets
- add a 'client' flag in socket objects, currently unused, to
  indicate whether it is to be used as a client or server socket

5 years agoMerge branch '2119-the-runtime-system-tests-interfered-with-each-other' into 'main'
Mark Andrews [Thu, 10 Sep 2020 09:58:36 +0000 (09:58 +0000)] 
Merge branch '2119-the-runtime-system-tests-interfered-with-each-other' into 'main'

Resolve "The runtime system tests interfered with each other"

Closes #2119

See merge request isc-projects/bind9!4080

5 years agoWait for test instance of named to exit before completing subtest.
Mark Andrews [Mon, 31 Aug 2020 03:54:12 +0000 (13:54 +1000)] 
Wait for test instance of named to exit before completing subtest.

5 years agoDon't use production address (127.0.0.1) in runtime system test.
Mark Andrews [Mon, 31 Aug 2020 03:51:47 +0000 (13:51 +1000)] 
Don't use production address (127.0.0.1) in runtime system test.

5 years agoMerge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading...
Mark Andrews [Thu, 10 Sep 2020 08:45:17 +0000 (08:45 +0000)] 
Merge branch '2116-views-system-test-was-not-waiting-for-example-to-finish-loading' into 'main'

Resolve "Views system test was not waiting for example to finish loading."

Closes #2116

See merge request isc-projects/bind9!4078

5 years agoAlso wait for 'zone_dump: zone example/IN: enter'
Mark Andrews [Mon, 31 Aug 2020 11:09:25 +0000 (21:09 +1000)] 
Also wait for 'zone_dump: zone example/IN: enter'

use nextpartpeek as we don't want to reset the starting point

5 years agoMerge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull' into 'main'
Mark Andrews [Wed, 9 Sep 2020 21:51:49 +0000 (21:51 +0000)] 
Merge branch '2114-cid-306652-null-pointer-dereferences-reverse_inull' into 'main'

Resolve "CID 306652:  Null pointer dereferences  (REVERSE_INULL)"

Closes #2114

See merge request isc-projects/bind9!4099

5 years agoSilence REVERSE_INULL warning (CID 306652)
Mark Andrews [Wed, 9 Sep 2020 00:40:14 +0000 (10:40 +1000)] 
Silence REVERSE_INULL warning (CID 306652)

5 years agoMerge branch 'each-fix-packet' into 'main'
Evan Hunt [Wed, 9 Sep 2020 19:27:47 +0000 (19:27 +0000)] 
Merge branch 'each-fix-packet' into 'main'

work around perl error

See merge request isc-projects/bind9!4093

5 years agowork around perl error
Evan Hunt [Sat, 5 Sep 2020 07:21:42 +0000 (00:21 -0700)] 
work around perl error

some versions of perl failed to run packet.pl because the 'last'
keyword can't be used outside of a loop block. this commit changes
the packet dumping code to a function so we can use 'return' instead.

5 years agoMerge branch '2090-main-dig-tsan-error' into 'main'
Mark Andrews [Wed, 9 Sep 2020 05:24:08 +0000 (05:24 +0000)] 
Merge branch '2090-main-dig-tsan-error' into 'main'

Resolve "main dig tsan error"

Closes #2090

See merge request isc-projects/bind9!4100

5 years agoTurn off TSAN for isc_log_wouldlog
Mark Andrews [Mon, 31 Aug 2020 12:41:46 +0000 (22:41 +1000)] 
Turn off TSAN for isc_log_wouldlog

5 years agomake all artifacts visible
Mark Andrews [Mon, 31 Aug 2020 02:37:24 +0000 (12:37 +1000)] 
make all artifacts visible

5 years agoOnly test node->data if we care about whether data is present or not.
Mark Andrews [Wed, 26 Aug 2020 06:24:13 +0000 (16:24 +1000)] 
Only test node->data if we care about whether data is present or not.

WARNING: ThreadSanitizer: data race (pid=28788)
  Write of size 8 at 0x7b200002e060 by thread T1 (mutexes: write M2947):
    #0 add32 /builds/isc-projects/bind9/lib/dns/rbtdb.c:6638:18 (libdns.so.1110+0xe7843)
    #1 addrdataset /builds/isc-projects/bind9/lib/dns/rbtdb.c:6975:12 (libdns.so.1110+0xe4185)
    #2 dns_db_addrdataset /builds/isc-projects/bind9/lib/dns/db.c:783:10 (libdns.so.1110+0x650ee)
    #3 validated /builds/isc-projects/bind9/lib/dns/resolver.c:5140:11 (libdns.so.1110+0x1909f7)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)

  Previous read of size 8 at 0x7b200002e060 by thread T5 (mutexes: write M521146194917735760):
    #0 dns_rbt_findnode /builds/isc-projects/bind9/lib/dns/rbt.c:1708:9 (libdns.so.1110+0xd910d)
    #1 cache_find /builds/isc-projects/bind9/lib/dns/rbtdb.c:5098:11 (libdns.so.1110+0xe188e)
    #2 dns_db_find /builds/isc-projects/bind9/lib/dns/db.c:554:11 (libdns.so.1110+0x642bb)
    #3 dns_view_find2 /builds/isc-projects/bind9/lib/dns/view.c:1068:11 (libdns.so.1110+0x1cc2c4)
    #4 dbfind_name /builds/isc-projects/bind9/lib/dns/adb.c:3714:11 (libdns.so.1110+0x46a4b)
    #5 dns_adb_createfind2 /builds/isc-projects/bind9/lib/dns/adb.c:3133:12 (libdns.so.1110+0x45278)
    #6 findname /builds/isc-projects/bind9/lib/dns/resolver.c:3166:11 (libdns.so.1110+0x1827f0)
    #7 fctx_getaddresses /builds/isc-projects/bind9/lib/dns/resolver.c:3462:3 (libdns.so.1110+0x18032d)
    #8 fctx_try /builds/isc-projects/bind9/lib/dns/resolver.c:3819:12 (libdns.so.1110+0x17e174)
    #9 fctx_start /builds/isc-projects/bind9/lib/dns/resolver.c:4219:4 (libdns.so.1110+0x1787a3)
    #10 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507f5)
    #11 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d749)

5 years agoAddress lock-order-inversion
Mark Andrews [Mon, 24 Aug 2020 03:35:41 +0000 (13:35 +1000)] 
Address lock-order-inversion

WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=12714)
  Cycle in lock order graph: M100252 (0x7b7c00010a08) => M1171 (0x7b7400000dc8) => M100252

  Mutex M1171 acquired here while holding mutex M100252 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9585:2 (libdns.so.1110+0x1769fd)
    #2 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #3 create_fetch /builds/isc-projects/bind9/lib/dns/validator.c:1156:10 (libdns.so.1110+0x1c1e5f)
    #4 validatezonekey /builds/isc-projects/bind9/lib/dns/validator.c:2124:13 (libdns.so.1110+0x1c3b6d)
    #5 start_positive_validation /builds/isc-projects/bind9/lib/dns/validator.c:2301:10 (libdns.so.1110+0x1bfde9)
    #6 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3647:12 (libdns.so.1110+0x1bef62)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validator_start /builds/isc-projects/bind9/lib/dns/validator.c:3628:2 (libdns.so.1110+0x1bee31)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M100252 acquired here while holding mutex M1171 in thread T1:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 dns_validator_destroy /builds/isc-projects/bind9/lib/dns/validator.c:3912:2 (libdns.so.1110+0x1bf788)
    #2 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4916:2 (libdns.so.1110+0x18fdfd)
    #3 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #4 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1171 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (delv+0x4483a6)
    #1 validated /builds/isc-projects/bind9/lib/dns/resolver.c:4907:2 (libdns.so.1110+0x18fc3d)
    #2 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #3 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T1 'isc-worker0000' (tid=12729, running) created by main thread at:
    #0 pthread_create <null> (delv+0x42afdb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_createinctx /builds/isc-projects/bind9/lib/isc/task.c:2091:11 (libisc.so.1107+0x4f4ac)
    #4 main /builds/isc-projects/bind9/bin/delv/delv.c:1639:2 (delv+0x4b7f96)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/delv/.libs/delv+0x4483a6) in pthread_mutex_lock

5 years agoAddress lock-order-inversion
Mark Andrews [Mon, 24 Aug 2020 01:44:09 +0000 (11:44 +1000)] 
Address lock-order-inversion

Obtain references to view->redirect and view->managed_keys then
release view->lock so dns_zone_setviewcommit and dns_zone_setviewrevert
can obtain the view->lock while holding zone->lock.

WARNING: ThreadSanitizer: lock-order-inversion (potential deadlock) (pid=9132)
  Cycle in lock order graph: M987831431424375936 (0x000000000000) => M1012319771577875480 (0x000000000000) => M987831431424375936

  Mutex M1012319771577875480 acquired here while holding mutex M987831431424375936 in thread T2:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_zone_setviewcommit /builds/isc-projects/bind9/lib/dns/zone.c:1571:2 (libdns.so.1110+0x1d74eb)
    #2 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2388:3 (libdns.so.1110+0x1cfe29)
    #3 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #4 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #5 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #6 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #7 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #8 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #9 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_setviewcommit /builds/isc-projects/bind9/lib/dns/view.c:2382:2 (libdns.so.1110+0x1cfde7)
    #2 load_configuration /builds/isc-projects/bind9/bin/named/./server.c:8188:3 (named+0x51eadd)
    #3 loadconfig /builds/isc-projects/bind9/bin/named/./server.c:9438:11 (named+0x510c66)
    #4 ns_server_reconfigcommand /builds/isc-projects/bind9/bin/named/./server.c:9773:2 (named+0x510b41)
    #5 ns_control_docommand /builds/isc-projects/bind9/bin/named/control.c:243:12 (named+0x4e451a)
    #6 control_recvmessage /builds/isc-projects/bind9/bin/named/controlconf.c:465:13 (named+0x4e9056)
    #7 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #8 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M987831431424375936 acquired here while holding mutex M1012319771577875480 in thread T7:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 dns_view_findzonecut2 /builds/isc-projects/bind9/lib/dns/view.c:1300:2 (libdns.so.1110+0x1cc93a)
    #2 dns_view_findzonecut /builds/isc-projects/bind9/lib/dns/view.c:1261:9 (libdns.so.1110+0x1cc864)
    #3 fctx_create /builds/isc-projects/bind9/lib/dns/resolver.c:4459:13 (libdns.so.1110+0x1779d3)
    #4 dns_resolver_createfetch3 /builds/isc-projects/bind9/lib/dns/resolver.c:9628:12 (libdns.so.1110+0x176cb6)
    #5 dns_resolver_createfetch /builds/isc-projects/bind9/lib/dns/resolver.c:9504:10 (libdns.so.1110+0x174e17)
    #6 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:10061:12 (libdns.so.1110+0x2055a5)
    #7 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #8 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #9 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #10 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Mutex M1012319771577875480 previously acquired by the same thread here:
    #0 pthread_mutex_lock <null> (named+0x4642a6)
    #1 zone_refreshkeys /builds/isc-projects/bind9/lib/dns/zone.c:9951:2 (libdns.so.1110+0x204dc3)
    #2 zone_maintenance /builds/isc-projects/bind9/lib/dns/zone.c:10274:5 (libdns.so.1110+0x203a78)
    #3 zone_timer /builds/isc-projects/bind9/lib/dns/zone.c:13106:2 (libdns.so.1110+0x1e815a)
    #4 dispatch /builds/isc-projects/bind9/lib/isc/task.c:1157:7 (libisc.so.1107+0x507d5)
    #5 run /builds/isc-projects/bind9/lib/isc/task.c:1331:2 (libisc.so.1107+0x4d729)

  Thread T2 'isc-worker0001' (tid=9163, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

  Thread T7 'isc-worker0006' (tid=9168, running) created by main thread at:
    #0 pthread_create <null> (named+0x446edb)
    #1 isc_thread_create /builds/isc-projects/bind9/lib/isc/pthreads/thread.c:60:8 (libisc.so.1107+0x726d8)
    #2 isc__taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:1468:7 (libisc.so.1107+0x4d635)
    #3 isc_taskmgr_create /builds/isc-projects/bind9/lib/isc/task.c:2109:11 (libisc.so.1107+0x4f587)
    #4 create_managers /builds/isc-projects/bind9/bin/named/./main.c:886:11 (named+0x4f1a97)
    #5 setup /builds/isc-projects/bind9/bin/named/./main.c:1305:11 (named+0x4f05ee)
    #6 main /builds/isc-projects/bind9/bin/named/./main.c:1556:2 (named+0x4ef12d)

SUMMARY: ThreadSanitizer: lock-order-inversion (potential deadlock) (/builds/isc-projects/bind9/bin/named/.libs/named+0x4642a6) in pthread_mutex_lock

5 years agoisc_mutex_init_errcheck prototype should not be under ISC_MUTEX_PROFILE
Mark Andrews [Sat, 22 Aug 2020 00:22:47 +0000 (10:22 +1000)] 
isc_mutex_init_errcheck prototype should not be under ISC_MUTEX_PROFILE