[Google Lens] Firefox crashes after I toggle into/out-of Google Lens camera view a few times (Crash in [@ java.lang.IllegalArgumentException: at android.hardware.camera2.CaptureRequest.convertSurfaceToStreamId(CaptureRequest.java)] )
Categories
(Firefox for Android :: Search, defect)
Tracking
()
People
(Reporter: dholbert, Assigned: harrisono)
References
(Blocks 1 open bug)
Details
(Keywords: crash, crashreportid, Whiteboard: [fxdroid][group3])
Crash Data
Attachments
(2 files)
|
48 bytes,
text/x-phabricator-request
|
Details | Review | |
|
48 bytes,
text/x-phabricator-request
|
phab-bot
:
approval-mozilla-beta+
|
Details | Review |
Steps to reproduce
- Open a new tab,
- Focus the URL bar.
- Tap the Google Lens logo at the right side.
- Tap "x" (top left) to go back to your new-tab.
- Repeat steps 3 and 4 several times.
Expected behavior
No crash.
Actual behavior
Firefox crashes, e.g. bp-c1160369-683f-43ee-b70b-161430260710
Device information
- Firefox version: 154.0a1 Nightly 2026-07-09
- Android device model: Pixel 10 Pro XL
- Android OS version: 17
Any additional information?
I haven't yet been able to repro on my Pixel 6a. But this reproduces very reliably on my Pixel 10 Pro XL -- I've crashed 3-4 times in the past half hour or so (first on accident, then on purpose after I realized how to trigger it).
| Reporter | ||
Updated•1 month ago
|
| Reporter | ||
Updated•1 month ago
|
| Reporter | ||
Comment 1•1 month ago
|
||
| Reporter | ||
Comment 2•1 month ago
|
||
This crashes in 153 beta, too (if I enable Google Lens there via the secret setting):
bp-fd0cac5a-0bdc-4966-aa80-4c29d0260711
| Reporter | ||
Comment 3•1 month ago
|
||
Here's the Java Stack Trace from my crash in comment 0:
java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface!
at android.hardware.camera2.CaptureRequest.convertSurfaceToStreamId(CaptureRequest.java:791)
at android.hardware.camera2.impl.CameraDeviceImpl.submitCaptureRequest(CameraDeviceImpl.java:1727)
at android.hardware.camera2.impl.CameraDeviceImpl.setRepeatingRequest(CameraDeviceImpl.java:1857)
at android.hardware.camera2.impl.CameraCaptureSessionImpl.setRepeatingRequest(CameraCaptureSessionImpl.java:328)
at org.mozilla.fenix.components.lens.LensCameraFragment$createCameraPreviewSession$1$1$sessionStateCallback$1.onConfigured(LensCameraFragment.kt:53)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.lambda$onConfigured$0(CallbackProxies.java:53)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy.$r8$lambda$_n4IjoKfaLTNPhb0V-jusXTXwVU(CallbackProxies.java:0)
at android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy$$ExternalSyntheticLambda5.run(D8$$SyntheticClass:0)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1100)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:1572)
Googling for the exception (java.lang.IllegalArgumentException: CaptureRequest contains unconfigured Input/Output Surface!) turns up some maybe-useful AI-Overview advice, and some instances where other folks have tripped this same suggestion. But I don't know the relevant Android/Kotlin APIs well enough to know whether they're applicable.
| Reporter | ||
Comment 4•1 month ago
|
||
(In reply to Daniel Holbert [:dholbert] from comment #0)
I haven't yet been able to repro on my Pixel 6a. But this reproduces very reliably on my Pixel 10 Pro XL -- I've crashed 3-4 times in the past half hour or so (first on accident, then on purpose after I realized how to trigger it).
Ah, one maybe-important difference between these devices is that my Pixel 6a (apparently-unaffected) was running Android 16, whereas my Pixel 10 Pro XL (affected) is running Android 17.
I'm now downloading Android 17 for my Pixel 6a; I'll report back about whether that happens to help the bug repro there...
| Reporter | ||
Comment 5•1 month ago
•
|
||
OK, after upgrading to Android 17, I managed to repro the crash on my Pixel 6a. Sample crash report:
bp-d0a0b578-1732-407a-8367-5f3270260711
It sometimes takes ~45seconds of cycling the final step of the STR (google lens, back, google lens, back) in order to trigger the crash there, though. So I'm not actually sure whether upgrading to Android 17 was the relevant factor, or whether it was just that it requires more thorough/aggressive application of the STR on that device, and I hadn't done that until after I upgraded. (e.g. maybe there's a race condition that the Pixel 6a happens to come out on the good side of, most of the time). Not sure.
| Reporter | ||
Comment 6•1 month ago
•
|
||
Also worth noting, my Firefox Nightly profile on the Pixel 6a is basically "fresh" (I reinstall/clear-data-for Nightly all the time there and haven't tweaked any settings since the most recent time I did that). So I don't think this requires any special configuration in Firefox itself in order to trigger.
| Reporter | ||
Comment 7•1 month ago
|
||
I was curious if this also affected the preexisting QR-code-only flow, and it seems the answer is no (i.e. the old QR code flow is unaffected by this -- this is specific to the Lens flow).
I tested that old flow flow by turning off Lens in Firefox Nightly settings|search|"enable google lens search-->off". And with that configuration, repeatedly cycling the STR here, I have not been able to reproduce any crash (with the QR-code-only flow). I tried this on both of the devices that I've mentioned here, in latest Nightly.
| Assignee | ||
Updated•1 month ago
|
Updated•1 month ago
|
| Assignee | ||
Comment 8•1 month ago
|
||
Updated•1 month ago
|
Comment 10•1 month ago
|
||
| bugherder | ||
Comment 11•1 month ago
|
||
The patch landed in nightly and beta is affected.
:harrisono, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox154towontfix.
For more information, please visit BugBot documentation.
Comment 13•1 month ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: Users can experience a full app crash if they rapidly open and close the Google Lens integration camera screen. This needs to be addressed before we have wide adoption in 154.
- 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: Removal of race condition for the camera session in the LensCameraActivity, low risk of regressions.
- String changes made/needed?: none.
- Is Android affected?: yes
| Assignee | ||
Comment 14•1 month ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D312380
Updated•1 month ago
|
Updated•1 month ago
|
Comment 15•1 month ago
|
||
| uplift | ||
Comment 16•1 month ago
|
||
I was only able to reproduce the crash on a Pixel 9 Pro (Android 17) device.
Verified as fixed on the latest Firefox for Android nightly 155.0a1 from 7/23 with the above-mentioned device.
Setting the qe-verify+ label to verify the fix in Beta 154 as well.
Comment 17•1 month ago
|
||
Verified as fixed on the Firefox for Android Beta 154.0b2 using the Pixel 9 Pro (Android 17) device.
Description
•