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

Regression: QMutex: tryLock could fail because of buggy wait function in qmutex_unix.cpp

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Duplicate
    • Affects Version/s: 4.8.0, 5.0.0
    • Fix Version/s: None
    • Component/s: Core: Threads
    • Labels:
      None
    • Environment:
      32 bit x86 Linux Qt 4.8

      Description

      Line 119 is buggy:
      http://qt.gitorious.org/qt/qt/blobs/4.8/src/corelib/thread/qmutex_unix.cpp

      timeout is of type int, so in the most cases a qint32.

      The calculation "qint64 xtimeout = timeout * 1000 * 1000;" will result in an overflow, it timeout is bigger then 2148.

      The solution would be to cast timeout to a qint64 before multiplication.

        Attachments

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

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              maggu2810 Markus Rathgeb
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes