views:

216

answers:

2

Hi all, 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.

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  A: 

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.

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.

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.

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.

Matt Gallagher
Thanks Matt. Can you elaborate on getting the NSException info? Do iPhone users get stuff in their Console.app from crashes?--I can't find it myself. FYI, love your blog.
quixoto
Sorry, I overlooked the iPhone tag; no, you probably can't get console information (that's something you can only do for a Mac app).
Matt Gallagher
+1  A: 

"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.

Ken
Interesting idea. Thanks for the thought.
quixoto