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

Alloc_pool_item_t sequence number should be atomic

    XMLWordPrintableJSON

Details

    • Test
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 1.16.1, 1.18.0
    • None
    • Router Node

    Description

      Alloc pool uses a sequence number for safe pointer dereferencing.

      Definition
        Line 55: uintmax_t sequence;  // uintmax_t ensures proper alignment of following data
      In qd_alloc:
        Line 406: item->sequence = 0;
      in qd_dealloc:
        Line 477: item->sequence++;
      In qd_alloc_sequence:
        Line 525: reuturn item->sequence;
      

      It is reasonably certain that multiple threads will be referencing the same item at nearly the same time. The code as shown gets flagged by tsan.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              chug Charles E. Rolke
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: