Closed Bug 2082687 Opened 1 month ago Closed 1 month ago

Crash in [@ mozilla.appservices.relay.InternalException: at mozilla.appservices.relay.RelayKt.uniffiCheckCallStatus(relay.kt:46)]

Categories

(Firefox for Android :: Privacy, defect)

All
Android
defect

Tracking

()

RESOLVED DUPLICATE of bug 2082546

People

(Reporter: clouseau-bot, Unassigned)

References

(Blocks 1 open bug)

Details

(Keywords: crash)

Crash Data

Crash report: https://crash-stats.mozilla.org/report/index/ff21a6ec-42fb-4f96-a115-0e5690261015

Top 10 frames:

0  mozilla.appservices.relay.RelayKt  uniffiCheckCallStatus  toolkit/components/uniffi-bindgen-gecko-js/android/components/relay/android/src/main/java/mozilla/appservices/relay/relay.kt
1  mozilla.appservices.relay.RelayKt  access$uniffiCheckCallStatus  toolkit/components/uniffi-bindgen-gecko-js/android/components/relay/android/src/main/java/mozilla/appservices/relay/relay.kt
2  mozilla.appservices.relay.RelayClient  fetchProfile  toolkit/components/uniffi-bindgen-gecko-js/android/components/relay/android/src/main/java/mozilla/appservices/relay/relay.kt
3  mozilla.components.service.fxrelay.FxRelayImpl$fetchProfile$2$2  invokeSuspend  mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt
4  mozilla.components.service.fxrelay.FxRelayImpl$fetchProfile$2$2  invoke  mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt
5  mozilla.components.service.fxrelay.FxRelayImpl  handleRelayExceptions  mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt
6  mozilla.components.service.fxrelay.FxRelayImpl$fetchProfile$2  invokeSuspend  mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt
7  mozilla.components.service.fxrelay.FxRelayImpl$fetchProfile$2  invoke  mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt
8  kotlinx.coroutines.intrinsics.UndispatchedKt  startUndispatched
9  kotlinx.coroutines.BuildersKt__Builders_commonKt  withContext

Filed because this signature's crash volume spiked. 11 reports from 3 distinct installations on the nightly build of 2026-10-15 (buildid 20261015093624); none of the preceding 3 build-days had any, and no build in the 21 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 21 days before (Clouseau's bar is 3x, and the Poisson excess of the day against that baseline is z = 5.52, bar 3.62). This signature is new on nightly: crash-stats has no report of it there before this build.

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

Fenix nightly crashes in the parent process, here 3 s after launch, when the Rust relay client's fetchProfile() fails with something UniFFI turns into mozilla.appservices.relay.InternalException (normally a Rust panic). FxRelayImpl.handleRelayExceptions only catches RelayApiException, so the exception escapes the Dispatchers.IO coroutine and kills the app. This spike is almost certainly the crash already tracked as bug 2082335 under a new name. That spelling (relay.kt:40) has 29 reports, all on build 20261014215550. This one (relay.kt:46) has 11, all on the next build. In between, 07d2cc0a1254 bumped application-services, and relay.kt is generated code shipped in that package. Recommended: catch InternalException (or any Exception) in handleRelayExceptions and return the fallback, and ask application-services what makes fetch_profile panic in the 2026-10-14 nightly versions.

Possible path to the crash:

Mechanism (observed): a mozilla.appservices.relay.InternalException thrown by the generated uniffiCheckCallStatus from RelayClient.fetchProfile is not caught, and the process dies.

Path (observed from source and stack, pinned d546d4277bd0):

  1. FxRelayImpl.fetchAccountDetails calls fetchProfile() inside withContext(Dispatchers.IO).
  2. fetchProfile calls client.fetchProfile() inside handleRelayExceptions(FETCH_PROFILE, { null }).
  3. The Rust call returns a failure status that uniffiCheckCallStatus raises as InternalException, not as the declared RelayApiException error type.
  4. handleRelayExceptions has only catch (e: RelayApiException), so the exception escapes the coroutine and the parent process crashes.

Trigger (inferred, low): something in the application-services relay crate that Fenix nightly picked up around 2026-10-14 makes fetch_profile panic or fail internally, possibly on a server response it cannot handle. The panic message and the Rust change were not available to check.

Signature change (inferred, medium): the move from relay.kt:40 to relay.kt:46 comes from the regenerated relay.kt in application-services bump 07d2cc0a1254, which only changes the version pin.

Checked:

  • handleRelayExceptions catches only RelayApiException; fetchProfile runs client.fetchProfile() inside it on Dispatchers.IO. (mobile/android/android-components/components/service/firefox-relay/src/main/java/mozilla/components/service/fxrelay/FxRelay.kt@d546d4277bd0:117-143,192-200)
  • The stack goes uniffiCheckCallStatus <- fetchProfile (relay.kt) <- FxRelay.kt invokeSuspend / handleRelayExceptions <- withContext. Parent process, arm64, Android 33, uptime 3 s, 0% bit-flip or Raptor Lake share. (brief stack; crashstats report ff21a6ec-42fb-4f96-a115-0e5690261015)
  • The sibling spelling ...uniffiCheckCallStatus(relay.kt:40) has 29 nightly reports, all on build 20261014215550 (first seen there, searched over 364 days), all parent process and arm64. (socorro crash_stats and facets build_id, 30 days, signature relay.kt:40)
  • This spelling (relay.kt:46) appears only on build 20261015093624, the build right after the relay.kt:40 build. (brief: signature age and spike counts)
  • 07d2cc0a1254, in the spiking build's window, only changes the application-services version pin (160.20261014050201 -> 160.20261014160830, revision ec31dc5b -> 7afac3d5). (mcp__patch__diff 07d2cc0a1254 (ApplicationServices.kt, moz.yaml))
  • The previous application-services bump, 9e71cc00bd25 (bug 2081627, to ec31dc5b), landed 2026-10-14 and is the closest change to the onset build 20261014215550. (history file_history ApplicationServices.kt)
  • The two spellings are the same crash; the line number changed because the generated relay.kt was rebuilt in the 07d2cc0a1254 bump. [inferred, medium confidence] (same frames and exception class, back-to-back builds, 07d2cc0a1254 diff)
  • Bug 2082335 (Firefox for Android :: Privacy, NEW) tracks the relay.kt:40 spelling. (bugzilla 2082335)

Alternatives considered:

  • Bug 1977879 / c0ac317234cf (the pipeline's candidate, which created the component) as the cause of this onset: disfavored -- the missing InternalException handling is the defect that makes this a crash, but neither spelling has reports before build 20261014215550 in 30 days of data, so something newer set it off.
  • A new defect introduced in the 2026-10-15 pushlog: disfavored -- the same crash was already happening as relay.kt:40 on the previous build; the only relevant change in the window is the application-services version pin.
  • Failing hardware: not supported -- 0% bit-flip and 0% Raptor Lake; Android arm64 Java exception.

Worth checking first:

  • What makes Rust fetch_profile raise an internal error or panic? Read the application-services commits between f22774fb and ec31dc5b (and up to 7afac3d5) in the relay crate, and get the panic message from the JavaException annotation or from logcat.
  • Is the 2026-10-14 bump 9e71cc00bd25 the first build with it? Check that build 20261014215550 is the first nightly containing 9e71cc00bd25, and look for related relay signatures on earlier builds.
  • Confirm the line-shift explanation: compare the generated relay.kt in application-services ec31dc5b and 7afac3d5, or confirm that later builds report only the relay.kt:46 spelling.
  • Defensive fix to land in android-components: in FxRelayImpl.handleRelayExceptions, catch mozilla.appservices.relay.InternalException (or a generic Exception), log it and return fallback(). Add a unit test with a RelayClientInterface fake that throws InternalException.

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

Status: NEW → RESOLVED
Closed: 1 month ago
Duplicate of bug: 2082546
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.