Moved from https://github.com/wordpress-mobile/gutenberg-mobile/issues/441
App shouldn't crash when opening the editor
App crashes when opening the editor on a specific content set. It's been identified to be the HTML preview fragment that is having trouble loading the content in landscape.
Prerequisites:
To test:
Alternatively: also, if you open the Post in portrait mode and then turn the phone to landscape, it will crash as well (but I thought describing the former case was best to isolate the problem).
Crash goes here:
2018-12-21 10:25:48.240 6267-6277/? I/art: Background sticky concurrent mark sweep GC freed 54698(1866KB) AllocSpace objects, 30(796KB) LOS objects, 0% free, 144MB/144MB, paused 5.434ms total 50.738ms
2018-12-21 10:25:48.530 6267-6267/? W/System.err: java.lang.RuntimeException: Canvas: trying to draw too large(116391936bytes) bitmap.
2018-12-21 10:25:48.530 6267-6267/? W/System.err: at android.view.DisplayListCanvas.throwIfCannotDraw(DisplayListCanvas.java:260)
2018-12-21 10:25:48.530 6267-6267/? W/System.err: at android.graphics.Canvas.drawBitmap(Canvas.java:1336)
2018-12-21 10:25:48.530 6267-6267/? W/System.err: at org.chromium.android_webview.JavaBrowserViewRendererHelper.drawBitmapIntoCanvas(JavaBrowserViewRendererHelper.java:50)
2018-12-21 10:25:48.530 6267-6267/? W/System.err: at org.chromium.android_webview.AwContents.nativeOnDraw(Native Method)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at org.chromium.android_webview.AwContents.access$4600(AwContents.java:97)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at org.chromium.android_webview.AwContents$AwViewMethodsImpl.onDraw(AwContents.java:2921)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at org.chromium.android_webview.AwContents.onDraw(AwContents.java:1253)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at com.android.webview.chromium.WebViewChromium.onDraw(WebViewChromium.java:1695)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.webkit.WebView.onDraw(WebView.java:2534)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.draw(View.java:17071)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16053)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.draw(View.java:16837)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16048)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.draw(View.java:16837)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.drawChild(ViewGroup.java:3764)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3550)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.draw(View.java:17074)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.widget.ScrollView.draw(ScrollView.java:1722)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16053)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:3748)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:3728)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.View.updateDisplayListIfDirty(View.java:16016)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:656)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:662)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:770)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewRootImpl.draw(ViewRootImpl.java:2796)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:2604)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:2211)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1246)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6301)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.Choreographer$CallbackRecord.run(Choreographer.java:871)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.Choreographer.doCallbacks(Choreographer.java:683)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.Choreographer.doFrame(Choreographer.java:619)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:857)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.os.Handler.handleCallback(Handler.java:751)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.os.Handler.dispatchMessage(Handler.java:95)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.os.Looper.loop(Looper.java:154)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at android.app.ActivityThread.main(ActivityThread.java:6077)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
2018-12-21 10:25:48.531 6267-6267/? W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
2018-12-21 10:25:48.532 6267-6267/? A/chromium: [FATAL:jni_android.cc(233)] Check failed: false. Please include Java exception stack in crash report
2018-12-21 10:25:48.563 6599-6267/? A/google-breakpad: -----BEGIN BREAKPAD MICRODUMP-----
2018-12-21 10:25:48.563 6599-6267/? A/google-breakpad: V WebView:51.0.2704.90
2018-12-21 10:25:48.563 6599-6267/? A/google-breakpad: O A x86 02 i686 google/sdk_google_phone_x86/generic_x86:7.0/NYC/4409132:user/release-keys
2018-12-21 10:25:48.563 6599-6267/? A/google-breakpad: G OpenGL ES 2.0 (4.1 ATI-1.68.20)|Google (ATI Technologies Inc.)|Android Emulator OpenGL ES Translator (AMD Radeon Pro 560X OpenGL Engine)
2018-12-21 10:25:48.563 6599-6267/? A/google-breakpad: S 0 BFB16E8C BFB16000 00005000
2018-12-21 10:25:48.566 6599-6267/? A/google-breakpad: S BFB16000 C860B1BF6CBBCFA37860B1BFE10370A300B4D8A3306BB1BF3860B1BF700000008861B1BF6CBBCFA37860B1BFA11470A38861B1BF700000000C10AA8614E4B1A600781F9A04718EA6[...]
(long dump comes next)
I haven't look into it, but I have an idea I wanted to share. I think it might be related to AztecImageLoader.kt specifically to https://github.com/wordpress-mobile/WordPress-Android/blob/b11b44f74855fdd8c992c246581456c99624a243/WordPress/src/main/java/org/wordpress/android/ui/posts/services/AztecImageLoader.kt#L63
If it's not the case I'm sorry for the wrong tip :P.
It seems that the crash is happening in the webview. It was reported here in the other issue.
I tried to replicate the problem on devices running 7.1.0, 7.1.1 and 7.1.2 with no luck.
I tired to replicate this issue on emulators running 7.0 (24) and 7.1.1 (25) and haven't be able to.
I鈥檝e timeboxed the activity - been checking the differences in code and I couldn鈥檛 find anything of interest. While there aren't any direct changes in code for the EditPostPreviewFragment that make me think this wouldn't stop being an issue, many versions of Gutenberg an a few updates to Aztec have been made in between the date this issue was filed and today, so it's reasonable that the conditions in which the PreviewFragment is run are different now. As discussed elsewhere, given it鈥檚 not affecting users I think it should be fine to close, wdyt @mkevins ?
I have tried to reproduce this issue on Android emulator Nexus 6, API 25, as well as Android emulator Nexus 5, API 24, to no avail. I agree that since this does not seem to be affecting any users, we can close it. If we get any reported cases, we can always revisit and re-open if necessary.
Most helpful comment
I have tried to reproduce this issue on Android emulator Nexus 6, API 25, as well as Android emulator Nexus 5, API 24, to no avail. I agree that since this does not seem to be affecting any users, we can close it. If we get any reported cases, we can always revisit and re-open if necessary.