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

QColorDialog crash on macOS 11 and 12 with failed assertion

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.2, 6.5, 6.6
    • None
    • macOS 11 or macOS 12
    • macOS

    Description

      Our application started experiencing crashes in QColorDialog::getColor after switching from Qt 5.15 to Qt 6.2.

      The crash shows an assertion failure in macOS code: "Assertion failed: (backingScaleFactor > 0.f), function drawnFocusRingBitmapForTime, file NSAutomaticFocusRing.m, line 346."

      Initially I wrote this off as a macOS bug, because partially it is. But further testing showed that it was not present in Qt 5.15.

      I'm attaching a very basic sample application that can reproduce the issue, as well as a crash dump file.

      Steps to reproduce:

      1. Be running macOS 11 or 12
      2. Build the sample application against Qt 6.2 or newer
      3. Press the 'Color' button to open the color dialog.
      4. If the saved swatch area has any saved samples, delete those, quit the application, and relaunch it.
      5. Adjust a color.
      6. Drag the color swatch (on the bottom left) into one of the saved sample areas.
      7. The program abruptly terminates.

      The issue was introduced with this change:

      https://code.qt.io/cgit/qt/qtbase.git/commit/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm?id=6430d1db636962ed25dd1c14a2d7ae548bafb948

      Reverting that change fixes the issue.

      Attachments

        1. ColorChoosa-2023-09-06-083404.ips
          27 kB
          Dyami Caliri
        2. ColorChoosa.zip
          5 kB
          Dyami Caliri
        3. color_dlg_crash.png
          213 kB
          Dyami Caliri
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tpochep Timur Pocheptsov
            dzedsystems Dyami Caliri
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes