Uploaded image for project: 'Qpid Dispatch'
  1. Qpid Dispatch
  2. DISPATCH-2129

shutdown race accessing core->running flag

    XMLWordPrintableJSON

Details

    Description

      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: 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)
      

      Attachments

        Issue Links

          Activity

            People

              mgoulish Michael Goulish
              kgiusti Ken Giusti
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: