New issue
Advanced search Search tips

Issue 708761 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

RuntimeException: "Did not yet override the UI thread"

Project Member Reported by dskiba@chromium.org, Apr 5 2017

Issue description

Got 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().
 

Comment 1 by boliu@chromium.org, Apr 5 2017

Cc: torne@chromium.org
Components: Mobile>WebView
Labels: -Pri-3 Pri-1
Oh that's not good. This is the special cookie manager start that's supposed to not bind to a UI thread I think? Now library loader (well, trace events) wants to know the UI thread? That's not gonna work..

Comment 2 by torne@chromium.org, 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 :(
Cc: tobiasjs@chromium.org
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.
do we need to have libraryloader initialized here?

Comment 5 by torne@chromium.org, Apr 5 2017

Yes, we need to have initialised the native library.
The call to registerNativeEnabledObserver dates back to 2014.

Comment 7 by boliu@chromium.org, Apr 5 2017

Labels: ReleaseBlock-Beta M-59
assume recent regression

Comment 8 by torne@chromium.org, 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 :)

Comment 9 by boliu@chromium.org, Apr 5 2017

Labels: -Pri-1 -ReleaseBlock-Beta -M-59 Pri-2
Oh, this probably only happens under tracing? Otherwise setEnabled wouldn't be called here iirc.

Still should be fixed, but not blocker I guess..
Or I mean, setEnabled wouldn't call getUiThreadHandler
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 :/
Status: Available (was: Untriaged)
Labels: -Pri-2 Pri-3
Adjusting priority as per new bug triaging guidelines, up for grabs for any WebView team member.
Project Member

Comment 14 by sheriffbot@chromium.org, May 11 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
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
Status: WontFix (was: Untriaged)
Haven't seen this in a while, probably fixed.

Sign in to add a comment