RuntimeException: "Did not yet override the UI thread" |
||||||||
Issue descriptionGot this exception while testing unrelated stuff: 04-04 13:52:30.522 30074 30143 W System.err: java.lang.RuntimeException: Did not yet override the UI thread 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.ThreadUtils.getUiThreadHandler(ThreadUtils.java:56) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.TraceEvent.setEnabled(TraceEvent.java:1210) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.TraceEvent.nativeRegisterEnabledObserver(Native Method) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.TraceEvent.registerNativeEnabledObserver(TraceEvent.java:175) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.library_loader.LibraryLoader.initializeAlreadyLocked(LibraryLoader.java:378) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.base.library_loader.LibraryLoader.ensureInitialized(LibraryLoader.java:144) 04-04 13:52:30.536 30074 30143 W System.err: at org.chromium.android_webview.AwCookieManager.<init>(AwCookieManager.java:27) 04-04 13:52:30.536 30074 30143 W System.err: at com.android.webview.chromium.WebViewChromiumFactoryProvider.getCookieManager(WebViewChromiumFactoryProvider.java:630) 04-04 13:52:30.536 30074 30143 W System.err: at android.webkit.CookieManager.getInstance(CookieManager.java:39) 04-04 13:52:30.536 30074 30143 W System.err: at com.google.android.apps.gsa.search.core.d.NO(SourceFile:1243) 04-04 13:52:30.536 30074 30143 W System.err: at com.google.android.apps.gsa.search.core.d.cp(SourceFile:339) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.search.core.d.co(SourceFile:328) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.search.core.google.bg.b(SourceFile:3068) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.staticplugins.j.b.aBe(SourceFile:5767) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.staticplugins.j.b.run(SourceFile:242) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.search.core.tasks.b.d$2.run(SourceFile:593) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:428) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.FutureTask.run(FutureTask.java:237) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.shared.util.concurrent.a.ak.run(SourceFile:66) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.shared.util.concurrent.a.ax.run(SourceFile:139) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133) 04-04 13:52:30.537 30074 30143 W System.err: at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607) 04-04 13:52:30.537 30074 30143 W System.err: at java.lang.Thread.run(Thread.java:761) 04-04 13:52:30.537 30074 30143 W System.err: at com.google.android.apps.gsa.shared.util.concurrent.a.ad$1.run(SourceFile:85) Might be indicating possible issue with ThreadUtils.getUiThreadHandler().
,
Apr 5 2017
Yeah, this can't work - LibraryLoader needs to be able to function *without* the UI thread having been determined yet. Whatever tracing got added that requires this needs to be removed :(
,
Apr 5 2017
Ah I was puzzled with that too, but the CL that added it did not make the reason clear to me:
try {
LibraryLoader.get(LibraryProcessType.PROCESS_WEBVIEW).ensureInitialized();
} catch (ProcessInitException e) {
throw new RuntimeException("Error initializing WebView library", e);
}
I think it was Toby's CL.
,
Apr 5 2017
do we need to have libraryloader initialized here?
,
Apr 5 2017
Yes, we need to have initialised the native library.
,
Apr 5 2017
The call to registerNativeEnabledObserver dates back to 2014.
,
Apr 5 2017
assume recent regression
,
Apr 5 2017
Possibly it just didn't used to check whether the UI thread was initialised properly, then, and just did whatever? Something must be new :)
,
Apr 5 2017
Oh, this probably only happens under tracing? Otherwise setEnabled wouldn't be called here iirc. Still should be fixed, but not blocker I guess..
,
Apr 5 2017
Or I mean, setEnabled wouldn't call getUiThreadHandler
,
Apr 6 2017
Ah, yeah. So it wont' affect normal usage, so yeah, it's not P1. Unfortunately there's no clear delimiting boundary for which code is called in the CookieManager startup path, and so there's no real way for people working on common android code to know that a given class/function needs to be usable without a UI thread commitment :/
,
Apr 6 2017
,
May 10 2017
Adjusting priority as per new bug triaging guidelines, up for grabs for any WebView team member.
,
May 11 2018
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue. Sorry for the inconvenience if the bug really should have been left as Available. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
May 11 2018
Haven't seen this in a while, probably fixed. |
||||||||
►
Sign in to add a comment |
||||||||
Comment 1 by boliu@chromium.org
, Apr 5 2017Components: Mobile>WebView
Labels: -Pri-3 Pri-1