Closed Bug 1805832 Opened 2 years ago Closed 2 years ago

Crash in [@ java.lang.ClassCastException: at mozilla.components.feature.prompts.dialog.ChoiceDialogFragment$choices$2.invoke(ChoiceDialogFragment.kt:32)]

Categories

(Fenix :: General, defect, P3)

Unspecified
Android
defect

Tracking

(firefox108 unaffected, firefox109 fixed, firefox110 fixed)

RESOLVED FIXED
Tracking Status
firefox108 --- unaffected
firefox109 --- fixed
firefox110 --- fixed

People

(Reporter: cpeterson, Assigned: mcarare)

References

(Regression)

Details

(Keywords: crash, regression)

Crash Data

Attachments

(3 files)

This looks like a regression in Nightly 109.0a1.

Crash report: https://crash-stats.mozilla.org/report/index/115c38aa-505a-43ad-bdd8-542950221215

Java stack trace:

java.lang.ClassCastException: android.os.Parcelable[] cannot be cast to mozilla.components.concept.engine.prompt.Choice[]
	at mozilla.components.feature.prompts.dialog.ChoiceDialogFragment$choices$2.invoke(ChoiceDialogFragment.kt:32)
	at kotlin.SynchronizedLazyImpl.getValue(LazyJVM.kt:21)
	at mozilla.components.feature.prompts.dialog.ChoiceDialogFragment.createDialogContentView$feature_prompts_release(ChoiceDialogFragment.kt:3)
	at mozilla.components.feature.prompts.dialog.ChoiceDialogFragment.createSingleChoiceDialog(ChoiceDialogFragment.kt:23)
	at mozilla.components.feature.prompts.dialog.ChoiceDialogFragment.onCreateDialog(ChoiceDialogFragment.kt:114)
	at androidx.fragment.app.DialogFragment.onGetLayoutInflater(DialogFragment.java:26)
	at androidx.fragment.app.Fragment.performGetLayoutInflater(Fragment.java:1)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:24)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:126)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:58)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:34)
	at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:287)
	at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:126)
	at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:58)
	at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:34)
	at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:34)
	at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:1)
	at org.mozilla.fenix.HomeActivity.onStart(HomeActivity.kt:26)
	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1470)
	at android.app.Activity.performStart(Activity.java:8154)
	at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3803)
	at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
	at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
	at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
	at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2345)
	at android.os.Handler.dispatchMessage(Handler.java:106)
	at android.os.Looper.loopOnce(Looper.java:233)
	at android.os.Looper.loop(Looper.java:344)
	at android.app.ActivityThread.main(ActivityThread.java:8210)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:584)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1034)
Priority: -- → P3

Judging from the SDK version in all reports (< 33), this is not a regression, as the changes in the linked commit only changed the code handling for SDK >= 33, leaving the older version with the same handling. ( the difference consists in just the usage of a generic type <T> instead of Choice.)

Having said that, we can add a checked cast in the code path for SDK <33. Although, technically, this cast exception should not have happened, as our app is the one putting the values in the bundle.

Flags: needinfo?(mcarare)

Arturo, are you able to review the PR for this?

Flags: needinfo?(amejiamarmol)

Sure!

Flags: needinfo?(amejiamarmol)

r+!

Assignee: nobody → mcarare

Fixed in 110.

Mihai, should we uplift this fix to Beta 109? The crash rate looks very low, so maybe we don't need to uplift it.

Flags: needinfo?(mcarare)

I do not think an uplift is necessary, but I can take care of it if anyone else thinks we should.

Flags: needinfo?(mcarare)

(In reply to Mihai Adrian Carare [:mcarare] from comment #9)

I do not think an uplift is necessary, but I can take care of it if anyone else thinks we should.

I think you can wait. Let's see if the crash is actually a problem on Beta. There's only one crash report on Beta so far. You probably have more important work.

Merged on 2022-12-20:

https://github.com/mozilla-mobile/firefox-android/commit/3b9dbb5c55de8bdeaa05fa4b56d21b961078c732

I think this is fixed because I don't see any crash reports after build ID 20221221151111.

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED

It's a pretty trivial fix for a new regression in 109. I'd like to backport to avoid shipping a new crash to users.

Flags: needinfo?(mcarare)
Flags: needinfo?(mcarare)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: