New issue
Advanced search Search tips

Issue 612143 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: May 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug



Sign in to add a comment

Chomium WebView (50.0) crash handler is absorbing java code crashes

Reported by thehu...@gmail.com, May 16 2016

Issue description

Steps to reproduce the problem:
1. Have android app with web view
2. Register your crash handler - Thread.setDefaultUncaughtExceptionHandler(sExceptionHandler);
3. Use custom WebViewClient for the web view - override shouldOverrideUrlLoading - throw an exception here
4. Open any page click on any link

What is the expected behavior?
App crashes and the sExceptionHandler is called

What went wrong?
sExceptionHandler is not called

this log statement is generated:
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ java.lang.IllegalStateException: TEST
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at my.WebViewClient.shouldOverrideUrlLoading(WebViewClient.java:138)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.webview.chromium.WebViewContentsClientAdapter.shouldOverrideUrlLoading(WebViewContentsClientAdapter.java:293)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(AwContentsClientBridge.java:96)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.org.chromium.base.SystemMessageHandler.handleMessage(SystemMessageHandler.java:27)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at android.os.Handler.dispatchMessage(Handler.java:102)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at android.os.Looper.loop(Looper.java:146)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at android.app.ActivityThread.main(ActivityThread.java:5694)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at java.lang.reflect.Method.invokeNative(Native Method)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at java.lang.reflect.Method.invoke(Method.java:515)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1291)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1107)
05-16 13:37:22.254  15286-15286/my.dev W/System.err﹕ at dalvik.system.NativeStart.main(Native Method)
05-16 13:37:22.259  15286-15286/my.dev A/libc﹕ Fatal signal 6 (SIGABRT) at 0x00004c0c (code=-6), thread 15286 (my.dev)

Crashed report ID: 

How much crashed? Whole browser

Is it a problem with a plugin? No 

Did this work before? No 

Chrome version: 50.0.2661.75  Channel: stable
OS Version: System web view - 50.0.2661.86
Flash Version: 

This way our custom handling is not happening for any crash that happens in web view or in our code that is called from the web view.
shouldOverrideUrlLoading is called on Main thread, and the Thread.currentTherad().getUncaughtExceptionHandler() returns the expected ExceptionHandler

Tested on Galaxy S5 mini 4.4.2 and Nexus 5X 6.0.1 - but looks like this is happening for all the devices and versions of OS and chromium web view

Probably related to https://bugs.chromium.org/p/chromium/issues/detail?id=481420

We have crash logs from shouldOverrideUrlLoading() only from Android 4.1.2 which was using the old web view
 
Components: Mobile>WebView
Labels: Stability-Sheriff-Android

Comment 2 by boliu@chromium.org, May 16 2016

Status: WontFix (was: Unconfirmed)
Don't throw exceptions in webview callbacks. Even if things behave as you expect, you can't expect things to keep on working correctly after catching the exception, because you've just unwind webview stack unexpectedly, and could have left webview in a bad state.

But the behavior you want is discussed in crbug.com/592556. Not very high priority.

Sign in to add a comment