Ken Giusti created DISPATCH-2129:
------------------------------------

             Summary: shutdown race accessing core->running flag
                 Key: DISPATCH-2129
                 URL: https://issues.apache.org/jira/browse/DISPATCH-2129
             Project: Qpid Dispatch
          Issue Type: Bug
          Components: Router Node
    Affects Versions: 1.16.0
            Reporter: Ken Giusti
            Assignee: Michael Goulish
             Fix For: 1.17.0


Low priority, but nice to clean up so we can remove the suppression for 
qdr_core_free.

The core->running flag is set false by the main thread during shutdown.  The 
flag is checked by the core thread as an indication that the core thread should 
exit its main loop.

A non-racy approach would be to instead have the main thread queue an action to 
the core thread to cause it to exit the main loop (by setting the core->running 
flag to false).

 

65: ================== 
65: WARNING: ThreadSanitizer: data race (pid=613021) 
65: Write of size 1 at 0x7b6400035220 by main thread: 
65: #0 qdr_core_free 
/home/kgiusti/work/dispatch/qpid-dispatch/src/router_core/router_core.c:140 
(libqpid-dispatch.so+0xf0484) 
65: #1 qd_router_free 
/home/kgiusti/work/dispatch/qpid-dispatch/src/router_node.c:2160 
(libqpid-dispatch.so+0x12870e) 
65: #2 qd_dispatch_free 
/home/kgiusti/work/dispatch/qpid-dispatch/src/dispatch.c:375 
(libqpid-dispatch.so+0x81dfd) 
65: #3 main_process 
/home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:119 
(qdrouterd+0x402750) 
65: #4 main /home/kgiusti/work/dispatch/qpid-dispatch/router/src/main.c:369 
(qdrouterd+0x403557) 
65: 
65: Previous read of size 1 at 0x7b6400035220 by thread T1: 
65: #0 router_core_thread 
/home/kgiusti/work/dispatch/qpid-dispatch/src/router_core/router_core_thread.c:210
 (libqpid-dispatch.so+0xfb416) 
65: #1 _thread_init 
/home/kgiusti/work/dispatch/qpid-dispatch/src/posix/threading.c:172 
(libqpid-dispatch.so+0xad37a) 
65: #2 <null> <null> (libtsan.so.0+0x2d33f)



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to