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

QTest's signal dumper is not thread-safe and may assert

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • 6.5.4, 6.6.1, 6.7
    • 6.3
    • Testing: qtestlib
    • None
    • All
    • ae0d231c96ab93ec36c7202c268507314eb40116 744e9a69ab4965561529f66d8872b6c2455f4fca

    Description

      QTest's best feature (the signal dumper `-vs`) is a little broken.

      In qtbase\src\testlib\qsignaldumper.cpp there're statics (iLevel, ignoreLevel). They are not synchronized and may be accessed from any thread. iLevel indicates the indentation and may turn negative if a thread reads a 0 before decrementing! It also creates a total mess of the output even if this variable is made atomic.

      Should it be a thread_local? For a BlockingQueued emission it would logically make sense to keep the indentation level across threads.

      Attachments

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

        Activity

          People

            manordheim Mårten Nordheim
            manordheim Mårten Nordheim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes