WebView and native browser crash on simple HTML

老子叫甜甜 提交于 2019-12-30 10:55:10

问题


After struggling to find the cause of a crash in my app's WebView, I discovered that a very basic webpage causes even the native Android browser on two specific HTC models to crash.

The models in question are an HTC Desire HD (Android 2.3.5) and an HTC Desire C (Android 4.0.3). Other devices have no problems loading the page, including a few other HTC models.

The HTML causing the crash:

<html>
  <body>
    <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Alkmaar, Almere, Amersfoort, Amsterdam, Arnhem, Bergen op Zoom, Beverwijk, Breda, Delft, Den Bosch, Den Haag, Deurne, Deventer, Diemen, Eindhoven, Enschede, Goes, Groningen, Haarlem, Harlingen, Heemstede Hengelo, Hoorn, IJmuiden, Leeuwarden, Leiden, Nieuwegein, Nijmegen, Noordwijk, Oldenzaal, Oss, Oud-Beijerland, Purmerend, Roosendaal, Rotterdam, Scheveningen, Schiedam, Schiphol, Tiel, Utrecht, Valkenswaard, Velsen, Venray, Vlaardingen, Waalwijk, Zandvoort, Zeist en Zevenaar.</p>
  </body>
</html>

For easy access: http://demos.pixplicity.com/so13121158.html

The strange thing is: if I remove the cities ("Alkmaar, [...] Zevenaar"), or move them to the beginning of the paragraph, the browser no longer crashes.

I have collected a snapshot of Logcat when the browser crashes, but the only meaningful line is:

A/(7437): stack corruption detected: aborted

I have absolutely no clue why this is happening. Any suggestions are most welcome!


回答1:


I'm getting the same thing with the HTC one V.

According to this answer, "The message indicates corruption of the native stack. Code to detect stack buffer overflows is inserted when the gcc flag "-fstack-protector" is used."

So I think it's a bug in the platform itself. (Well in my case anyway, as I have no JNI code in my app)



来源:https://stackoverflow.com/questions/13121158/webview-and-native-browser-crash-on-simple-html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!