New issue
Advanced search Search tips

Issue 822203 link

Starred by 1 user

Issue metadata

Status: Untriaged
Owner: ----
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

CustomTabActivity uses uninitialized or destroyed Tab

Project Member Reported by bauerb@chromium.org, Mar 15 2018

Issue description

Split out from issue 662877, crash link:

https://crash.corp.google.com/browse?q=product.name%3D%27Chrome_Android%27%20AND%20expanded_custom_data.ChromeCrashProto.ptype%3D%27browser%27%20AND%20expanded_custom_data.ChromeCrashProto.magic_signature_1.name%3D%27%5BAndroid%20Java%20Exception%5D%20java.lang.RuntimeException%20at%20org.chromium.chrome.browser.tab.Tab.loadUrl(Tab.java)%27%20AND%20EXISTS%20(SELECT%201%20FROM%20UNNEST(thread)%20CROSS%20JOIN%20UNNEST(StackTrace.cause)%20CROSS%20JOIN%20UNNEST(StackFrame)%20WHERE%20FunctionName%3D%27org.chromium.chrome.browser.customtabs.CustomTabActivity.loadUrlInTab%27)#samplereports)

Stack trace:
Thread 65
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.android.chrome/org.chromium.chrome.browser.document.ChromeLauncherActivity}: java.lang.RuntimeException: Please post this crash on crbug.com/662877
at android.app.ActivityThread.performLaunchActivity	(ActivityThread.java:2984 )
at android.app.ActivityThread.handleLaunchActivity	(ActivityThread.java:3045 )
at android.app.ActivityThread.-wrap14	(ActivityThread.java )
at android.app.ActivityThread$H.handleMessage	(ActivityThread.java:1642 )
at android.os.Handler.dispatchMessage	(Handler.java:102 )
at android.os.Looper.loop	(Looper.java:154 )
at android.app.ActivityThread.main	(ActivityThread.java:6776 )
at java.lang.reflect.Method.invoke	(Native Method )
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run	(ZygoteInit.java:1496 )
at com.android.internal.os.ZygoteInit.main	(ZygoteInit.java:1386 )
Caused by: java.lang.RuntimeException: Please post this crash on crbug.com/662877
at org.chromium.chrome.browser.tab.Tab.loadUrl	(Tab.java:94 )
at org.chromium.chrome.browser.customtabs.CustomTabActivity.loadUrlInTab	(CustomTabActivity.java:494 )
at org.chromium.chrome.browser.customtabs.CustomTabActivity$3.loadUrlAndTrackFromTimestamp	(CustomTabActivity.java:10 )
at org.chromium.chrome.browser.LaunchIntentDispatcher.launchCustomTabActivity	(LaunchIntentDispatcher.java:119 )
at org.chromium.chrome.browser.document.ChromeLauncherActivity.onCreate	(ChromeLauncherActivity.java:57 )
at android.app.Activity.performCreate	(Activity.java:6955 )
at android.app.Instrumentation.callActivityOnCreate	(Instrumentation.java:1126 )
at android.app.ActivityThread.performLaunchActivity	(ActivityThread.java:2927 )
... 9 more

The earliest instance of the crash is in 65.0.3299.6, then suddenly it appears on the 3325 branch from 65.0.3325.16 on.

Yusuf, how does setting and resetting the global BrowserSessionContentHandler from activities work, in particular with regards to things like multiwindow?
 
Project Member

Comment 1 by bugdroid1@chromium.org, Mar 15 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/b728070c254d6616defbf245a6a8cd190cb3d23d

commit b728070c254d6616defbf245a6a8cd190cb3d23d
Author: Mohamed Heikal <mheikal@google.com>
Date: Thu Mar 15 17:47:25 2018

Rename exception since original bug is fixed

This exception was created to better understand a crash stacktrace in
crbug.com/662877, and led to fixing the original cause of the crash.
However new codepaths now trigger this exception (crbug.com/822203) thus
renaming the exception message to be more generic.

Bug: 662877,822203
Change-Id: I0c1ae488b47bab739a839073f9775c7f45d0901d
Reviewed-on: https://chromium-review.googlesource.com/964387
Reviewed-by: Bernhard Bauer <bauerb@chromium.org>
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543431}
[modify] https://crrev.com/b728070c254d6616defbf245a6a8cd190cb3d23d/chrome/android/java/src/org/chromium/chrome/browser/tab/Tab.java

Comment 2 by yus...@chromium.org, Mar 15 2018

There are two activities that can set/reset it right now. CustomTabActivity and WebappActivity. They set/reset onStartWithResume/onStopWithResume respectively.

With regards to multiwindow, if we do have two custom tabs opened in separate windows, I think that might be the cause of this particular split off stack. (I am seeing quite a bit of the crashes on N).

Honestly, although we needed some interface that can be implemented for both activity types, BrowserSessionContentHandler might have expired its reliability already. (It was put initially for only intent routing, but then got extended to handle things that are happening in the middle of Activity lifecycle which left it in its current fragile state.)
Owner: ----
Status: Untriaged (was: Assigned)
Bulk edit: Moving back into the untriaged pool, as I'm leaving the project.

Sign in to add a comment