Closed Bug 1572392 Opened 2 years ago Closed 2 years ago

GeckoView example app crashes on background-foreground cycle with "Don't keep activities" enabled

Categories

(GeckoView :: General, defect, P2)

All
Android
defect

Tracking

(firefox68 wontfix, firefox69 wontfix, firefox70 fixed)

RESOLVED FIXED
mozilla70
Tracking Status
firefox68 --- wontfix
firefox69 --- wontfix
firefox70 --- fixed

People

(Reporter: JanH, Assigned: fluffyemily)

References

(Regression)

Details

(Keywords: crash)

Attachments

(1 file)

Crashes with

08-08 12:07:24.854 15499 15499 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{org.mozilla.geckoview_example/org.mozilla.geckoview_example.GeckoViewActivity}: java.lang.ClassCastException: org.mozilla.geckoview.GeckoSession cannot be cast to org.mozilla.geckoview_example.TabSession
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2429)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2493)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread.-wrap11(ActivityThread.java)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1357)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:102)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.os.Looper.loop(Looper.java:148)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:5459)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:728)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: Caused by: java.lang.ClassCastException: org.mozilla.geckoview.GeckoSession cannot be cast to org.mozilla.geckoview_example.TabSession
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at org.mozilla.geckoview_example.GeckoViewActivity.onRestoreInstanceState(GeckoViewActivity.java:279)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.Activity.performRestoreInstanceState(Activity.java:967)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.Instrumentation.callActivityOnRestoreInstanceState(Instrumentation.java:1186)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2402)
08-08 12:07:24.854 15499 15499 E AndroidRuntime: ... 10 more

Assignee: nobody → etoop

When returning from being backgrounded, GeckoView Example was trying to restore a TabSession, but only the underlying GeckoSession was being saved, resulting in a ClassCastException on restore.

Attachment #9085063 - Attachment description: Ensure TabSessions can be restored from state after returning from the background → Bug 1572392 - Ensure TabSessions can be restored from state after returning from the background
Attachment #9085063 - Attachment description: Bug 1572392 - Ensure TabSessions can be restored from state after returning from the background → Bug 1572392 - Ensure TabSessions can be restored from state after returning from the background in GVE

James says this might be fallout from session bug 1510314. We might uplift bug 1510314 to GV 69 Beta, in which case do we need to also uplift this GVE fix to Beta? Or do we not care about GVE bugs in Beta?

Keywords: crash
Priority: -- → P2
Regressed by: 1510314
Pushed by etoop@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4711ec9dec74
Ensure TabSessions can be restored from state after returning from the background in GVE r=geckoview-reviewers,agi

Backed out changeset 4711ec9dec74 (bug 1572392) for lint failure at java/org/mozilla/geckoview/GeckoSession.java

Backout: https://hg.mozilla.org/integration/autoland/rev/3af4a9cdf22e6ef4b796807a83c74ad79c705622

Failure push: https://treeherder.mozilla.org/#/jobs?repo=autoland&revision=4711ec9dec74c09b3af0628cd7b2b1625e69a8ce

Failure log: https://treeherder.mozilla.org/logviewer.html#/jobs?job_id=262671081&repo=autoland&lineNumber=1461

[task 2019-08-21T13:13:46.229Z] Overall system resources - Wall time: 272s; CPU: 0%; Read bytes: 0; Write bytes: 0; Read time: 0; Write time: 0
[task 2019-08-21T13:13:46.315Z] To view resource usage of the build, run |mach resource-usage|.
[task 2019-08-21T13:13:46.315Z] Your build was successful!
[task 2019-08-21T13:13:46.316Z] For more information on what to do now, see https://developer.mozilla.org/docs/Developer_Guide/So_You_Just_Built_Firefox
[task 2019-08-21T13:13:46.335Z] + ./mach --log-no-times lint -f treeherder -f json:/builds/worker/mozlint.json --linter android-api-lint --linter android-javadoc --linter android-checkstyle --linter android-findbugs --linter android-lint --linter android-test
[task 2019-08-21T13:14:51.618Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- geckoview:lintWithoutGeckoBinariesDebug
[task 2019-08-21T13:16:40.043Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- app:findbugsXmlWithoutGeckoBinariesDebug app:findbugsHtmlWithoutGeckoBinariesDebug
[task 2019-08-21T13:20:08.260Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- app:testWithoutGeckoBinariesDebugUnitTest geckoview:testWithGeckoBinariesDebugUnitTest
[task 2019-08-21T13:20:22.140Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- geckoview:javadocWithGeckoBinariesDebug
[task 2019-08-21T13:20:55.449Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- app:checkstyle geckoview:checkstyleWithGeckoBinariesDebug
[task 2019-08-21T13:21:14.368Z] /usr/bin/python2.7 /builds/worker/checkouts/gecko/mach gradle --verbose -- geckoview:apiLintWithGeckoBinariesDebug
[task 2019-08-21T13:21:14.405Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java:1296:17 | Annotation removed or incompatible change (compat_failures)
[task 2019-08-21T13:21:14.405Z] TEST-UNEXPECTED-ERROR | /builds/worker/checkouts/gecko/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java:64:8 | Unexpected api change. Please run ./gradlew geckoview:apiLintWithGeckoBinariesDebug for more information (api_changes)
[fetches 2019-08-21T13:21:14.422Z] removing /builds/worker/fetches
[fetches 2019-08-21T13:21:33.042Z] finished
[taskcluster 2019-08-21 13:21:34.077Z] === Task Finished ===

Flags: needinfo?(etoop)
Pushed by etoop@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/e7b236d84ed7
Ensure TabSessions can be restored from state after returning from the background in GVE r=geckoview-reviewers,agi
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Flags: needinfo?(etoop)
You need to log in before you can comment on or make changes to this bug.