iPhone:理解字段崩溃报告:未识别的选择器?

时间:2022-08-16 20:45:47

A user of my app out in the field seems to having bad crash-at-app-start issues. I got him to send me the .crash files from his PC. After "symbolicating" them according to this article, I get what looks from the stack like a unrecognized selector fail. But the top line of code corresponding to my process is an unambiguous message send that gets executed hundreds of times without issue in my app normally. Needless to say, I never repro this issue myself.

我的应用程序在这个领域的一个用户似乎遇到了糟糕的紧急启动问题。我让他从他的电脑上把。crash文件发给我。在根据本文对它们进行“符号化”之后,我从堆栈中得到的结果是无法识别的选择器失败。但是,与我的进程对应的代码的第一行是一个明确的消息发送,它在我的应用程序中正常运行数百次,没有问题。不用说,我从来没有对这个问题进行过自我评价。

Can the crash report lie? Could this stack indicate anything besides unrecognized selector? Thanks for any insight.

坠机报告会撒谎吗?这个堆栈是否表示除了未识别的选择器之外的任何东西?谢谢你的任何见解。

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Thread 0 Crashed:
0   libSystem.B.dylib               0x000790a0 __kill + 8
1   libSystem.B.dylib               0x00079090 kill + 4
2   libSystem.B.dylib               0x00079082 raise + 10
3   libSystem.B.dylib               0x0008d20a abort + 50
4   libstdc++.6.dylib               0x00044a1c __gnu_cxx::__verbose_terminate_handler() + 376
5   libobjc.A.dylib                 0x000057c4 _objc_terminate + 104
6   libstdc++.6.dylib               0x00042dee __cxxabiv1::__terminate(void (*)()) + 46
7   libstdc++.6.dylib               0x00042e42 std::terminate() + 10
8   libstdc++.6.dylib               0x00042f12 __cxa_throw + 78
9   libobjc.A.dylib                 0x000046a4 objc_exception_throw + 64
10  CoreFoundation                  0x00094174 -[NSObject doesNotRecognizeSelector:] + 108
11  CoreFoundation                  0x00093afa ___forwarding___ + 482
12  CoreFoundation                  0x000306c8 _CF_forwarding_prep_0 + 40
13  MyAppProcess                    0x000147c6 -[ImageLoader imageSmallForColor:style:] (ImageLoader.m:180)
.... /* many more frames... */

2 个解决方案

#1


2  

"Unrecognized selector" can also mean "overreleased object". Suppose you have an object, x, and it gets released improperly. That memory location is now free for other use. Suppose it gets used for something of class Y. Now, next time you attempt to message x, you'll get a message about how class Y doesn't respond to the selector.

“无法识别的选择器”也可以表示“过度释放的对象”。假设你有一个对象x,它被不正确地释放。该内存位置现在可以免费用于其他用途。假设它被用在Y类的某些东西上,现在,下次你尝试发送x消息时,你会得到一个关于类Y如何不响应选择器的消息。

#2


2  

The symbolicate can fail but it is unlikely -- you're more likely to see no symbols at all if it fails.

象征符号可以失败,但不太可能——如果失败,你更可能看不到任何符号。

The crash log is insisting that ImageLoader.m:180 is trying to send an invalid message to an object. It's probably right, even if the circumstances are bizarre.

崩溃日志坚持使用ImageLoader。m:180试图向一个对象发送无效的消息。这可能是对的,即使情况很奇怪。

My suggestion: get the person who is seeing the crash to send you a copy of the NSException error from the Console.app. This will tell you the class of the object that received the message and the selector of the message.

我的建议是:让看到崩溃的人从Console.app上给你发送一个NSException异常的副本。这将告诉您接收消息的对象的类和消息的选择器。

Possibility 1: the user is running a different version of the OS to you and the selector doesn't exist on his version of the OS. Or similarly that a file in his build is out-of-date and is missing the selector.

可能性1:用户正在运行不同版本的操作系统,而选择器在他的操作系统版本中并不存在。或者类似地,他的构建中的文件已经过时,并且缺少选择器。

Possibility 2: however you are creating/fetching the object has different results on the user's computer. e.g. You always get an NSString but the user gets an NSNumber.

可能性2:无论您如何创建/获取对象,在用户的计算机上都有不同的结果。你总是会得到一个NSString,但是用户会得到一个NSNumber。

#1


2  

"Unrecognized selector" can also mean "overreleased object". Suppose you have an object, x, and it gets released improperly. That memory location is now free for other use. Suppose it gets used for something of class Y. Now, next time you attempt to message x, you'll get a message about how class Y doesn't respond to the selector.

“无法识别的选择器”也可以表示“过度释放的对象”。假设你有一个对象x,它被不正确地释放。该内存位置现在可以免费用于其他用途。假设它被用在Y类的某些东西上,现在,下次你尝试发送x消息时,你会得到一个关于类Y如何不响应选择器的消息。

#2


2  

The symbolicate can fail but it is unlikely -- you're more likely to see no symbols at all if it fails.

象征符号可以失败,但不太可能——如果失败,你更可能看不到任何符号。

The crash log is insisting that ImageLoader.m:180 is trying to send an invalid message to an object. It's probably right, even if the circumstances are bizarre.

崩溃日志坚持使用ImageLoader。m:180试图向一个对象发送无效的消息。这可能是对的,即使情况很奇怪。

My suggestion: get the person who is seeing the crash to send you a copy of the NSException error from the Console.app. This will tell you the class of the object that received the message and the selector of the message.

我的建议是:让看到崩溃的人从Console.app上给你发送一个NSException异常的副本。这将告诉您接收消息的对象的类和消息的选择器。

Possibility 1: the user is running a different version of the OS to you and the selector doesn't exist on his version of the OS. Or similarly that a file in his build is out-of-date and is missing the selector.

可能性1:用户正在运行不同版本的操作系统,而选择器在他的操作系统版本中并不存在。或者类似地,他的构建中的文件已经过时,并且缺少选择器。

Possibility 2: however you are creating/fetching the object has different results on the user's computer. e.g. You always get an NSString but the user gets an NSNumber.

可能性2:无论您如何创建/获取对象,在用户的计算机上都有不同的结果。你总是会得到一个NSString,但是用户会得到一个NSNumber。