]> git.ipfire.org Git - thirdparty/bind9.git/commit
Complete the isc_nmhandle_detach() in the worker thread.
authorMark Andrews <marka@isc.org>
Mon, 12 Oct 2020 06:51:09 +0000 (17:51 +1100)
committerMark Andrews <marka@isc.org>
Thu, 15 Oct 2020 00:03:47 +0000 (11:03 +1100)
commitda0a7a34ec3cfd7366c5b2b17a9c60059189c089
tree76fcb44f1fd277ca881020735fe58344ca42465a
parent51a130364646317e83a5e0177e345052c95a5c33
Complete the isc_nmhandle_detach() in the worker thread.

isc_nmhandle_detach() needs to complete in the same thread
as shutdown_walk_cb() to avoid a race.  Clear the caller's
pointer then pass control to the worker if necessary.

    WARNING: ThreadSanitizer: data race
    Write of size 8 at 0x000000000001 by thread T1:
    #0 isc_nmhandle_detach lib/isc/netmgr/netmgr.c:1258:15
    #1 control_command bin/named/controlconf.c:388:3
    #2 dispatch lib/isc/task.c:1152:7
    #3 run lib/isc/task.c:1344:2

    Previous read of size 8 at 0x000000000001 by thread T2:
    #0 isc_nm_pauseread lib/isc/netmgr/netmgr.c:1449:33
    #1 recv_data lib/isccc/ccmsg.c:109:2
    #2 isc__nm_tcp_shutdown lib/isc/netmgr/tcp.c:1157:4
    #3 shutdown_walk_cb lib/isc/netmgr/netmgr.c:1515:3
    #4 uv_walk <null>
    #5 process_queue lib/isc/netmgr/netmgr.c:659:4
    #6 process_normal_queue lib/isc/netmgr/netmgr.c:582:10
    #7 process_queues lib/isc/netmgr/netmgr.c:590:8
    #8 async_cb lib/isc/netmgr/netmgr.c:548:2
    #9 <null> <null>

(cherry picked from commit f95ba8aa2071fa72e3730eeb8ee78ef9454ffa5b)
lib/isc/netmgr/netmgr-int.h
lib/isc/netmgr/netmgr.c