Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-97604

UB in qSet/qhash causing corruption of sets in optimized multithreaded code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.15.6
    • Fix Version/s: None
    • Labels:
      None

      Description

      I don't currently have a minimal testcase for this as it is incredibly involved and modification of the function body (but not necessarily the behavior) can cause the bug to appear or disappear.
      Symptoms of this bug have been present in our code base for years.

      It seems to occur at gcc O2 or above with certain templated or inlined functions that modify implicitly shared qSets. Specifically, when implicitly shared qSets are modified from multiple threads by such functions.

      The observed corruption is contained items in the wrong qhash buckets. This causes iteration to correctly reveal all elements, but lookups via contains or findNode to fail. Subsequently unite or subtract set operations which rely on these lookups also fail or further corrupt the container.

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            manordheim MÃ¥rten Nordheim
            Reporter:
            ablackle Andrew Blackledge
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes