Skip to content Skip to sidebar Skip to footer

Signal 11 Sigsegv Crash In Galaxy S3 Android Webview

I have a complex, interactive HTML5 in an Android WebView - and it works fine on basically all platforms except Galaxy S3. On Galaxy S3 (Android 4.0.4), once out of every 5 times

Solution 1:

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 dlfree HEAP 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 = newWebView(context);
  setContentView( wv );
}


voidonDestroy() {
  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.

publicfinalclassWvClientextendsWebViewClient {
  publicvoidonPageFinished(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?

Solution 2:

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

Solution 3:

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):

<metaname="format-detection"content="telephone=no" /><metaname="format-detection"content="email=no" /><metaname="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.

Solution 4:

You're not the only one with this problem, I've been googling and it seems that like this other guy http://developer.samsung.com/forum/thread/why-would-webview-hang-with-galaxy-s3-only/77/181155 there is a bug with html 5 on the stock navigator on the S3 (tried so on different roms from different countries), every S3 I tried crashed. Tried on chrome and it works beautifully. I'm sure there's a bug on the stock navigator.

Solution 5:

I've been having this problem (or at least very similar) using http://fgnass.github.io/spin.js/

When I take that out of the page, there's no problem. Also seems to happen on Android 4.0 and 4.1 but not 4.3

We have not been able to find a solution other than to work around it and find something other than the spin.js spinner to use. Definitely seems like an Android problem though. What irks me is that it doesn't seem to be more widespread.

Post a Comment for "Signal 11 Sigsegv Crash In Galaxy S3 Android Webview"