什么原因可能导致此SIGSEGV错误? [英] What can cause this SIGSEGV error?

查看:1561
本文介绍了什么原因可能导致此SIGSEGV错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我收到了一个我无法解释的崩溃日志。我已经搜索,看起来 SIGSEGV 与内存有关。但在我的情况下,除了堆栈跟踪中的 main.m ,我自己的代码没有什么。它似乎并不象征任何系统库。



到目前为止,崩溃只发生在一个iPhone上。在其他手机上,我无法重现它。现在我完全停留,不知道在哪里继续,所以如果任何人看到这样的事情之前,他会很好地听到他们的问题和解决方案。



崩溃日志:

 事件标识符:TODO 
CrashReporter键:TODO
硬件型号:iPhone4,1
OS版本:iPhone OS 6.1.3(10B329)
报告版本:104
异常类型:SIGSEGV
异常代码:SEGV_ACCERR at 0x41fd5903
崩溃的主题:0

线程0崩溃:
0 libobjc.A.dylib 0x3b0b9564 0x3b0b6000 + 13668
1 libobjc.A.dylib 0x3b0bb1d7 0x3b0b6000 + 20951
2 CoreFoundation 0x33396605 0x332d4000 + 796165
3 CoreFoundation 0x3339635d 0x332d4000 + 795485
4 libobjc.A.dylib 0x3b0bea65 0x3b0b6000 + 35429
5 libc ++ abi.dylib 0x3ab0b07b 0x3ab0a000 + 4219
6 libc ++ abi.dylib 0x3ab0b114 0x3ab0a000 + 4372
7 libc ++ abi.dylib 0x3ab0c599 0x3ab0a000 + 9625
8 libobjc.A.dylib 0x3b0be9d1 0x3b0b6000 + 35281
9 CoreFoundation 0x332dcf21 0x332d4000 + 36641
10 CoreFoundation 0x332dcd49 0x332d4000 + 36169
11 GraphicsServices 0x36eb52eb 0x36eb0000 + 21227
12 UIKit 0x351f2301 0x3519b000 + 357121
13 Stylbar 0x0007109f main(main.m:21)
pre>

编辑5月3日:



崩溃日志由用户。我不能够重现这个问题我不幸的是,这是为什么我很难弄清楚什么错误只是这个崩溃日志。



它出现在打开某个视图控制器时为同一用户连续发生了大约15次。视图控制器会对服务器进行多次调用,以加载帖子,评论和图片以及个人资料图片。当打开此视图控制器时执行的所有代码大概超过2000行代码(不包括在此代码中使用的RestKit和SBWebImage库)。

解决方案

最简单和最有用的方式,花时间狩猎因为崩溃的原因是看看你的代码,并专注于UIKit有一个代理指向你的代码的地方。例如,我发现这种事情最常见的地方是 UITableView 。这些问题很难跟踪的原因是,它们可能只发生在低内存情况下或在一些不常见的UI条件,很难再现。最好只是做一个代码审查,并确保设置为指向您的类的委托被设置为自己的对象析构函数中的nil。如果你有很多开发人员,通常最好在一些更高级的抽象,比如一个通用表和单元格类,在整个项目中使用,而不是让每个开发人员编写一个UITableView,并犯错误,如忘记去代理很难找到。


I received a crash log that I cannot explain. I have searched around and it appears that the SIGSEGV has something to do with memory. But in my case there is nothing of my own code except for the main.m in the stacktrace. Also it doesn't seem to symbolicate any of the system libraries.

The crash so far only happened on one iPhone. On other phones I haven't been able to reproduce it. Right now I'm completely stuck and don't know where to continue so if anyone has seen something like this before it would be good to hear their problem and resolution.

The crash log:

Incident Identifier: TODO
CrashReporter Key:   TODO
Hardware Model:      iPhone4,1
OS Version:      iPhone OS 6.1.3 (10B329)
Report Version:  104
Exception Type:  SIGSEGV
Exception Codes: SEGV_ACCERR at 0x41fd5903
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib                     0x3b0b9564 0x3b0b6000 + 13668
1   libobjc.A.dylib                     0x3b0bb1d7 0x3b0b6000 + 20951
2   CoreFoundation                      0x33396605 0x332d4000 + 796165
3   CoreFoundation                      0x3339635d 0x332d4000 + 795485
4   libobjc.A.dylib                     0x3b0bea65 0x3b0b6000 + 35429
5   libc++abi.dylib                     0x3ab0b07b 0x3ab0a000 + 4219
6   libc++abi.dylib                     0x3ab0b114 0x3ab0a000 + 4372
7   libc++abi.dylib                     0x3ab0c599 0x3ab0a000 + 9625
8   libobjc.A.dylib                     0x3b0be9d1 0x3b0b6000 + 35281
9   CoreFoundation                      0x332dcf21 0x332d4000 + 36641
10  CoreFoundation                      0x332dcd49 0x332d4000 + 36169
11  GraphicsServices                    0x36eb52eb 0x36eb0000 + 21227
12  UIKit                               0x351f2301 0x3519b000 + 357121
13  Stylbar                             0x0007109f main (main.m:21)

Edit 3th of May:

The crash log is sent by a user. I haven't been able to reproduce the issue myself unfortunately, which is why it's so difficult for me to figure out what went wrong with just this crash log.

It appeared to have happened about 15 times in a row for the same user when opening a certain view controller. The view controller does several calls to a server to load a post, comments and images and profile pictures. All the code that's executed when this view controller is opened is probably over 2000 lines of code (excluding the RestKit and SBWebImage libraries that are used within this code). Posting that code here wouldn't help anyone I'm afraid.

解决方案

The most simple and useful way to spend your time hunting for the cause of the crash is to look at your code and focus on places where UIKit has a delegate that points back into your code. For example, I found that the most common place this sort of thing would show up was in UITableView. The reason these problems are so hard to track down is that they might only happen in a low memory situation or in some uncommon UI condition that is very hard to reproduce. It is better to just do a code review and make sure that delegate that are set to point to your classes are set back to nil in your own object destructors. If you have many developers, it is often better to work on some higher level abstractions like a generic table and cell class that is used throughout the project than to have every developer coding up a UITableView and making mistakes like forgetting to nil out the delegate that are very difficult to find.

这篇关于什么原因可能导致此SIGSEGV错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆