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

Assert failure with QRegion: extents.intersects(rect)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 4.8.5, 5.1.0 RC1
    • 4.8.4
    • GUI: Painting
    • None
    • Windows 7 32bit
    • a298216bb4383dbe96688dfb80da0cd875766de0 (5.1) 69ee30260a667b2b977a0d4b52abf6537521cce8 (5.1) e7ac2a9bba2925149bac6dda0f391275997abada (4.8) 0daeee468ccc76dfb957892050b4c11d4807e2d3 (4.8)

    Description

      Updating widgets on 32-bit system fails when rectangles are positioned to the edge of integer (INT_MIN, INT_MAX).

      ASSERT: "extents.intersects(rect)" in file painting\qregion.cpp, line 1255

      The attached application can be used to reproduce the issue. There the failure is illustrated by calling the update() method with valid rectangles.

      void MainWindow::onUpdateAction()
      { 
          {
              QRect r(ui->pushButton->rect());
              r.setLeft(-2147483648);
              r.setWidth(1);
              ui->pushButton->update(r);
      	}
          {
              QRect r(ui->pushButton->rect());
              r.setLeft(1395387);
              r.setWidth(1);
              ui->pushButton->update(r);
          }
      }
      

      It looks like in ‘QRegion QRegion::intersect(const QRect &r) const’ the ‘result.d->qt_rgn’ rectangle is not constructed correctly (it’s width is over INT_MIN).

      Attached also stack trace of the crash.

      Attachments

        1. updatebug.zip
          2 kB
        2. assertfailure.txt
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            rodal Samuel Rødal
            qtcomsupport Qt Support
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes