Crash in [@ java.util.concurrent.RejectedExecutionException: at java.util.concurrent.ThreadPoolExecutor$AbortPolicy.rejectedExecution(ThreadPoolExecutor.java)]
Categories
(Firefox for Android :: Search, defect, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox159 | --- | unaffected |
| firefox160 | + | verified |
| firefox161 | + | verified |
People
(Reporter: clouseau-bot, Assigned: harrisono, NeedInfo)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: crash, regression, Whiteboard: [fxdroid][android-activation-trust])
Crash Data
Attachments
(3 external files)
Crash report: https://crash-stats.mozilla.org/report/index/7254bca2-571b-45bc-bf2b-248620261030
Top 10 frames:
0 java.util.concurrent.ThreadPoolExecutor$AbortPolicy rejectedExecution
1 java.util.concurrent.ThreadPoolExecutor reject
2 java.util.concurrent.ThreadPoolExecutor execute
3 java.util.concurrent.Executors$DelegatedExecutorService execute
4 android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy onClosed
5 android.hardware.camera2.impl.CameraCaptureSessionImpl close
6 mozilla.components.feature.qr.QrFragment$createCameraPreviewSession$1$1$stateCallback$1 onConfigured mobile/android/android-components/components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt
7 android.hardware.camera2.impl.CallbackProxies$SessionStateCallbackProxy lambda$onConfigured$0
8 android.hardware.camera2.impl.-$$Lambda$CallbackProxies$SessionStateCallbackProxy$soW0qC12Osypoky6AfL3P2-TeDw run
9 java.util.concurrent.ThreadPoolExecutor runWorker
There is 1 crash in beta 160.0b3 with buildid 20261030090331.
This signature is not new: its first report anywhere is in build 20120210031150 (2012-02-10), 5376 days before the build above. (A 364-day crash-stats search only reaches 2024-10-11, because Socorro's search index keeps about six months — which is why the signature looks much newer there.)
Timing check: this signature was already being reported in build 20241011205646, 747 days before the changeset named below landed, so that changeset cannot be what INTRODUCED this SIGNATURE. It may still be relevant, and it may still be the cause of the crash in this particular report — an old signature can acquire a new cause, and a rare crash can be made frequent by a change that did not create it — but the signature's own history is not evidence that it is.
Clouseau analysis (automated). The mechanism below fits the evidence but is not proven end-to-end:
QrFragment's capture-session onConfigured calls CameraCaptureSession.close() while its backgroundExecutor is shut down, so the framework's onClosed dispatch is rejected and the RejectedExecutionException goes uncaught.
- On API >= 28,
createCaptureSessionCompatpassesbackgroundExecutor(anewSingleThreadExecutor, defaultAbortPolicy) toSessionConfiguration, soonConfiguredruns on it andonClosedis delivered through it. - Pausing the fragment runs
stopServices():closeCamera()nullscameraDevice, thenstopExecutorService()callsshutdownNow()and interrupts the worker. - Changeset 6c25e94d94c5 replaced the old
if (null == cameraDevice) returninonConfiguredwithonSessionConfigured(), which callssession.close()whentryAcquireis interrupted or fails, and whencameraDevice == null || session.device != cameraDevice. - That
close()makesCameraCaptureSessionImplpostonClosedto the terminated executor, which throwsRejectedExecutionException, and nothing inonSessionConfiguredcatches it.
The stack shows exactly onConfigured -> CameraCaptureSessionImpl.close -> SessionStateCallbackProxy.onClosed -> DelegatedExecutorService.execute -> AbortPolicy, on a ThreadPoolExecutor worker. The parent revision's onConfigured had no close() call, so the old code cannot produce this stack. The report does not show which of the two new close() calls fired or the exact timing against shutdownNow(); the interrupt path is the likeliest. Look first at the two session.close() calls in onSessionConfigured: catch RejectedExecutionException there as closeCamera() already does.
The crash is on Android 28 (API 28), where the SessionConfiguration path with backgroundExecutor is used, and frames #9-#11 show the callback running on a ThreadPoolExecutor worker, which matches that executor. The candidate landed on beta on 2026-10-28, and build 20261030090331 (rev fb7bcc275b0b) contains onSessionConfigured. The signature dates from 2012 only because it matches any rejected executor task; this changeset added a new QR-scanner route into it and did not create the signature. 0% of this signature's reports carry hardware-error flags.
Suspected regressor: 6c25e94d94c5 (gh) (bug 2086228) by Harrison Oglesby.
Code references:
- mobile/android/android-components/components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt:572
- mobile/android/android-components/components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt:608
- mobile/android/android-components/components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt:613
- mobile/android/android-components/components/feature/qr/src/main/java/mozilla/components/feature/qr/QrFragment.kt:579
What the automated skeptic pass checked
In its own words (a pass means the check succeeded, which is not always support for the conclusion):
- pass edge0 — At build rev
fb7bcc275b0b,createCaptureSessionCompatpassesbackgroundExecutor as Executor(fromExecutors.newSingleThreadExecutor()) toSessionConfigurationon API >= P. Frames #4 and #7 show both callbacks proxied through that executor. - pass hunk0 — The parent (
fd84f54ea693)onConfigurednever callsclose(), so the frame #6 -> #5 (onConfigured->CameraCaptureSessionImpl.close) stack can only come from the code the candidate added. The candidate is the newest change to the file at the build rev. - pass mechanism — Neither new
close()is wrapped, andhandleCaptureExceptionwould rethrowRejectedExecutionExceptionanyway.closeCamera()already catches this exception for its own close, which shows the risk is known. The exact interleaving withshutdownNow()is not observed in the report. R8 inlining of the single-calleronSessionConfiguredintoonConfiguredfits the missing frame but cannot be confirmed from a JVM stack.
Harrison Oglesby, can you have a look please?
Filed automatically by Clouseau, which analyses beta and Developer Edition crashes with an LLM. Nothing above was written or checked by a human. Please close it as INVALID if it is wrong — that is useful feedback, not a nuisance.
This is not an independent Mozilla discovery: the crash is known here only because somebody submitted the crash report linked at the top. If this duplicates an existing report, please resolve THIS bug as the duplicate and leave the credit with the earlier reporter.
Comment 1•29 days ago
|
||
:harrisono, since you are the author of the regressor, bug 2086228, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
Updated•28 days ago
|
Comment 2•28 days ago
|
||
On API 28+, the capture session callbacks run on backgroundExecutor. If the fragment stops while onConfigured is still pending, stopServices() shuts the executor down (and interrupts the worker). onSessionConfigured() then calls session.close(), and the framework tries to post onClosed to the terminated executor. That throws an uncaught RejectedExecutionException.
Close the unused session through a helper that catches and logs RejectedExecutionException, the same way closeCamera() already does.
Comment 3•27 days ago
|
||
The bug is marked as tracked for firefox160 (beta) and tracked for firefox161 (nightly). However, the bug still isn't assigned.
:skhan, could you please find an assignee for this tracked bug? Given that it is a regression and we know the cause, we could also simply backout the regressor. If you disagree with the tracking decision, please talk with the release managers.
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•27 days ago
|
| Assignee | ||
Updated•27 days ago
|
Updated•27 days ago
|
| Assignee | ||
Comment 5•27 days ago
|
||
Updated•27 days ago
|
Comment 6•27 days ago
|
||
firefox-beta Uplift Approval Request
- User impact if declined/Reason for urgency: A fix for the crash regression in the QR code scanner screen. Some devices might still crash even after the last patch I requested an uplift for.
- Code covered by automated testing?: yes
- Fix verified in Nightly?: no
- Needs manual QE testing?: no
- Steps to reproduce for manual QE testing:
- Risk associated with taking this patch: low
- Explanation of risk level: Low risk, adds an exception try-catch to eliminate a crash.
- String changes made/needed?: None
- Is Android affected?: yes
| Assignee | ||
Comment 7•27 days ago
|
||
Original Revision: https://phabricator.services.mozilla.com/D338811
Comment 9•26 days ago
|
||
| bugherder | ||
Updated•26 days ago
|
Updated•26 days ago
|
Comment 10•26 days ago
|
||
| uplift | ||
Updated•24 days ago
|
Comment 11•24 days ago
|
||
Verified on Firefox 160.0 across the following devices:
- Google Pixel 8 (Android 16)
- Samsung Galaxy Tab S3 (Android 9)
- Honor Magic V2 (Android 14)
No crashes encountered.
Updated•24 days ago
|
Description
•