QCAD Pro 3.32.9 random crashes on macOS 26 Tahoe - Qt 6.11.1 regression QTBUG-147602 (cursor / QImage::toCGImage)

QCAD Version: 3.32.9 Professional (official package)

Downloaded package (file name): qcad-3.32.9-pro-macos-12.7-26-qt6-arm64.dmg (bundled Qt 6.11.1)

Operating System: macOS 26.5.2 (Tahoe), Mac mini M4, dual 6K displays (6016x3384 + 5760x3240)

Not drawing-specific - it happens with any drawing open.

I proceed like this:

QCAD quits unexpectedly at random moments while working, often when the mouse passes over a toolbar. The macOS crash report shows an EXC_BREAKPOINT (SIGTRAP) on the main thread while Qt converts a mouse cursor image:

QToolBar::event
    -> QWidget::setCursor
    -> QWindowPrivate::setCursor
    -> libqcocoa
    -> QImage::toCGImage()
    -> CGImageCreate
    -> verify_image_parameters
    -> valid_image_colorspace
    -> CGColorSpaceGetType
    -> CFGetTypeID -> __CF_IS_OBJC   (invalid/stale CGColorSpaceRef)

This matches Qt upstream bug QTBUG-147602 line by line (Jira): a Qt 6.11.0/6.11.1 regression where qt_mac_cgImageFormatForImage() returns a raw CGColorSpaceRef whose owner goes out of scope before CGImageCreate() uses it (use-after-free). It was not present in Qt 6.10.2 and is marked Fixed for Qt 6.11.2 / 6.12 Beta2.

As a workaround I enabled “Use system cursors” (GraphicsView/SystemCursors=true), which avoids most QImage::toCGImage calls, but the Qt::SizeAllCursor set by QToolBar drag handles still seems to go through the same path, so occasional crashes may remain.

Would it be possible to rebuild the macOS packages with Qt >= 6.11.2 once it is released (or fall back to Qt 6.10.x / 6.8 LTS in the meantime)?

I can provide the full .ips crash report if useful.

Thanks for the great software!
Pietro

Many thanks for your detailed report. Yes, we will have to revert to 6.10 for macOS for the time being. We will likely issue a re-release of QCAD 3.32.9 for macOS with Qt 6.10 shortly (before the next scheduled update). I’ll keep you posted.

The QCAD 3.32.9 re-release with Qt 6.10 is now available from your download area. Please let us know if you still experience problems.