{"action":"created","issue":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/742","repository_url":"https://api.github.com/repos/mozilla-mobile/android-components","labels_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/742/labels{/name}","comments_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/742/comments","events_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/742/events","html_url":"https://github.com/mozilla-mobile/android-components/issues/742","id":358811129,"node_id":"MDU6SXNzdWUzNTg4MTExMjk=","number":742,"title":"Fire TV SystemEngineSession Crash","user":{"login":"Baron-Severin","id":13170306,"node_id":"MDQ6VXNlcjEzMTcwMzA2","avatar_url":"https://avatars0.githubusercontent.com/u/13170306?v=4","gravatar_id":"","url":"https://api.github.com/users/Baron-Severin","html_url":"https://github.com/Baron-Severin","followers_url":"https://api.github.com/users/Baron-Severin/followers","following_url":"https://api.github.com/users/Baron-Severin/following{/other_user}","gists_url":"https://api.github.com/users/Baron-Severin/gists{/gist_id}","starred_url":"https://api.github.com/users/Baron-Severin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Baron-Severin/subscriptions","organizations_url":"https://api.github.com/users/Baron-Severin/orgs","repos_url":"https://api.github.com/users/Baron-Severin/repos","events_url":"https://api.github.com/users/Baron-Severin/events{/privacy}","received_events_url":"https://api.github.com/users/Baron-Severin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-10T22:02:06Z","updated_at":"2018-09-10T22:48:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I encountered a crash on Fire TV with a stack trace that seems to point to components.  I have only seen this once, but I'll comment here if I get any more reproduction information.\r\n\r\nFrom home, fresh install:\r\n- Clicked tile\r\n- Waited to load\r\n- Backed out to home\r\n- Clicked tile\r\n- Crashed\r\n\r\n```\r\n    java.lang.Throwable: A WebView method was called on thread 'Chrome_FileThread'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {2cb5e88} called on null, FYI main Looper is Looper (main, tid 1) {2cb5e88})\r\n        at android.webkit.WebView.checkThread(WebView.java:2350)\r\n        at android.webkit.WebView.getSettings(WebView.java:1943)\r\n        at mozilla.components.browser.engine.system.SystemEngineSession.initSettings$engine_system_release(SystemEngineSession.kt:161)\r\n        at mozilla.components.browser.engine.system.SystemEngineSession.getSettings(SystemEngineSession.kt:156)\r\n        at mozilla.components.browser.engine.system.SystemEngineView$createWebViewClient$1.shouldInterceptRequest(SystemEngineView.kt:145)\r\n        at com.amazon.webview.awvclients.AmazonWebViewClient.shouldInterceptRequest(AmazonWebViewClient.java:226)\r\n        at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:322)\r\n        at com.android.webview.chromium.WebViewExtAmazonContentsClientAdapter.shouldInterceptRequest(WebViewExtAmazonContentsClientAdapter.java:18)\r\n        at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:497)\r\n        at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:38)\r\n2018-09-10 14:53:05.975 28896-28953/? E/cr_Cloud9JNICrash: java.lang.RuntimeException: java.lang.Throwable: A WebView method was called on thread 'Chrome_FileThread'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {2cb5e88} called on null, FYI main Looper is Looper (main, tid 1) {2cb5e88})\r\n        at android.webkit.WebView.checkThread(WebView.java:2360)\r\n        at android.webkit.WebView.getSettings(WebView.java:1943)\r\n        at mozilla.components.browser.engine.system.SystemEngineSession.initSettings$engine_system_release(SystemEngineSession.kt:161)\r\n        at mozilla.components.browser.engine.system.SystemEngineSession.getSettings(SystemEngineSession.kt:156)\r\n        at mozilla.components.browser.engine.system.SystemEngineView$createWebViewClient$1.shouldInterceptRequest(SystemEngineView.kt:145)\r\n        at com.amazon.webview.awvclients.AmazonWebViewClient.shouldInterceptRequest(AmazonWebViewClient.java:226)\r\n        at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:322)\r\n        at com.android.webview.chromium.WebViewExtAmazonContentsClientAdapter.shouldInterceptRequest(WebViewExtAmazonContentsClientAdapter.java:18)\r\n        at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:497)\r\n        at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:38)\r\n     Caused by: java.lang.Throwable: A WebView method was called on thread 'Chrome_FileThread'. All WebView methods must be called on the same thread. (Expected Looper Looper (main, tid 1) {2cb5e88} called on null, FYI main Looper is Looper (main, tid 1) {2cb5e88})\r\n        at android.webkit.WebView.checkThread(WebView.java:2350)\r\n        at android.webkit.WebView.getSettings(WebView.java:1943) \r\n        at mozilla.components.browser.engine.system.SystemEngineSession.initSettings$engine_system_release(SystemEngineSession.kt:161) \r\n        at mozilla.components.browser.engine.system.SystemEngineSession.getSettings(SystemEngineSession.kt:156) \r\n        at mozilla.components.browser.engine.system.SystemEngineView$createWebViewClient$1.shouldInterceptRequest(SystemEngineView.kt:145) \r\n        at com.amazon.webview.awvclients.AmazonWebViewClient.shouldInterceptRequest(AmazonWebViewClient.java:226) \r\n        at com.android.webview.chromium.WebViewContentsClientAdapter.shouldInterceptRequest(WebViewContentsClientAdapter.java:322) \r\n        at com.android.webview.chromium.WebViewExtAmazonContentsClientAdapter.shouldInterceptRequest(WebViewExtAmazonContentsClientAdapter.java:18) \r\n        at org.chromium.android_webview.AwContents$BackgroundThreadClientImpl.shouldInterceptRequest(AwContents.java:497) \r\n        at org.chromium.android_webview.AwContentsBackgroundThreadClient.shouldInterceptRequestFromNative(AwContentsBackgroundThreadClient.java:38) \r\n```"},"comment":{"url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/comments/420086553","html_url":"https://github.com/mozilla-mobile/android-components/issues/742#issuecomment-420086553","issue_url":"https://api.github.com/repos/mozilla-mobile/android-components/issues/742","id":420086553,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMDA4NjU1Mw==","user":{"login":"csadilek","id":472523,"node_id":"MDQ6VXNlcjQ3MjUyMw==","avatar_url":"https://avatars1.githubusercontent.com/u/472523?v=4","gravatar_id":"","url":"https://api.github.com/users/csadilek","html_url":"https://github.com/csadilek","followers_url":"https://api.github.com/users/csadilek/followers","following_url":"https://api.github.com/users/csadilek/following{/other_user}","gists_url":"https://api.github.com/users/csadilek/gists{/gist_id}","starred_url":"https://api.github.com/users/csadilek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/csadilek/subscriptions","organizations_url":"https://api.github.com/users/csadilek/orgs","repos_url":"https://api.github.com/users/csadilek/repos","events_url":"https://api.github.com/users/csadilek/events{/privacy}","received_events_url":"https://api.github.com/users/csadilek/received_events","type":"User","site_admin":false},"created_at":"2018-09-10T22:48:17Z","updated_at":"2018-09-10T22:48:17Z","author_association":"MEMBER","body":"I think I understand what's happening here. The thread on which `shouldIntereceptRequest` is called doesn't see that latest updated session (which is updated and initialized in `SystemEngineView.render`). Therefore the view's settings are getting initialized lazily and on the wrong thread: https://github.com/mozilla-mobile/android-components/blob/master/components/browser/engine-system/src/main/java/mozilla/components/browser/engine/system/SystemEngineSession.kt#L165\r\n\r\n@Baron-Severin I will look into this and try to fix it this Sprint. Let me know if you have any more details."}}
{"actor":{"display_login":"csadilek"}}