Crash in [@ java.lang.IllegalArgumentException: at android.hardware.camera2.CaptureRequest.convertSurfaceToStreamId(CaptureRequest.java)]
Categories
(Firefox for Android :: Search, defect)
Tracking
()
People
(Reporter: aryx, Assigned: harrisono)
References
Details
(Keywords: crash, Whiteboard: [fxdroid][android-activation-trust])
Crash Data
Attachments
(3 external files, 2 obsolete files)
See bug 2054232 for previous instance.
Crashes on Android 17, increased volume since Firefox for Android 154.
Crash report: https://crash-stats.mozilla.org/report/index/fa2a3c82-9639-4b0b-96c1-99f0e0261027
Top 10 frames:
0 android.hardware.camera2.CaptureRequest convertSurfaceToStreamId CaptureRequest.java:791
1 android.hardware.camera2.impl.CameraDeviceImpl submitCaptureRequest CameraDeviceImpl.java:1743
2 android.hardware.camera2.impl.CameraDeviceImpl setRepeatingRequest CameraDeviceImpl.java:1873
3 android.hardware.camera2.impl.CameraCaptureSessionImpl setRepeatingRequest CameraCaptureSessionImpl.java:348
4 mozilla.components.feature.qr.QrFragment$createCameraPreviewSession$1$1$state... onConfigured QrFragment.kt:68
5 android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy lambda$onConfigured$0 CallbackProxies.java:53
6 android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy $r8$lambda$_n4IjoKfaLTNPhb0V-jusXTXwVU CallbackProxies.java:0
7 android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy$$Exte... run D8$$SyntheticClass:0
8 java.util.concurrent.ThreadPoolExecutor runWorker ThreadPoolExecutor.java:1100
9 java.util.concurrent.ThreadPoolExecutor$Worker run ThreadPoolExecutor.java:624
| Reporter | ||
Comment 1•27 days ago
|
||
[Tracking Requested - why for this release]: crash volume
Updated•27 days ago
|
Comment 2•27 days ago
|
||
Same race as bug 2054232 (LensCameraFragment), in the android-components QrFragment: closeCamera() on the main thread can release the output surfaces while CameraCaptureSession.StateCallback.onConfigured() runs on the background executor, so setRepeatingRequest() throws IllegalArgumentException ("CaptureRequest contains unconfigured Input/Output Surface!") and crashes.
- Move onConfigured logic into onSessionConfigured(). Gate the camera-alive check and the session assignment on cameraOpenCloseLock. If the camera is already closed, close the new session instead of leaking it.
- Catch IllegalArgumentException from setRepeatingRequest for the remaining window where surfaces can be released.
- Build the preview CaptureRequest before creating the session, not in the callback. Drop the previewRequestBuilder/previewRequest fields, and set
surfaceto null after it is released in closeCamera().
| Assignee | ||
Updated•27 days ago
|
Updated•27 days ago
|
| Assignee | ||
Comment 3•27 days ago
|
||
Port the LensCameraFragment fix from bug 2054232: onConfigured runs on the
background executor while closeCamera() can release the output surfaces on the
main thread, making setRepeatingRequest throw IllegalArgumentException.
Comment 5•27 days ago
|
||
| bugherder | ||
Comment 6•27 days ago
|
||
The patch landed in nightly and beta is affected.
:harrisono, please make an uplift decision for beta:
- For beta, nominate the patch for beta uplift approval if the fix should be included in this release, or set
status-firefox160towontfixif the fix can wait for the next release.
Uplift requests can be submitted from Lando: D337274, D337341.
See Requesting an Uplift for documentation on how to request an uplift.
For more information, please visit BugBot documentation.
Comment 8•26 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Crash occurring in the Google Lens/QR code camera activity. rising fast.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Closes a session issue with the cameras, more risky to not have this patch than to add it.
- String changes made/needed?: none.
- Is Android affected?: yes
| Assignee | ||
Comment 9•26 days ago
|
||
Port the LensCameraFragment fix from bug 2054232: onConfigured runs on the
background executor while closeCamera() can release the output surfaces on the
main thread, making setRepeatingRequest throw IllegalArgumentException.
Original Revision: https://phabricator.services.mozilla.com/D337341
Comment 10•26 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Rising crash in camera screens for Google Lens/QR code scanner. small fix to fix a race condition.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Small race condition fix, more risky to not uplift this patch than to uplift.
- String changes made/needed?: none
- Is Android affected?: yes
| Assignee | ||
Comment 11•26 days ago
|
||
Port the LensCameraFragment fix from bug 2054232: onConfigured runs on the
background executor while closeCamera() can release the output surfaces on the
main thread, making setRepeatingRequest throw IllegalArgumentException.
Original Revision: https://phabricator.services.mozilla.com/D337341
Comment 12•26 days ago
|
||
firefox-release Uplift Approval Request
- User impact if declined/Reason for urgency: Rising crash in camera screens for Google Lens/QR code scanner. small fix to fix a race condition.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: yes
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Small race condition fix, more risky to not uplift this patch than to uplift.
- String changes made/needed?: none
- Is Android affected?: yes
| Assignee | ||
Comment 13•26 days ago
|
||
Port the LensCameraFragment fix from bug 2054232: onConfigured runs on the
background executor while closeCamera() can release the output surfaces on the
main thread, making setRepeatingRequest throw IllegalArgumentException.
Original Revision: https://phabricator.services.mozilla.com/D337341
Updated•26 days ago
|
Updated•26 days ago
|
Updated•26 days ago
|
Comment 14•26 days ago
|
||
| uplift | ||
Comment 15•22 days ago
|
||
Looks like the new crash introduced by this change is as bad or worse as the one it was trying to fix.
Updated•22 days ago
|
Comment 16•22 days ago
|
||
Verified on the latest Nightly from 01/11 and the latest Beta 160.0b3 with Pixel 7 Pro (Android 17). No crash enncountered.
Updated•22 days ago
|
Description
•