Exception Type: EXC_CRASH (SIGTRAP) - ios

In very rare occasions, but very persistently some of our users will get a crash in our app. It starts ok but short after it crashes when they pick something from a menu. Those that see it always get it, everybody else works fine. Can someone see something that can help me track it down?
Exception Type: EXC_CRASH (SIGTRAP)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x31495848 __kill + 8
1 MYApp 0x0007a8b6 TFHandleExceptions + 986
2 CoreFoundation 0x372df950 __handleUncaughtException + 68
3 libobjc.A.dylib 0x34fe433e _objc_terminate + 122
4 libc++abi.dylib 0x36a173be safe_handler_caller(void (*)()) + 70
5 libc++abi.dylib 0x36a1744a std::terminate() + 14
6 libc++abi.dylib 0x36a1881e __cxa_rethrow + 82
7 libobjc.A.dylib 0x34fe42a2 objc_exception_rethrow + 6
8 CoreFoundation 0x37235506 CFRunLoopRunSpecific + 398
9 CoreFoundation 0x37235366 CFRunLoopRunInMode + 98
10 GraphicsServices 0x339f4432 GSEventRunModal + 130
11 UIKit 0x30fe1cce UIApplicationMain + 1074
12 MYApp 0x0005bc9c main (main.m:17)
13 MYApp 0x0005bc30 start + 32

Your app crashes because of an exception. TF doesn't seem to cover these and doesn't show the origin of the crash. The exceptions gets rethrown into the main thread in the next runloop, so the stack trace of the main thread does not show the origin of it. You need to use another crash reporting library which is able to show that information or try to get the original crash report that iOS writes. (Most PLCrashReporter based crash reporting libraries or services can do that)
The reason could be any kind of exception, like NSArray indexOutOfBounds or anything else.

Related

Analysing This Crash Report

I got this crash report, and I "symbolicated" it.
Even after that, I am still unable to understand where does my crash comes from.
The app crashes straight after launch.
Here's my crash report :
Hardware Model: iPhone7,2
Version: 1.6.0.3 (1.6.0)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2015-04-30 15:50:21.019 +0200
Launch Time: 2015-04-30 15:50:15.833 +0200
OS Version: iOS 8.3 (12F70)
Report Version: 105
Exception Type: EXC_CRASH (SIGSEGV)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 1
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0:
0 libsystem_c.dylib 0x0000000193e056ac strlen + 12
1 App 0x000000010012e1ec -[NSString(CategoryName) hashWithSecretKeyUpdateUser] (HashString.m:70)
2 App 0x00000001000eff04 +[InAppPurchaseHelper generateSHAFromDictionary:registerOrReadOrUpdate:] (InAppPurchaseHelper.m:177)
3 App 0x00000001000ef5b8 +[InAppPurchaseHelper updateUserInfosRegisterProfile:registerPush:] (InAppPurchaseHelper.m:119)
4 App 0x0000000100166574 -[AppDelegate applicationDidBecomeActive:] (AppDelegate.m:218)
5 UIKit 0x00000001869f7474 -[UIApplication _stopDeactivatingForReason:] + 456
6 CoreFoundation 0x0000000181eda2c0 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 16
7 CoreFoundation 0x0000000181eda72c ____CFXNotificationPostToken_block_invoke + 140
8 CoreFoundation 0x0000000181eec278 __CFRUNLOOP_IS_CALLING_OUT_TO_A_BLOCK__ + 16
9 CoreFoundation 0x0000000181eeb380 __CFRunLoopDoBlocks + 308
10 CoreFoundation 0x0000000181ee99a4 __CFRunLoopRun + 1752
11 CoreFoundation 0x0000000181e152d0 CFRunLoopRunSpecific + 392
12 GraphicsServices 0x000000018b62b6f8 GSEventRunModal + 164
13 UIKit 0x00000001869dafa8 UIApplicationMain + 1484
14 App 0x0000000100100ea4 main (main.m:16)
15 libdyld.dylib 0x0000000193dd6a04 start + 0
Thread 1 name: Dispatch queue: com.apple.libdispatch-manager
Thread 1 Crashed:
0 libsystem_kernel.dylib 0x0000000193ed4c24 kevent64 + 8
1 libdispatch.dylib 0x0000000193db9e6c _dispatch_mgr_invoke + 272
2 libdispatch.dylib 0x0000000193dab998 _dispatch_mgr_thread + 48
Does this report means that the crash occured in the "hashWithSecretKeyUpdateUser" function call ?
Is there a way to know more about the crash ?
I wasn't able to get my App to crash at this point
It looks like "Segmentation fault"(SIGSEGV) which means your code accessing the memory that doesn't exist or invalid. According to your crash report, it looks like hashWithSecretKeyUpdateUser accessing wrong or invalid memory from "strlen + 12" which I believe string you are passing into hashWithSecretKeyUpdateUser is not exist or fault.

Xcode crash report KERN_INVALID_ADDRESS at 0x0000000100001da0

I'm having a tough time figuring this crash report sent to me by Apple. For some reason they keep telling me that my app crashes on start but I cannot recreate the crash after testing it on different devices. As I'm not sure what's causing it to crash and not being able to recreate the crash, I was wondering if anyone can help shed some light on what the problem could be?
And some extra info, I'm using AsyncImageView 1.5.1 and the Reachability class. I'm not sure if that could be the source of the crash?
Any help would be greatly appreciated. Thanks a lot!
OS Version: iOS 8.0.2 (12A405)
Report Version: 105
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000100001da0
Triggered by Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x0000000194c880b4 objc_retain + 20
1 MyApp 0x0000000100113274 0x1000f4000 + 127604
2 MyApp 0x0000000100111a84 0x1000f4000 + 121476
3 CoreFoundation 0x0000000184324430 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 16
4 CoreFoundation 0x00000001842637dc _CFXNotificationPost + 2056
5 Foundation 0x000000018515b6bc -[NSNotificationCenter postNotificationName:object:userInfo:] + 68
6 MyApp 0x000000010011099c 0x1000f4000 + 117148
7 Foundation 0x000000018524a7ec __NSThreadPerformPerform + 368
8 CoreFoundation 0x0000000184336320 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x00000001843355c4 __CFRunLoopDoSources0 + 260
10 CoreFoundation 0x0000000184333674 __CFRunLoopRun + 708
11 CoreFoundation 0x0000000184261660 CFRunLoopRunSpecific + 392
12 GraphicsServices 0x000000018d35f5a0 GSEventRunModal + 164
13 UIKit 0x0000000188b664f4 UIApplicationMain + 1484
14 MyApp 0x00000001000fab44 0x1000f4000 + 27460
15 libdyld.dylib 0x00000001952dea04 start + 0

Crash Report Meaning

I just got a crash report from Crashlytics of my app on AppStore.. the crash report is as follows..
Thread : Crashed: com.apple.main-thread
0 libsystem_kernel.dylib 0x3bbf1350 __pthread_kill + 8
1 libsystem_c.dylib 0x3bb67fb7 pthread_kill + 58
2 libsystem_c.dylib 0x3bba436b abort + 94
3 libc++abi.dylib 0x3b14cddf abort_message + 74
4 libc++abi.dylib 0x3b14a099 default_terminate() + 24
5 libobjc.A.dylib 0x3b6fda5b _objc_terminate() + 146
6 libc++abi.dylib 0x3b14a11b safe_handler_caller(void (*)()) + 78
7 libc++abi.dylib 0x3b14a1b4 std::terminate() + 19
8 libc++abi.dylib 0x3b14b62b __cxa_rethrow + 94
9 libobjc.A.dylib 0x3b6fd9b5 objc_exception_rethrow + 12
10 CoreFoundation 0x339532a1 CFRunLoopRunSpecific + 456
11 CoreFoundation 0x339530c9 CFRunLoopRunInMode
12 GraphicsServices 0x3753133b GSEventRunModal + 74
13 UIKit 0x3586f2b9 UIApplicationMain + 1120
14 TradeMate 0x000633d3 main (main.m:16)
Can anyone explain what it is?? cause its not giving anything…
Let me know if anything else is needed..
thanks in advance
All what you can see in this crash dump is that there was an uncaught exception which caused the application to terminate. You would need to look at the stacks of the other threads to get a clue. Also the rest of the crash report is important to see what actually caused the crash.
The crash reporting provided by apple usually contains a lot more details as just a stack. And the link provided by jnix (Demystifying iOS Application Crash Logs) is for sure a good help analysing such logs.
Nevertheless, often it's necessary that you can reproduce a crash in XCode to find out the actual reason for a crash.

Crash report.. any clue where to look for?

I'm receiving many iOS crash reports that look like copied below... Does anyone have any clue where to look for a resolution? It seems the crash occurs during launch, but it is not clear at all which method is responsible for it. I can also not reproduce it..
Thanks!
Hardware Model: iPhone4,1
Process: XXXXXX [499]
Path: /Users/USER/XXXX.app/XXXX
Identifier: XXXXXXX
Version: 16.1
Code Type: ARM
Parent Process: launchd [1]
Date/Time: 2013-10-26T00:14:55Z
OS Version: iPhone OS 7.0.2 (11A501)
Report Version: 104
Exception Type: SIGABRT
Exception Codes: #0 at 0x3a3d41fc
Crashed Thread: 0
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x3a3d41fc ___pthread_kill + 8
1 libsystem_c.dylib 0x3a384ffd _abort + 77
2 libc++abi.dylib 0x396b3cd7 abort_message + 75
3 libc++abi.dylib 0x396cc6e5 default_terminate_handler() + 253
4 libobjc.A.dylib 0x39e15921 _objc_terminate() + 193
5 libc++abi.dylib 0x396ca1c7 std::__terminate(void (*)()) + 79
6 libc++abi.dylib 0x396c9d2d ___cxa_increment_exception_refcount + 1
7 libobjc.A.dylib 0x39e157f7 _objc_exception_rethrow + 43
8 CoreFoundation 0x2f970d5d _CFRunLoopRunSpecific + 641
9 CoreFoundation 0x2f970acb _CFRunLoopRunInMode + 107
10 GraphicsServices 0x34691283 _GSEventRunModal + 139
11 UIKit 0x32212a41 _UIApplicationMain + 1137
12 XXXXXXX 0x000829d7 main (main.m:55)
The reason is that a Objective-C exception was thrown, caught, and then re-thrown. The original stacktrace is then lost unless you saved/logged it where you caught it.
Look for any place in your code where you catch Objective-C exceptions, and also look in any third party frameworks you might use.
Of course, first try to reproduce the problem in a debugger, where you set a breakpoint on all exceptions (click the little '+' icon down to the left in the Breakpoint tab in Xcode).

iPad app, will run in debug but adhoc crashes

Here is the crash log
Date/Time: 2011-02-10 21:12:00.478 +0900
OS Version: iPhone OS 4.2.1 (8C148)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
Thread 0 Crashed:
0 libSystem.B.dylib 0x30d7c2d4 __kill + 8
1 libSystem.B.dylib 0x30d7c2c4 kill + 4
2 libSystem.B.dylib 0x30d7c2b6 raise + 10
3 libSystem.B.dylib 0x30d90d72 abort + 50
4 libstdc++.6.dylib 0x34981a20 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x34a83594 _objc_terminate + 104
6 libstdc++.6.dylib 0x3497fdf2 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x3497fe46 std::terminate() + 10
8 libstdc++.6.dylib 0x3497ff16 __cxa_throw + 78
9 libobjc.A.dylib 0x34a824c4 objc_exception_throw + 64
10 CoreFoundation 0x3587c1a8 +[NSObject(NSObject) doesNotRecognizeSelector:] + 96
11 CoreFoundation 0x35823aa2 ___forwarding___ + 502
12 CoreFoundation 0x35823858 _CF_forwarding_prep_0 + 40
13 PictureDictionary 0x00005fe4 sgLoadFileImage(char const*, long*) (PictureDictionary.mm:41)
14 PictureDictionary 0x000061b0 CPictureDictionary::LoadPageData() (PictureDictionary.mm:814)
15 PictureDictionary 0x00006d02 CPictureDictionary::Update() (PictureDictionary.mm:505)
16 PictureDictionary 0x00003216 -[ES1Renderer render] (ES1Renderer.mm:63)
The line in my code where it starts to crash (with in stack trash #13 above) is
NSString* pStr = [[NSString alloc]
initWithUTF8String: pFileName];
For some reason it crashes here.
What is odd is that it runs fine in debug mode. But when I make a adhoc build and put it in the iPad through iTunes the above crash occurs.
I have cleaned and rebuilt many times, made sure my profiles and identifiers are correct.
I have no idea why this may be happening. Any insight or suggestions will help.
Thanks.
Sorry I'm no guru but maybe this will help a little.
This type of crash occurs when Cocoa cannot find the method you are invoking at runtime.
Normally you would receive a warning during compilation.
That said, it seems to be complaining that it cannot find an objective-C selector (method). However, sgLoadFileImage looks to me to be a C function.
For sure, something is different between your debug and release builds. Either the code is different, or the parameters supplied to the methods and functions.

Resources