iPhone App Rejected by Apple with crash report - can not reproduce - ios

I am totally at a loss on this crash report. I have several fairly complicated apps already in the store and recently submitted an update to one of them. I promptly received the response it had been rejected for crashing on startup. They are using exactly the same SDK version as me, 3.1.2. After symbolicating the stack trace, this is what was crashing:
Process: MyAppName [60]
Path: /var/mobile/Applications/0EC19245-D3A4-47D0-94D9-XXXXXXXXXX/MyAppName.app/MyAppName
Identifier: MyAppName
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2010-01-19 15:43:46.804 -0800
OS Version: iPhone OS 3.1.2 (7D11)
Report Version: 104
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread: 0
and this is the pertinent stack trace.
Thread 0 Crashed:
0 libSystem.B.dylib 0x0007e9ac __kill + 8
1 libSystem.B.dylib 0x0007e99c kill + 4
2 libSystem.B.dylib 0x0007e98e raise + 10
3 libSystem.B.dylib 0x0009363a abort + 34
4 libstdc++.6.dylib 0x000453b0 __gnu_cxx::__verbose_terminate_handler() + 376
5 libobjc.A.dylib 0x00005858 _objc_terminate + 104
6 libstdc++.6.dylib 0x00043776 __cxxabiv1::__terminate(void (*)()) + 46
7 libstdc++.6.dylib 0x000437ca std::terminate() + 10
8 libstdc++.6.dylib 0x00043896 __cxa_throw + 74
9 libobjc.A.dylib 0x00004714 objc_exception_throw + 64
10 Foundation 0x000013c2 __NSThreadPerformPerform + 570
11 CoreFoundation 0x00056a96 CFRunLoopRunSpecific + 1834
12 CoreFoundation 0x00056356 CFRunLoopRunInMode + 42
13 GraphicsServices 0x00003cb8 GSEventRunModal + 108
14 GraphicsServices 0x00003d64 GSEventRun + 56
15 UIKit 0x00002768 -[UIApplication _run] + 384
16 UIKit 0x0000146c UIApplicationMain + 688
17 MyAppName 0x0000ed6a main (main.m:13)
18 MyAppName 0x000028e4 start + 44
To me that stacktrace is near useless, it just says a component crashed when we started your app yet I can not reproduce it on a similar system (the only difference being they are running Snow Leopard and I am just running Leopard).
Any suggestions as to what I could next? Thanks.

If you are running Snow Leopard, turn on the Static Analyzer in your project.
Turn on NSZombieEnabled
http://www.frogameleon.com/blog/last-night-an-iphone-zombie-nszombieenabled-saved-my-life
Review the other Debugging docs and use the tools Apple provides.
http://developer.apple.com/iphone/library/documentation/Xcode/Conceptual/iphone_development/130-Debugging_Applications/debugging_applications.html

Actually it doesn't say a component crashed when you started the app. The crash may have happened at any point.
What it does say though, is that it crashed in NSThreadPerform, which seems like you were trying to call performSelector on either an object that no longer existed, or possibly against an object that did not have the method you were trying to invoke.
So I'd look for anywhere you use performSelector on the main thread, and try and think from there how the target could be invalid.

Related

IOS crash report

I have device logs crash report from iPhone .How to find the exact reason from my crash report. IOS version 8.3 This is not a reproducible crash.It occurs rarely and no specific senario. Pelase help me to find out.I have build this IOS app in appcelerator platform.
Incident Identifier: 3DCFCFFB-4F05-4F88-B227-21C6BEF1066A
CrashReporter Key: a01734574dac253357853c43788d42f540be2749
Hardware Model: iPhone7,2
Process: CAST [320]
Path: /private/var/mobile/Containers/Bundle/Application/A78C6B56-1ED0-4D07-8857-B3D154779EBF/CAST.app/CAST
Identifier: com.ca.tridentapp
Version: 1.2.1.0 (1.2.1)
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
Date/Time: 2016-05-31 12:26:54.357 +0530
Launch Time: 2016-05-31 11:59:41.463 +0530
OS Version: iOS 8.3 (12F70)
Report Version: 105
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Triggered by Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x18224c2d8 0x182124000 + 1213144
1 libobjc.A.dylib 0x193a700e4 0x193a68000 + 32996
2 CoreFoundation 0x18224bc8c 0x182124000 + 1211532
3 CAST 0x1000e6988 -[TiApp flushCompletionHandlerQueue] (TiApp.m:569)
4 CAST 0x1000e7d4c -[TiApp applicationWillEnterForeground:] (TiApp.m:911)
5 UIKit 0x186ef9f48 0x186c7c000 + 2613064
6 UIKit 0x186f256fc 0x186c7c000 + 2791164
7 UIKit 0x186f24dfc 0x186c7c000 + 2788860
8 UIKit 0x186f24d54 0x186c7c000 + 2788692
9 UIKit 0x186f17fe0 0x186c7c000 + 2736096
10 FrontBoardServices 0x18aa553c8 0x18aa3c000 + 103368
11 CoreFoundation 0x18220427c 0x182124000 + 918140
12 CoreFoundation 0x182203384 0x182124000 + 914308
13 CoreFoundation 0x1822019a8 0x182124000 + 907688
14 CoreFoundation 0x18212d2d4 0x182124000 + 37588
15 GraphicsServices 0x18b9436fc 0x18b938000 + 46844
16 UIKit 0x186cf2fac 0x186c7c000 + 487340
17 CAST 0x100022aec main (main.m:37)
18 libdyld.dylib 0x1940eea08 0x1940ec000 + 10760
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x0000000194207270 0x1941ec000 + 111216
1 libsystem_pthread.dylib 0x00000001942a516c 0x1942a0000 + 20844
2 libsystem_c.dylib 0x000000019417eb14 0x19411c000 + 404244
3 libc++abi.dylib 0x000000019323d414 0x19323c000 + 5140
4 libc++abi.dylib 0x000000019325cb88 0x19323c000 + 134024
5 libobjc.A.dylib 0x0000000193a703bc 0x193a68000 + 33724
6 CAST 0x00000001005bf7f4 CPPExceptionTerminate() (KSCrashSentry_CPPException.mm:193)
7 libc++abi.dylib 0x0000000193259bb0 0x19323c000 + 121776
8 libc++abi.dylib 0x0000000193259738 0x19323c000 + 120632
9 libobjc.A.dylib 0x0000000193a70290 0x193a68000 + 33424
10 CoreFoundation 0x000000018212d380 0x182124000 + 37760
11 GraphicsServices 0x000000018b9436f8 0x18b938000 + 46840
12 UIKit 0x0000000186cf2fa8 0x186c7c000 + 487336
13 CAST 0x0000000100022ae8 main (main.m:37)
14 libdyld.dylib 0x00000001940eea04 0x1940ec000 + 10756
Thanks in Advance
I suggest you can do two things:
You could integrate a 3rd party crash reporting library such as Instabug which will help you get more details about the type of device, software version, CPU load, memory usage, and connectivity. All of which are important factors when it comes to debugging and reproducing the crash.
The crash report is not symbolicated. You first have to locate your project’s dSYM file. Type the line below in terminal so you can locate the file.
mdfind "com_apple_xcode_dsym_uuids == your-UUID-here"
You can find your UUID written on top of the Instabug dashboard.
You can then upload your dSYM file through the dashboard to get symbolicated crashes that are more comprehensible.
For full disclosure, I work at Instabug. Let me know if I can help.

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

Crash on iOS when system purges memory and closes a UIViewController

My application is crashing when one of the views is purged from memory because of low-memory condition. At least this is what I understand from the crashlog. It happens on numerous screens but only when opening a Facebook dialog (using the Facebook SDK). Basically, looks like the system sometimes runs out of memory when we need to present a Facebook dialog (e.g. to let user post something on the Facebook timeline).
Date/Time: 2012-03-14 19:47:33.819 +0000
OS Version: iPhone OS 5.1 (9B176)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x30000008
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x30f2bf78 objc_msgSend + 16
1 MyApp 0x00003c0e -LTBaseViewController viewDidUnload (LTBaseViewController.m:145)
2 MyApp 0x00004ea2 -LTBaseTableViewController viewDidUnload (LTBaseTableViewController.m:90)
3 UIKit 0x33766bd8 -[UIViewController unloadViewForced:] + 244
4 UIKit 0x338ae492 -[UIViewController purgeMemoryForReason:] + 58
5 Foundation 0x3071a4f8 __57-NSNotificationCenter addObserver:selector:name:object:_block_invoke_0 + 12
6 CoreFoundation 0x30e95540 ___CFXNotificationPost_block_invoke_0 + 64
7 CoreFoundation 0x30e21090 _CFXNotificationPost + 1400
8 Foundation 0x3068e3e4 -NSNotificationCenter postNotificationName:object:userInfo: + 60
9 Foundation 0x3068fc14 -NSNotificationCenter postNotificationName:object: + 24
10 UIKit 0x3387926a -UIApplication _performMemoryWarning + 74
11 UIKit 0x33879364 -UIApplication _receivedMemoryNotification + 168
12 libdispatch.dylib 0x36a12252 _dispatch_source_invoke + 510
13 libdispatch.dylib 0x36a0fb1e _dispatch_queue_invoke$VARIANT$up + 42
14 libdispatch.dylib 0x36a0fe64 _dispatch_main_queue_callback_4CF$VARIANT$up + 152
15 CoreFoundation 0x30e9c2a6 __CFRunLoopRun + 1262
16 CoreFoundation 0x30e1f49e CFRunLoopRunSpecific + 294
17 CoreFoundation 0x30e1f366 CFRunLoopRunInMode + 98
18 GraphicsServices 0x33fb6432 GSEventRunModal + 130
19 UIKit 0x336f5e76 UIApplicationMain + 1074
20 MyApp 0x00004818 main (main.m:16)
21 MyApp 0x000023b4 0x1000 + 5044
I checked and there are almost no memory leaks, e.g. when testing the app for an hour the total memory leaked was around 2-3Kb caused by some string-copying libraries. So I don't believe this is caused by the application. I guess that when the phone is not restarted for some time there are applications running in the background and when using Facebook SDK the memory becomes a problem and the system tries to recover the memory from random applications, including my application.
My question is, how can I prevent this crash from happening? How should I handle unloadViewForced on a view controller to make the app more robust in low-memory conditions? And lastly, am I right that this crashlog suggests the crash occurred because the system tried to free memory and my application didn't handle it properly?
Any help greatly appreciated.
What is most likely happening is that one of the objects being referred to and probably being released by LTBaseViewController viewDidUnload method is being doubly released. In fact, since the backtrace indicates that the crash is happing on line 145 of LTBaseViewController.m you should be able to quickly see which object is the culprit.

Someone please help understand a crash?

An iPhone app is crashing on the device but not on the simulator. So I'm trying to learn how to interpret the crash log. I read lots of forum posts saying that the symbolicated crash log shows a back trace that gives the method and line number of the calls leading to the crash but I don't see anything useful. Maybe I'm not looking at the symbolicated crash log. Here is the beginning of what I see:
Incident Identifier: 432A8974-1661-409F-B5A6-970148550A46
CrashReporter Key: db93147c0a70a5f4c60dc92f826e72d5a74477c8
Hardware Model: iPhone3,3
Process: Darken [57959]
Path: /var/mobile/Applications/CB27C10F-CD3B-4148-8321-2C251888B27B/Darken.app/Darken
Identifier: Darken
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]
Date/Time: 2012-02-25 10:43:47.753 -0500
OS Version: iPhone OS 4.2.10 (8E600)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008
Crashed Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x32716464 objc_msgSend + 16
1 UIKit 0x3245e6fe -[UIScrollView(UIScrollViewInternal) _scrollViewAnimationEnded] + 90
2 CoreFoundation 0x32071bb8 -[NSObject(NSObject) performSelector:withObject:] + 16
3 UIKit 0x3245e5b8 -[UIAnimator stopAnimation:] + 276
4 UIKit 0x323efbf2 -[UIAnimator(Static) _advance:] + 214
5 UIKit 0x323efb0e LCDHeartbeatCallback + 10
6 GraphicsServices 0x35474362 HeartbeatVBLCallback + 86
7 IOMobileFramebuffer 0x34739bf4 IOMobileFramebufferVsyncNotifyFunc + 68
8 IOKit 0x348e5e64 IODispatchCalloutFromCFMessage + 192
9 CoreFoundation 0x32070be0 __CFMachPortPerform + 204
10 CoreFoundation 0x320686f8 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
11 CoreFoundation 0x320686bc __CFRunLoopDoSource1 + 160
12 CoreFoundation 0x3205af76 __CFRunLoopRun + 514
13 CoreFoundation 0x3205ac80 CFRunLoopRunSpecific + 224
14 CoreFoundation 0x3205ab88 CFRunLoopRunInMode + 52
15 GraphicsServices 0x354724a4 GSEventRunModal + 108
16 GraphicsServices 0x35472550 GSEventRun + 56
17 UIKit 0x323c7d1a -[UIApplication _run] + 406
18 UIKit 0x323c5884 UIApplicationMain + 664
19 Darken 0x000029d6 0x1000 + 6614
20 Darken 0x00002998 0x1000 + 6552
... Threads other than 0 listed here
Is anything here useful for finding out which line of my code led to the crash? Darken is the name of the application -- I already knew that. The only method name I recognize is UIApplicationMain but the crash didn't happen when the app was first launched -- I was running it about a minute and doing dozens of functions before the crash.
You may want to try and set NSZombieEnabled to YES in your project and let it crash with your device running in debug. It should stop at the line of code causing your crash. Your error looks like it is an EXC_BAD_ACCESS which usually means you were trying to access some deallocated memory.
You won't get a line number from a crash dump (unless you compiled your app with -g and run in GDB, but I doubt it since you don't seem to know what these are at all).
You ARE looking at the symbolicated crash dump: you DO have the names of the functions in the call stack. The crash occurs in the last called (topmost) function, which is objc_msgSend. That means you're not properly balancing your alloc/retain/copy methods with autorelease/release, and the messenger function tries to access already freed/corrupted/nonexistent memory, hence the crash (EXC_BAD_ACCESS is similar to a segfault, in fact you'll get one of these when you make such a mistake).
So my advice is, triple check your code for method calls modifying the reference count.

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