1

I have searched for many answer on this site for this error code.But none of them really helped :(

In my context, my activity has a webview which will load news content( article) from somewhere on the internet. After moving to other screens several times, I got that signal Fatal signal 11 (SIGSEGV) at 0x00000200 (code=1) before my app got crashed. No other information from stack trace that seems to be helpful in this case.

Anyone has experienced this problem before? Any clue is appreciated.

4

2 回答 2

2

内存损坏时会发生 SIGSEV 故障。

您正在寻址的内存块损坏的原因有很多。它可能是有故障的硬件或很可能是有故障的代码

2 事情要做来追踪问题

1)在具有相同操作系统版本的不同设备(或模拟器)上尝试您的代码。如果一切正常,那么您就知道您遇到了硬件问题。

2) 使用 Log.d 语句跟踪导致问题的代码行,这些语句散布在整个崩溃的活动中,并仔细检查您的 log cat 输出,看看您的代码有多远。在您的 log.d 消息中使用“@@@@”,例如Log.d("TAG", "@@@@ onCreate 1");让您的日志消息从其他被喷入日志的垃圾中脱颖而出。

一旦您能够追踪导致问题的代码行,然后仔细查看该行中使用的变量,以确保它们不为空,因为这将是最可能的原因。

还要确保所有线程都已在 onPause 或 onDestroy 事件(网页加载、异步任务等)中安全终止,并确保在调用它们之前检查您触发的任何回调方法不为空。

于 2013-08-19T09:11:11.850 回答
1

我以前也有同样的问题。在我的情况下,这通常发生在用户离开屏幕或退出应用程序而 Web 视图仍在加载时,但你知道,Web 视图在不同的线程上加载 URL,因此在加载内容后,它无法在 GUI 上呈现内容以及原因是 web 视图(活动)的上下文已被破坏。

为避免此异常,您应该检查 Web 视图是否正在加载内容,然后通过调用mWebView.stopLoading()在onPause()方法中停止它。

希望这会对您有所帮助。

于 2013-08-19T09:09:09.623 回答