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

Alloc_pool_item_t sequence number should be atomic

    XMLWordPrintableJSON

    Details

    • Type: Test
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 1.16.1
    • Fix Version/s: None
    • Component/s: Router Node
    • Labels:
      None

      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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chug Charles E. Rolke
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated: