Signal 11 SIGSEGV Crash in Galaxy S3 Android WebView Signal 11 SIGSEGV Crash in Galaxy S3 Android WebView android android

Signal 11 SIGSEGV Crash in Galaxy S3 Android WebView


I was playing around with your crashApp.

Using devices;■ SHARP ISW16SH■ LG optimus Vu L-06D (can't even survive after 3 ~ 10 pages)

These are the error that I often got.Fatal signal 11 (SIGSEGV)HEAP MEMORY CORRUPTION IN dlfreeHEAP MEMORY CORRUPTION IN dlmalloc

Obviously, there's a memory allocation or double freeing problem. And it's not something that can be fix. (unless, NDK)the only solution I found is to hot-swap the webview on the fly.Always load the next page in the newly created webview will prevent this from happening.however, I can't seem to stop memory from dropping. Eventually Android will strike once your app grows into a memory eating monster.

I then start playing with two identical empty activity class.no xml.so,

onCreate() {  WebView wv = new WebView(context);  setContentView( wv );}void onDestroy() {  ViewGroup vg = (ViewGroup)game_wv.getParent();  vg.removeView(game_wv);  destroyWebView( game_wv );  game_wv = null;  super.onDestroy();  System.gc();  //clean up what's freed in webViewLoadComplete (hopefully)}

I also called another gc in the onPageFinished just to make sure the other activity is gone for good.

public final class WvClient extends WebViewClient {  public void onPageFinished(WebView wv, String url) {    webViewLoadComplete(game_wv);    System.gc();  //clean up the other activity  }}

here's the destroyWebView and webViewLoadComplete.I'm not so sure about some of the functions (like clearAnimation or clearDisappearingChildren) or what's the right order to call.I just... threw everything in there. ha

void destroyWebView( WebView wv ){  wv.stopLoading();// wv.pauseTimers();  wv.clearFormData();  wv.clearAnimation();  wv.clearDisappearingChildren();  wv.clearView();// wv.clearCache( true );  wv.clearHistory();// wv.clearMatches();// wv.clearSslPreferences();  wv.destroyDrawingCache();  wv.freeMemory();  wv.destroy();}void webViewLoadComplete( WebView wv ){// wv.stopLoading();// wv.pauseTimers();// wv.clearFormData();  wv.clearAnimation();  wv.clearDisappearingChildren();// wv.clearView();////wv.clearCache( true );// wv.clearHistory();////wv.clearMatches();////wv.clearSslPreferences();  wv.destroyDrawingCache();  wv.freeMemory();// wv.destroy();}

somehow, it worked...

Think the ultimate method might be using a NDK?


It is a chronic problem for lower RAM capacity Samsung devices. There is no solution.


I solved a number of low-level crashes, including crashes on 4.0.4, by disabling format-detection in the HEAD of the html page (this was suggested by a friend at Google):

<meta name="format-detection" content="telephone=no" /><meta name="format-detection" content="email=no" /><meta name="format-detection" content="address=no"/>

However, the 4.1.1 update brought these crashes back on the S3, and I haven't figured out a workaround this time.