Details
-
Bug
-
Resolution: Fixed
-
P1: Critical
-
None
-
5.15.13
-
XCode 14.3, iOS 16.4 SDK, iPad Air 5th Gen running iOS 16.1.1
Description
Code
CameraView.qml
import QtQuick 2.15 import QtQuick.Controls 2.15 import QtMultimedia 5.15 Rectangle { color: "black" VideoOutput { id: viewfinder anchors.fill: parent fillMode: VideoOutput.PreserveAspectFit source: camera autoOrientation: true } Camera { id: camera deviceId: QtMultimedia.availableCameras.length > 0 ? QtMultimedia.availableCameras[0].deviceId : "" captureMode: Camera.CaptureStillImage cameraState: Camera.UnloadedState } // The presence of this BusyIndicator seems to increase crash frequency BusyIndicator { id: busy anchors.centerIn: parent width: 60 height: 60 } function startCamera() { if (QtMultimedia.availableCameras.length > 0) camera.start() else console.log("No cameras available!") } function stopCamera() { camera.stop() } }
main.qml
import QtQuick 2.15 import QtQuick.Controls 2.15 ApplicationWindow { width: 800 height: 480 visible: true property int iterationsRemaining: 0 property bool testRunning: iterationsRemaining > 0 Button { anchors.centerIn: parent enabled: !testRunning text: "Start Test" onClicked: { iterationsRemaining = 50 startTimer.start() } } Loader { id: camLoader anchors.fill: parent source: "CameraView.qml" active: false } Timer { id: startTimer repeat: iterationsRemaining > 0 interval: 2000 running: false triggeredOnStart: true onTriggered: { --iterationsRemaining console.log("Test iterations remaining:", iterationsRemaining) camLoader.active = true camLoader.item.startCamera() stopTimer.start() } } Timer { id: stopTimer repeat: false interval: 500 running: false onTriggered: { camLoader.item.stopCamera() camLoader.active = false } } }
Steps to reproduce
- Build and run the attached project on a physical iOS device
- Tap "Start Test" and wait for the crash (give camera permissions when asked)
- If it doesn't crash within 50 iterations, close + restart the app and tap "Start Test" again
Notes
- The number of iterations required to trigger the crash is variable
- For some reason, adding the BusyIndicator seems to increase crash frequency
- This does not seem to affect iOS 15 and earlier
Attachments
For Gerrit Dashboard: QTBUG-112844 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
473354,6 | camerarenderercontrol: do no crash on deleted renderer | tqtc/lts-5.15 | qt/tqtc-qtmultimedia | Status: NEW | +2 | 0 |