ios 如何理解和解决崩溃报告:SIGSEGV、SEGV_ACCERR

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11645728/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 19:25:56  来源:igfitidea点击:

How to understand and solve crash report: SIGSEGV, SEGV_ACCERR

ioscrash-reportssegmentation-fault

提问by brush51

I am getting sometimes this crash report:

我有时会收到此崩溃报告:

Name: SIGSEGV
Reason: SEGV_ACCERR
Stack Trace:

0 MyApp 0x00070456 0x1000 + 455766
1 MyApp 0x0007a34d 0x1000 + 496461
2 MyApp 0x0007a4f1 0x1000 + 496881
3 MyApp 0x000d31dd 0x1000 + 860637
4 MyApp 0x00067f0f 0x1000 + 421647
5 MyApp 0x0005ad69 0x1000 + 367977
6 MyApp 0x000081e3 0x1000 + 29155
7 MyApp 0x00008ae9 0x1000 + 31465
8 CoreFoundation 0x35a547e4 __invoking___ + 68
9 CoreFoundation 0x359af7b1 -[NSInvocation invoke] + 160
10 Foundation 0x3556268f -[NSInvocationOperation main] + 114
11 Foundation 0x354fb393 -[__NSOperationInternal start] + 862
12 Foundation 0x35564793 __block_global_6 + 102
13 libdispatch.dylib 0x348dec59 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x348e1817 _dispatch_worker_thread2 + 258
15 libsystem_c.dylib 0x32e0edfb _pthread_wqthread + 294

I don't understand this crash report. Also I don't know when this is happening.

我不明白这个崩溃报告。我也不知道这是什么时候发生的。

Is there a way to find out more about this crash?

有没有办法了解更多关于这次崩溃的信息?

How can i solve this issue?

我该如何解决这个问题?

采纳答案by Kerni

You need to symbolicate the crash report, which will convert the addresses in line 0 to 7 into meaningfull classes, methods and line numbers. Usually Xcode does that automatically if you still have the binary of the build that caused the crash around.

您需要对崩溃报告进行符号化,这会将第 0 行到第 7 行中的地址转换为有意义的类、方法和行号。如果您仍然拥有导致崩溃的构建的二进制文件,通常 Xcode 会自动执行此操作。

回答by Marek R

Question is old but there is better way then John Smith answer.

问题很老,但有更好的方法然后约翰史密斯回答。

Currently the best approach is run using profiler (in XCode: Product/Profile) using respective template.
Most probably you need to use "Zombies" template which is now also supported on device :) not only on emulator. When using this tool you have grater chance for spotting incorrect use of memory.

目前最好的方法是使用分析器(在 XCode 中:产品/配置文件)使用各自的模板运行。
您很可能需要使用“僵尸”模板,现在设备也支持该模板:) 不仅在模拟器上。使用此工具时,您更有可能发现内存使用不当。

回答by John Smith

The SIGSEV error is a signal send when you try to get memory that you are not allowed to touch

SIGSEV 错误是当您尝试获取不允许触摸的内存时发送的信号

The best way to solve this problem is to put a breakpoint and jump line per line in order to find the line which is the problem

解决这个问题的最好方法是在每行放置一个断点和跳转行,以便找到问题所在的行

Or you can also put some Debug Logs to see were is the problem

或者你也可以放一些调试日志来看看是不是有问题

For understand what SIGSEV or SEGV_ACCERR mean, you can search on internet more informations ;)

要了解 SIGSEV 或 SEGV_ACCERR 的含义,您可以在互联网上搜索更多信息;)