Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.4.1, 6.4.2, 6.5
-
macOS 13.1 on 2019 MacBook Pro 16" (AMD Radeon Pro 5500M) building with Xcode 14.2
-
-
2305f8af9 (dev), 51b591642 (6.5), 2f4b30ee0 (6.4), 6451fdffc (tqtc/lts-6.2)
Description
When using a QQuickWidget (at least on macOS, unknown Windows), during window resize can trigger a crash due to the composited window buffer being deallocated whilst uploading to the GPU is still in flight. The Metal validation layer outputs
-[MTLDebugDevice notifyExternalReferencesNonZeroOnDealloc:]:2885: failed assertion `The following Metal object is being destroyed while still required to be alive by the command buffer 0x7fb5328a5200 (label: <no label set>):
<MTLToolsObject: 0x60000140d500> -> <GFXAAMD_MtlBuffer: 0x7fb5314413c0>
label = <none>
length = 20401152
cpuCacheMode = MTLCPUCacheModeDefaultCache
storageMode = MTLStorageModeShared
hazardTrackingMode = MTLHazardTrackingModeTracked
resourceOptions = MTLResourceCPUCacheModeDefaultCache MTLResourceStorageModeShared MTLResourceHazardTrackingModeTracked
purgeableState = MTLPurgeableStateNonVolatile'
This is more easily reproduced with heavier interfaces (we can reproduce with a ~1700 line UI file) by rapidly resizing for a few seconds. Reducing the complexity makes it more difficult but not impossible to reproduce, suggesting a timing issue where the runtime is not waiting the required amount of time (for example, by not correctly calling [MTLCommandBuffer waitUntilCompleted], or not synchronizing MTLSharedEvent before releasing the resource) for an upload to complete before freeing the resource.
Attachments
Issue Links
- blocks
-
QTBUG-108226 quickwidget example crash in QAccessibleQuickWindow / QMacAccessibilityElement
- In Progress