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

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 4.8.0, 5.0.0
    • Core: Threads
    • None
    • 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

        For Gerrit Dashboard: QTBUG-24795
        # Subject Branch Project Status CR V

        Activity

          People

            Unassigned Unassigned
            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