https://bugs.kde.org/show_bug.cgi?id=528842

            Bug ID: 528842
           Summary: Crash on macOS 27 when a busy/wait cursor is shown
                    (CGImageCreate from QImage::toCGImage)
    Classification: Applications
           Product: digikam
      Version First 9.1.0
       Reported In:
          Platform: macOS (DMG)
                OS: macOS
            Status: REPORTED
          Severity: crash
          Priority: NOR
         Component: Bundle-MacOS
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

Created attachment 198461
  --> https://bugs.kde.org/attachment.cgi?id=198461&action=edit
macOS crash report

DESCRIPTION
digiKam 9.1.0 from the official DMG on macOS 27.2, Apple Silicon. The app quits
as soon as a busy or wait cursor appears, for example when opening the image
editor or Settings.

The crash report shows it happening in CGImageCreate, called from
QImage::toCGImage(), under QWidget::setCursor. Qt's built-in cursor images
(spincursor.png, waitcursor.png, sizeallcursor.png) inside the bundled
libqcocoa.dylib contain embedded ICC colour profiles. Qt passes the colour
space it builds from them straight to macOS without checking it.

STEPS TO REPRODUCE
1. Start digiKam 9.1.0 on macOS 27.2.
2. Open any image in the Image Editor, or open Settings > Configure digiKam.
3. The app shows the busy cursor and quits.

OBSERVED RESULT
digiKam crashes immediately (EXC_BREAKPOINT / SIGTRAP). Crashing thread:

CoreFoundation  CFGetTypeID
CoreGraphics    CGColorSpaceGetType
CoreGraphics    CGImageCreate
QtGui           QImage::toCGImage() const
libqcocoa.dylib (cursor creation)
QtGui           QWindowPrivate::applyCursor()
QtWidgets       QWidget::setCursor(QCursor const&)
libdigikamcore  Digikam::EditorWindow::slotPrepareToLoad()

Three crashes in a row had the same stack (also seen via
Digikam::MetadataPanel::slotTabChanged when opening Settings).

EXPECTED RESULT
The Image Editor and Settings open normally.

SOFTWARE/OS VERSIONS
Operating System: macOS 27.2 (26B123), Apple Silicon
KDE Plasma Version: n/a (macOS)
KDE Frameworks Version: 6.26.0 (bundled)
Qt Version: 6.11.0 (bundled)

ADDITIONAL INFORMATION
Workaround that fixed it for me: in
digikam.app/Contents/libexec/qt6/plugins/platforms/libqcocoa.dylib, I renamed
the iCCP chunk in each of the three cursor PNGs to an unknown ancillary chunk
(same length, CRC updated) so Qt ignores the profile, then re-signed the app
ad-hoc. No crashes since.

Note if anyone tries this: don't leave a backup copy of libqcocoa.dylib in
plugins/platforms/. Qt loads it too and the crash comes back.

Possible fix for the bundle: strip the ICC profiles from those cursor PNGs, or
patch QImage::toCGImage() to fall back to sRGB when
CGColorSpaceCreateWithICCData returns NULL. I'll also report this upstream to
Qt.

Attached: macOS crash report (.ips).

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to