Closed Bug 2084322 Opened 1 month ago Closed 1 month ago

Crash in [@ mozilla.appservices.fxaclient.InternalException: at mozilla.appservices.fxaclient.Fxa_clientKt.uniffiCheckCallStatus(fxa_client.kt:40)]

Categories

(Application Services :: General, defect)

defect

Tracking

(firefox158- fixed, firefox159 fixed, firefox160 fixed)

RESOLVED FIXED
Tracking Status
firefox158 - fixed
firefox159 --- fixed
firefox160 --- fixed

People

(Reporter: clouseau-bot, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/715b385b-7283-40cb-aaf2-a55130261011

Top 10 frames:

0  mozilla.appservices.fxaclient.Fxa_clientKt  uniffiCheckCallStatus  toolkit/components/uniffi-bindgen-gecko-js/android/components/fxaclient/android/src/main/java/mozilla/appservices/fxaclient/fxa_client.kt
1  mozilla.appservices.fxaclient.Fxa_clientKt  access$uniffiCheckCallStatus  toolkit/components/uniffi-bindgen-gecko-js/android/components/fxaclient/android/src/main/java/mozilla/appservices/fxaclient/fxa_client.kt
2  mozilla.appservices.fxaclient.FirefoxAccount  getProfile  toolkit/components/uniffi-bindgen-gecko-js/android/components/fxaclient/android/src/main/java/mozilla/appservices/fxaclient/fxa_client.kt
3  mozilla.appservices.fxaclient.FxaClient  getProfile  mozilla/appservices/fxaclient/FxaClient.kt
4  mozilla.components.service.fxa.FirefoxAccount$getProfile$2$2  invokeSuspend  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FirefoxAccount.kt
5  mozilla.components.service.fxa.FirefoxAccount$getProfile$2$2  invoke  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FirefoxAccount.kt
6  mozilla.components.service.fxa.UtilsKt  handleFxaExceptions  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Utils.kt
7  mozilla.components.service.fxa.UtilsKt  handleFxaExceptions  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Utils.kt
8  mozilla.components.service.fxa.FirefoxAccount$getProfile$2  invokeSuspend  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FirefoxAccount.kt
9  mozilla.components.service.fxa.FirefoxAccount$getProfile$2  invoke  mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FirefoxAccount.kt

Filed because this signature's crash volume spiked. 392 reports from 347 distinct installations on the release build of 2026-10-07 (buildid 20261007201254); none of the preceding 1 build-day had any, and no build in the 42 days before had any report of it. That is an appearance from zero over the loudest of the preceding build-days and of this signature's builds over the 42 days before (Clouseau's bar is 3x, and the Poisson excess of the day against that baseline is z = 38.39, bar 3.62). This signature is not new: its first report is in build 20250421163656 (2025-04-21), 534 days before this build.

Clouseau analysis (automated -- nothing below was checked by a human; a claim it could not ground is deliberately absent):

Fenix crashes when a Rust panic inside the FxA client's get_profile comes back through UniFFI as a mozilla.appservices.fxaclient.InternalException. The panic is raised during FxaAccountObserver.onAuthenticated, inside a coroutine with no exception handler. The android-components wrapper handleFxaExceptions only catches FxaException, so this exception reaches the top of the coroutine and kills the app. This signature has been crashing since April 2025, including on 145.0/145.0.1 release and steadily on nightly. Volume on 158.0 release follows the rollout: total 158.0 crash reports went from 278 to 14,673 a day while this signature's share stayed at about 4–7 per 1000, against 2.07 per 1000 on 145.0.1. That is under the 3x step bar, and no changeset in the window is supported as the cause. Next step: get the Rust panic message (the InternalException message, from the Java exception annotation or Breadcrumbs) to find the panic site in fxa-client. Separately, decide whether FxaAccountObserver's profile fetch should catch InternalException instead of crashing the app.

Possible path to the crash:

Mechanism (observed): the UniFFI-generated uniffiCheckCallStatus in fxa_client.kt throws InternalException when the Rust call status is a panic (with the panic message, or "Rust panic") or an unknown status code. InternalException subclasses kotlin.Exception, not FxaException.

Path (observed from the stack and pinned source):

  1. FxaAccountObserver.onAuthenticated runs scope.launch { account.getProfile() ... } on a CoroutineScope(ioDispatcher + SupervisorJob()) with no CoroutineExceptionHandler.
  2. android-components FirefoxAccount.getProfile wraps inner.getProfile(ignoreCache) in handleFxaExceptions, which only has catch (e: FxaException).
  3. The Rust FirefoxAccount::get_profile (via get_profile_helper: access-token fetch and profile HTTP request) panics or returns an unexpected status. Neither the panic site nor its message is recorded in the fields I could read.
  4. InternalException gets past handleFxaExceptions, reaches the top of the coroutine and goes to the default uncaught-exception handler, which crashes the parent process.

Trigger (unknown): the panic message would locate it. No panic site is visible in profile.rs itself, so it is probably deeper, in token fetching, HTTP/viaduct or state handling. That is an inference with low confidence.

Population (derived): this is long-standing. Release volume tracks 158.0 adoption, and the per-version rate (5.91 vs 2.07 per 1000 on 145.0.1) is below the 3x step bar.

Checked:

  • uniffiCheckCallStatus throws InternalException(FfiConverterString.lift(status.error_buf)) or InternalException("Rust panic") when status.isPanic(), and InternalException extends kotlin.Exception. (toolkit/components/uniffi-bindgen-gecko-js/android/components/fxaclient/android/src/main/java/mozilla/appservices/fxaclient/fxa_client.kt@eb9a6e3a7368:257-298)
  • handleFxaExceptions catches only FxaException, and rethrows it anyway when shouldPropagate() is true. A non-FxaException such as InternalException is not caught. (mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/Utils.kt@eb9a6e3a7368:20-49)
  • android-components FirefoxAccount.getProfile wraps inner.getProfile(ignoreCache) in handleFxaExceptions(logger, "getProfile", { null }). (mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/FirefoxAccount.kt@eb9a6e3a7368:104-109)
  • FxaAccountObserver.onAuthenticated launches account.getProfile() on a SupervisorJob scope with no exception handler. (mobile/android/android-components/components/service/firefox-accounts/src/main/java/mozilla/components/service/fxa/store/SyncStoreSupport.kt@eb9a6e3a7368:108-124)
  • The Rust get_profile / get_profile_helper contains no explicit panic. It returns Result errors and calls get_access_token and client.get_profile. (third_party/application-services/components/fxa-client/src/internal/profile.rs@eb9a6e3a7368:22-82)
  • Over the last 120 days on all channels: 158.0 410, 159.0a1 29, 158.0a1 19, 160.0a1 19, 145.0.1 7, 145.0 4, 141.0.3 2, 140.0.3 1, plus 158 betas. The signature predates 158. (crashstats facets field=version, all_channels, days=120)
  • The signature was first seen in build 20250421163656. Rate per 1000 same-version reports: 145.0 0.95, 145.0.1 2.07, 158.0 5.91. Daily 158.0 ratio is roughly flat while total reports grow from 278 to 14,673 a day. (brief: signature age and crash rate by version)
  • The release spike is driven mostly by 158.0 adoption, not a new step. The share rose about 2.9x over 145.0.1, which is below the 3x bar and confounded by the version gap. [derived] (brief per-day signature/all counts for 158.0 vs 145.0.1)

Alternatives considered:

  • A pushlog changeset created this crash: disfavored. The signature has existed since build 20250421163656 and appears on 140.0.3, 141.0.3, 145.0 and 145.0.1, and the per-version rate step is below 3x.
  • 4b393efa5019 (bug 2019144, vendoring of application-services), named by the ordinary pipeline: not supported. It is a vendoring import that landed after the signature was first seen, and no mechanism ties its content to a panic.
  • c91475ad9618 / cd446226a364 (UniFFI 0.32): not supported. The same signature and line predate them, and I did not find a change in panic-to-InternalException mapping (the diff was not read in full).
  • Hardware fault: disfavored. 0% bit-flip and 0% Raptor Lake share (brief), and these are ARM Android devices.

Worth checking first:

  • Which Rust code panics: read the InternalException message (protected JavaException / Breadcrumbs annotations) across a sample of 158.0 reports to get the panic text, then map it to an unwrap/expect/index in fxa-client (token, http_client, state).
  • Whether 158.0's roughly 2.9x higher share than 145.0.1 is a real regression: compare 158.0 to the release immediately before it (not shown in the 60-day window), or compare nightly rates across versions.
  • How bug 2082546 was fixed and whether that fix reached 158.0. Its comments/patch were not readable here. If it handled the line-46 variant only, the same handling may be needed for this signature.
  • Defensive option: catch InternalException in FxaAccountObserver's profile fetch, or add a CoroutineExceptionHandler to its scope. This trades a crash for a missing profile, which conflicts with the deliberate 'crash on panic' policy in shouldPropagate, so FxA/app-services owners should decide.

Filed automatically by Clouseau, which analyses release 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.

This was effectively mitigated by bug 2081454 like all the others. Can we please stop filing more dupes for this same underlying issue?

Status: NEW → RESOLVED
Closed: 1 month ago
Depends on: 2081454
Flags: needinfo?(cdenizet)
Resolution: --- → FIXED

Sorry for the noise, and thanks for linking them up. These were filed between 10-15 and 10-20, and two things have changed since:

  • Since 10-21, before filing a new bug, Clouseau compares the crash with the bugs it has already filed or commented on whose stacks share frames. If it judges them the same defect, it only adds the signature to that bug, with no new bug and no comment.
  • This one had exactly the signature of our 2082807, which had already been duped to 2082546 (fixed on 10-17, after this crash's 158.0 build). Clouseau's "already fixed?" check didn't follow a duplicate to its target. It does now, so a crash whose signature sits on a bug duped into an already-fixed bug is treated as a pre-fix report and not filed.
Flags: needinfo?(cdenizet)
You need to log in before you can comment on or make changes to this bug.