Android 4.1.1 Browser/WebView crashing on zoom #909

Closed
protyposis opened this Issue Aug 15, 2012 · 11 comments

Comments

Projects
None yet
6 participants
@protyposis

I think this bug is related to issues #137 and #160. Despite using the latest (fixed) version, and/or disabling unloadVisibleTiles and reuseTiles, the browser still crashes when zooming the map. This can be reproduced in the mobile example.

Here's the logcat stacktrace, captured on a Nexus S with JellyBean 4.1.1:

08-15 20:34:24.422: A/libc(8323): Fatal signal 11 (SIGSEGV) at 0x00000000 (code=1), thread 8344 (WebViewCoreThre)
08-15 20:34:24.625: I/DEBUG(84): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
08-15 20:34:24.625: I/DEBUG(84): Build fingerprint: 'google/soju/crespo:4.1.1/JRO03E/403059:user/release-keys'
08-15 20:34:24.629: I/DEBUG(84): pid: 8323, tid: 8344, name: WebViewCoreThre >>> com.google.android.browser <<<
08-15 20:34:24.629: I/DEBUG(84): signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 00000000
08-15 20:34:24.742: I/DEBUG(84): r0 00000000 r1 00000001 r2 00000000 r3 ffffffff
08-15 20:34:24.742: I/DEBUG(84): r4 508a45b0 r5 514b7c08 r6 5113f498 r7 00000000
08-15 20:34:24.742: I/DEBUG(84): r8 00000100 r9 383258ed sl 503d0e09 fp 383258ed
08-15 20:34:24.742: I/DEBUG(84): ip 514bf548 sp 5285f198 lr 504c032f pc 504c0178 cpsr 80000030
08-15 20:34:24.742: I/DEBUG(84): d0 000000003c23d70a d1 0000000100000001
08-15 20:34:24.742: I/DEBUG(84): d2 4d9860100c000046 d3 4d9860144d986038
08-15 20:34:24.742: I/DEBUG(84): d4 e59fc030e5103001 d5 1a000005e153000c
08-15 20:34:24.742: I/DEBUG(84): d6 e5918017e59f1028 d7 3dcccccd3dcccccd
08-15 20:34:24.742: I/DEBUG(84): d8 0000000000000000 d9 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d10 0000000000000000 d11 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d12 0000000000000000 d13 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d14 0000000000000000 d15 000000000000025f
08-15 20:34:24.742: I/DEBUG(84): d16 0000000000000001 d17 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d18 4119d41800000000 d19 3ff0000000000000
08-15 20:34:24.742: I/DEBUG(84): d20 0000000000000000 d21 4075b56680000000
08-15 20:34:24.742: I/DEBUG(84): d22 0000000000000000 d23 8000000000000000
08-15 20:34:24.742: I/DEBUG(84): d24 0000000000000000 d25 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d26 0000000000000000 d27 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d28 0000000000000000 d29 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): d30 0000000000000000 d31 0000000000000000
08-15 20:34:24.742: I/DEBUG(84): scr 80000013
08-15 20:34:24.750: I/DEBUG(84): backtrace:
08-15 20:34:24.750: I/DEBUG(84): #00 pc 0034c178 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #1 pc 0034c32b /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #2 pc 0034bfeb /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #3 pc 003474e1 /system/lib/libwebcore.so (WebCore::LayerAndroid::setContentsImage(SkBitmapRef_)+12)
08-15 20:34:24.750: I/DEBUG(84): #4 pc 00342319 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #5 pc 001bcfc9 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #6 pc 001b0f77 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #7 pc 001c5c2d /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #8 pc 00132015 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #9 pc 00132fad /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #10 pc 001b1d89 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #11 pc 0013dcb5 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #12 pc 0011dc81 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #13 pc 002eb63d /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #14 pc 002e08d1 /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #15 pc 002e09dd /system/lib/libwebcore.so
08-15 20:34:24.750: I/DEBUG(84): #16 pc 002280d5 /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #17 pc 004a3f03 /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #18 pc 004b18b9 /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #19 pc 004b19df /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #20 pc 00537489 /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #21 pc 0053754b /system/lib/libwebcore.so
08-15 20:34:24.754: I/DEBUG(84): #22 pc 00000098
08-15 20:34:24.754: I/DEBUG(84): stack:
08-15 20:34:24.754: I/DEBUG(84): 5285f158 00000001
08-15 20:34:24.754: I/DEBUG(84): 5285f15c 40311450 /system/lib/libskia.so (SkImageRef::prepareBitmap(SkImageDecoder::Mode)+252)
08-15 20:34:24.754: I/DEBUG(84): 5285f160 00000003
08-15 20:34:24.754: I/DEBUG(84): 5285f164 00000001
08-15 20:34:24.754: I/DEBUG(84): 5285f168 00000000
08-15 20:34:24.754: I/DEBUG(84): 5285f16c 514bf548
08-15 20:34:24.754: I/DEBUG(84): 5285f170 514bf558
08-15 20:34:24.754: I/DEBUG(84): 5285f174 5113f498
08-15 20:34:24.754: I/DEBUG(84): 5285f178 00000000
08-15 20:34:24.754: I/DEBUG(84): 5285f17c 403114a8 /system/lib/libskia.so (SkImageRef::onLockPixels(SkColorTable__)+52)
08-15 20:34:24.754: I/DEBUG(84): 5285f180 00000000
08-15 20:34:24.754: I/DEBUG(84): 5285f184 514bf548
08-15 20:34:24.754: I/DEBUG(84): 5285f188 403a3590 /system/lib/libskia.so
08-15 20:34:24.754: I/DEBUG(84): 5285f18c 402e4cac /system/lib/libskia.so (SkPixelRef::lockPixels()+92)
08-15 20:34:24.754: I/DEBUG(84): 5285f190 df0027ad
08-15 20:34:24.754: I/DEBUG(84): 5285f194 00000000
08-15 20:34:24.754: I/DEBUG(84): #00 5285f198 514b7c08
08-15 20:34:24.754: I/DEBUG(84): 5285f19c 514b7c08
08-15 20:34:24.754: I/DEBUG(84): 5285f1a0 5113f498
08-15 20:34:24.758: I/DEBUG(84): 5285f1a4 504c032f /system/lib/libwebcore.so
08-15 20:34:24.758: I/DEBUG(84): #1 5285f1a8 6533da5e
08-15 20:34:24.758: I/DEBUG(84): 5285f1ac 5131ac60
08-15 20:34:24.758: I/DEBUG(84): 5285f1b0 514b7c08
08-15 20:34:24.758: I/DEBUG(84): 5285f1b4 504bffef /system/lib/libwebcore.so
08-15 20:34:24.758: I/DEBUG(84): #2 5285f1b8 00000000
08-15 20:34:24.758: I/DEBUG(84): 5285f1bc 502ddd39 /system/lib/libwebcore.so
08-15 20:34:24.758: I/DEBUG(84): 5285f1c0 00000001
08-15 20:34:24.758: I/DEBUG(84): 5285f1c4 00000001
08-15 20:34:24.758: I/DEBUG(84): 5285f1c8 00000000
08-15 20:34:24.758: I/DEBUG(84): 5285f1cc 00000000
08-15 20:34:24.758: I/DEBUG(84): 5285f1d0 00000000
08-15 20:34:24.758: I/DEBUG(84): 5285f1d4 00000000
08-15 20:34:24.758: I/DEBUG(84): 5285f1d8 514b7c00
08-15 20:34:24.758: I/DEBUG(84): 5285f1dc 516fa458
08-15 20:34:24.758: I/DEBUG(84): 5285f1e0 5113f498
08-15 20:34:24.758: I/DEBUG(84): 5285f1e4 504bb4e5 /system/lib/libwebcore.so (WebCore::LayerAndroid::setContentsImage(SkBitmapRef_)+16)

@danzel

This comment has been minimized.

Show comment Hide comment
@danzel

danzel Aug 16, 2012

Member

Oh Android browser you old dog :(
This doesn't happen on the 4.0 browser.

Could you try set "window.L_DISABLE_3D = true" before including leaflet. This will disable the 3d accelerated parts of leaflet which will probably make it work but lower performance. This isn't a fix, but should at least work around it for now if you really need Android 4.1 support.

Member

danzel commented Aug 16, 2012

Oh Android browser you old dog :(
This doesn't happen on the 4.0 browser.

Could you try set "window.L_DISABLE_3D = true" before including leaflet. This will disable the 3d accelerated parts of leaflet which will probably make it work but lower performance. This isn't a fix, but should at least work around it for now if you really need Android 4.1 support.

@protyposis

This comment has been minimized.

Show comment Hide comment
@protyposis

protyposis Aug 16, 2012

Yeah it's really annoying that you just can't rely on the built in browser :/ Unfortunately disabling 3D doesn't have any effect. In the evening I'll try to find out if it still crashes if I turn off hardware acceleration altogether... but anyway it won't be an acceptable workaround at all since the map then looks very pixellated and ugly (the tiles probably get scaled some way and not mapped unscaled onto the screen).

Yeah it's really annoying that you just can't rely on the built in browser :/ Unfortunately disabling 3D doesn't have any effect. In the evening I'll try to find out if it still crashes if I turn off hardware acceleration altogether... but anyway it won't be an acceptable workaround at all since the map then looks very pixellated and ugly (the tiles probably get scaled some way and not mapped unscaled onto the screen).

@mourner

This comment has been minimized.

Show comment Hide comment
@mourner

mourner Aug 16, 2012

Member

I'll see if this can be reproduced in the emulator, and if so, will try to fiddle with different thing to try to fix it in a couple of next days.

Member

mourner commented Aug 16, 2012

I'll see if this can be reproduced in the emulator, and if so, will try to fiddle with different thing to try to fix it in a couple of next days.

@protyposis

This comment has been minimized.

Show comment Hide comment
@protyposis

protyposis Aug 16, 2012

Sorry I need to retract what I just said - I thought I added the line before including Leaflet, but just noticed I didn't. Disabling 3D at the right place indeed solves the problem, thank you!

It's noticeably slower than before, but still works nicer than OpenLayers :) Another advantage is that the small gaps between the tiles are now gone without completely having to disable hardware acceleration.

Sorry I need to retract what I just said - I thought I added the line before including Leaflet, but just noticed I didn't. Disabling 3D at the right place indeed solves the problem, thank you!

It's noticeably slower than before, but still works nicer than OpenLayers :) Another advantage is that the small gaps between the tiles are now gone without completely having to disable hardware acceleration.

@mourner

This comment has been minimized.

Show comment Hide comment
@mourner

mourner Nov 18, 2012

Member

Hi @Colony, does this problem persist in the latest Android (4.2 or something)?

Member

mourner commented Nov 18, 2012

Hi @Colony, does this problem persist in the latest Android (4.2 or something)?

@davidd8

This comment has been minimized.

Show comment Hide comment
@davidd8

davidd8 Dec 4, 2012

I'm also seeing this in the latest Samsung 4.1.1 Android OS update, disabling 3D didn't fix it for me. Is this problem still happening to you @Colony?

davidd8 commented Dec 4, 2012

I'm also seeing this in the latest Samsung 4.1.1 Android OS update, disabling 3D didn't fix it for me. Is this problem still happening to you @Colony?

@protyposis

This comment has been minimized.

Show comment Hide comment
@protyposis

protyposis Dec 5, 2012

Sorry guys it took me a while. Just tested it on a Nexus 4 and Nexus 7 with the latest Android 4.2.1 and it seems that the problem is gone :) Unfortunately my Nexus S on which I originally discovered the problem is broken so I cannot test it there (to exclude that it was a problem related to the Nexus S hardware drivers).

@davidd8 I disabled 3D via JS and the WebView itself by setting mWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null), please give it a try. Now on the newest Android I can remove both restrictions and it still seems to work.

Sorry guys it took me a while. Just tested it on a Nexus 4 and Nexus 7 with the latest Android 4.2.1 and it seems that the problem is gone :) Unfortunately my Nexus S on which I originally discovered the problem is broken so I cannot test it there (to exclude that it was a problem related to the Nexus S hardware drivers).

@davidd8 I disabled 3D via JS and the WebView itself by setting mWebView.setLayerType(WebView.LAYER_TYPE_SOFTWARE, null), please give it a try. Now on the newest Android I can remove both restrictions and it still seems to work.

@davidd8

This comment has been minimized.

Show comment Hide comment
@davidd8

davidd8 Dec 9, 2012

@Colony Thanks for the quick response, unfortunately for Samsung devices it can take months before the OS gets an update (:(). Thankfully @florianf pointed me to a quick workaround in the meantime, via https://github.com/CloudMade/Leaflet/issues/1182

davidd8 commented Dec 9, 2012

@Colony Thanks for the quick response, unfortunately for Samsung devices it can take months before the OS gets an update (:(). Thankfully @florianf pointed me to a quick workaround in the meantime, via https://github.com/CloudMade/Leaflet/issues/1182

@meghalshah

This comment has been minimized.

Show comment Hide comment
@meghalshah

meghalshah Dec 19, 2012

A solution to it can be override the onStop() or onPause() and use webview.freememory(), i had same issue while loading html5 video inside a webview, it worked for me except i have to place it in onHideCustomView() of a custom WebChromeClient Object

A solution to it can be override the onStop() or onPause() and use webview.freememory(), i had same issue while loading html5 video inside a webview, it worked for me except i have to place it in onHideCustomView() of a custom WebChromeClient Object

@mourner

This comment has been minimized.

Show comment Hide comment
@mourner

mourner Jan 31, 2013

Member

So I guess that's not a Leaflet problem and may happen with that version in any memory-intensive cases in WebView, right? I don't think I can do anything about such crashes so I'll have to close the issue. Will reopen if someone thinks otherwise.

Member

mourner commented Jan 31, 2013

So I guess that's not a Leaflet problem and may happen with that version in any memory-intensive cases in WebView, right? I don't think I can do anything about such crashes so I'll have to close the issue. Will reopen if someone thinks otherwise.

@kaiqi2391220

This comment has been minimized.

Show comment Hide comment
@kaiqi2391220

kaiqi2391220 Jun 27, 2013

@Colony My nexus 4 also found this problem, it should not matter and memory, html5 not very familiar with, do you have any progress

@Colony My nexus 4 also found this problem, it should not matter and memory, html5 not very familiar with, do you have any progress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment