Open Bug 1988188 Opened 1 month ago Updated 10 days ago

startup Crash in [@ mozilla.appservices.logins.InternalException: at mozilla.appservices.logins.LoginsKt.uniffiCheckCallStatus(logins.kt:40)]

Categories

(Firefox for Android :: Logins, defect)

Unspecified
Android
defect

Tracking

()

REOPENED
Tracking Status
firefox143 --- wontfix
firefox144 + wontfix
firefox145 + affected

People

(Reporter: aryx, Assigned: avirvara)

References

Details

(Keywords: crash, topcrash, Whiteboard: [fxdroid][group1])

Crash Data

Attachments

(1 file)

Frequent startup crash, Firefox for Android 144.0a1 has 81 crashes from 84 installs, first reported build is 20250905210909.

Crash report: https://crash-stats.mozilla.org/report/index/d8f0767a-5251-4679-bd6c-432460250911

Top 10 frames:

0  mozilla.appservices.logins.LoginsKt  uniffiCheckCallStatus  logins.kt:40
1  mozilla.appservices.logins.LoginsKt  access$uniffiCheckCallStatus  logins.kt:1
2  mozilla.appservices.logins.LoginsKt  checkCanary  logins.kt:49
3  mozilla.components.service.sync.logins.LoginsCrypto  isKeyRecoveryNeeded  LoginsCrypto.kt:3
4  mozilla.components.concept.storage.KeyManager  getManagedKey  KeyManager.kt:13
5  mozilla.components.concept.storage.KeyManager  getOrGenerateKey$suspendImpl  KeyManager.kt:92
6  mozilla.components.service.sync.logins.SyncableLoginsStorage$conn$1  invokeSuspend  SyncableLoginsStorage.kt:49
7  kotlin.coroutines.jvm.internal.BaseContinuationImpl  resumeWith  ContinuationImpl.kt:9
8  kotlinx.coroutines.DispatchedTask  run  DispatchedTask.kt:122
9  kotlinx.coroutines.internal.LimitedDispatcher$Worker  run  LimitedDispatcher.kt:4

The Bugbug bot thinks this bug should belong to the 'Firefox for Android::Logins' component, and is moving the bug to that component. Please correct in case you think the bot is wrong.

Component: General → Logins

Tracking as requested but this matches up with when Bug 1985845 landed.
There are reports on 141.0.3 also, so not sure if this was introduced in 144?

Severity: -- → S3
Whiteboard: [fxdroid][group1]
See Also: → 1988212

The bug is marked as tracked for firefox144 (nightly). However, the bug still isn't assigned and has low severity.

:avirvara, could you please find an assignee and increase the severity for this tracked bug? If you disagree with the tracking decision, please talk with the release managers.

For more information, please visit BugBot documentation.

Flags: needinfo?(avirvara)

It looks like this code is catching a specific exception, but the code is failing with a different exception and presumably not being caught anywhere up the stack. I suspect the failing error is going to be some IO error - maybe "sqlite db is corrupt" or similar.

Severity: S3 → S2
Flags: needinfo?(avirvara)
Attachment #9514017 - Attachment description: WIP: Bug 1988188: exception handle for key validity check → Bug 1988188: exception handle for key validity check
Assignee: nobody → avirvara
Status: NEW → ASSIGNED
Status: ASSIGNED → RESOLVED
Closed: 28 days ago
Resolution: --- → FIXED
Target Milestone: --- → 145 Branch

The patch landed in nightly and beta is affected.
:avirvara, is this bug important enough to require an uplift?

For more information, please visit BugBot documentation.

Flags: needinfo?(avirvara)

:avirvara, as mentioned in Comment 2, there were reports on 141.0.3 also. From your fix, do you know the regressor OR which version were affected?
We can take a beta uplift request, but I wanted to know if there was anything else needed.

This is not a necessary a regression in 144, the problem might have been there before (don't know the regressor). The code that crashes tries to catch a specific exception (and before the latest change it tried to catch another specific exception). I replaced it with the general one (that includes the other two) because this one is actually declared to be thrown by the failing method.

Flags: needinfo?(avirvara)

(In reply to Alexandra Virvara from comment #10)

This is not a necessary a regression in 144, the problem might have been there before (don't know the regressor). The code that crashes tries to catch a specific exception (and before the latest change it tried to catch another specific exception). I replaced it with the general one (that includes the other two) because this one is actually declared to be thrown by the failing method.

Alexandara, any concerns with submitting a beta uplift request, or should this ride the train with Fx145?

Flags: needinfo?(avirvara)

no, there aren't any concerns

Flags: needinfo?(avirvara)

Comment on attachment 9514017 [details]
Bug 1988188: exception handle for key validity check

Beta/Release Uplift Approval Request

  • User impact if declined/Reason for urgency: the added code catches all exceptions that the problematic method call might throw and the app won't crash anymore
  • Is this code covered by automated tests?: No
  • Has the fix been verified in Nightly?: No
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): This fix catches all the exceptions that might be thrown by the problematic method call
  • String changes made/needed:
  • Is Android affected?: Yes
Attachment #9514017 - Flags: approval-mozilla-beta?

Are we sure this is fixed? Looks like there's still a decent volume of crashes coming in from recent Nightly builds which should have this fix included.

Flags: needinfo?(avirvara)

Is the stack identical? I'm not sure the patch is actually correct - it will treat this error as though the keys are wrong and attempt to fix them - and the fix would probably hit the exact same problem from a slightly different place.

All recent reports look like this:

mozilla.appservices.logins.InternalException: NSS has not initialized.
    Please ensure you include the initialization component and call it early in your code. See
    https://mozilla.github.io/application-services/book/rust-docs/init_rust_components/index.html
	at mozilla.appservices.logins.LoginsKt.uniffiCheckCallStatus(logins.kt:40)
	at mozilla.appservices.logins.LoginsKt.access$uniffiCheckCallStatus(logins.kt:1)
	at mozilla.appservices.logins.LoginsKt.checkCanary(logins.kt:50)
	at mozilla.components.service.sync.logins.LoginsCrypto.isKeyRecoveryNeeded(LoginsCrypto.kt:3)
	at mozilla.components.concept.storage.KeyManager.getManagedKey(KeyManager.kt:13)
	at mozilla.components.concept.storage.KeyManager.getOrGenerateKey$suspendImpl(KeyManager.kt:92)
	at mozilla.components.service.sync.logins.SyncableLoginsStorage$conn$1.invokeSuspend(SyncableLoginsStorage.kt:49)
	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:9)
	at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:122)
	at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:4)
	at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:3)
	at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:94)
	Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: null
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: 145 Branch → ---
Attachment #9514017 - Flags: approval-mozilla-beta?

The bug is linked to a topcrash signature, which matches the following criterion:

  • Top 10 AArch64 and ARM crashes on nightly

For more information, please visit BugBot documentation.

Keywords: topcrash

The fix catches the error being thrown in the first place, but I think it should be handled separately by making sure that the NSS library is initialised before trying to validate the key.

Flags: needinfo?(avirvara)
Crash Signature: [@ mozilla.appservices.logins.InternalException: at mozilla.appservices.logins.LoginsKt.uniffiCheckCallStatus(logins.kt:40)] → [@ mozilla.appservices.autofill.InternalException: at mozilla.appservices.autofill.AutofillKt.uniffiCheckCallStatus(autofill.kt:40)] [@ mozilla.appservices.logins.InternalException: at mozilla.appservices.logins.LoginsKt.uniffiCheckCallStatus(logins.kt:4…

No crash reports from Nightly builds with the fix for bug 1989865 included so far.

See Also: → 1989865

The exception is different, but I wonder if this is related to bug 1989864 still.

See Also: → 1989864

it seems to be related to bug 1989865, let's observe the behaviour with it being fixed.

Crash volume is down significantly since bug 1989865 landed, but not completely eliminated.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: