xcode instruments causing app crash - crash

I am using xcode Instruments to track Allocations and Leaks. My app is crashing though. It does not crash when running the regular debug or release builds standalone, only when under Instruments:
Any thoughts ideas very gratefully received....
Exception Type: EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0002b2e0
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x34499c96 objc_msgSend + 14
1 ZZZ Test Suite 0x000a3d74 0x95000 + 60788
2 CoreFoundation 0x308e4c3c -[NSObject(NSObject) release] + 24
3 CoreFoundation 0x308e519a CFRelease + 62
4 CoreFoundation 0x308e7eb4 _CFAutoreleasePoolPop + 140
5 Foundation 0x341b41c4 -[NSAutoreleasePool release] + 92
6 UIKit 0x309e5f08 _UIApplicationHandleEvent + 5784
7 GraphicsServices 0x30269e70 PurpleEventCallback + 660
8 CoreFoundation 0x30957a90 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 20
9 CoreFoundation 0x30959838 __CFRunLoopDoSource1 + 160
10 CoreFoundation 0x3095a606 __CFRunLoopRun + 514
11 CoreFoundation 0x308eaebc CFRunLoopRunSpecific + 224
12 CoreFoundation 0x308eadc4 CFRunLoopRunInMode + 52
13 GraphicsServices 0x30269418 GSEventRunModal + 108
14 GraphicsServices 0x302694c4 GSEventRun + 56
15 UIKit 0x30a10d62 -[UIApplication _run] + 398
16 UIKit 0x30a0e800 UIApplicationMain + 664
17 ZZZ Test Suite 0x0009665c 0x95000 + 5724
18 ZZZ Test Suite 0x00096604 0x95000 + 5636

Try running it through the analyser first. You can run it from xcode from the |product| menu then select Analyze. It's a static analyser (clang) that analyses your code when it builds so any problems causing your code to crash at runtime could well be visible through static analysis. Give it a try and fix any problems it throws up then try instruments again.

As a complement to what Ian says above:
set the Environment variable "NSZombieEnabled" to YES
and you will hopefully have a more informative fail.
(In XCode 4 the Environment Variables is found under "Edit Scheme" and select "Debug")

Related

objc_msgSend iphone application crash

Crash Report :
> Thread : Crashed: com.apple.main-thread 0 libobjc.A.dylib
> 0x306bdf46 objc_msgSend + 5 1 libAVFAudio.dylib
> 0x21ac3e71 -[AVAudioSession privateBeginInterruption] + 52 2
> Foundation 0x23bb8d6f __NSThreadPerformPerform +
> 386 3 CoreFoundation 0x22e70377
> __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 14 4 CoreFoundation 0x22e6f819 __CFRunLoopDoSources0 + 364
> 5 CoreFoundation 0x22e6dded __CFRunLoopRun + 772 6
> CoreFoundation 0x22dbc211 CFRunLoopRunSpecific + 476 7
> CoreFoundation 0x22dbc023 CFRunLoopRunInMode + 106 8
> GraphicsServices 0x2a16f0a9 GSEventRunModal + 136 9
> UIKit 0x263c81d1 UIApplicationMain + 1440 10
> HIIT GURU 0x000d7377 main (main.m:16)
I am getting this crash randomly. I tried to check each line of code but i couldn't find any solution. Please suggest something to solve this. I am getting this crash in ios8.1 only.
This often occurs when the reference to the receiving object gets invalid.
Start with a static analysis of your code. Most of the times you can let Xcode do it for you through the Product -> Analyze tool. Also try enabling zombie objects while debugging through editing the current scheme going through Product -> Scheme -> Edit Scheme and check the appropriate box in the Diagnostics tab. Once enabled you have to wait for the crash to occur again if you don't know how to reproduce.

Adhoc build is crashing not debug build

EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0xa151830c
Triggered by Thread: 0
Thread 0 Crashed:
0 libobjc.A.dylib 0x3b766b26 objc_msgSend + 6
1 Foundation 0x31e31386 __NSFireDelayedPerform + 410
2 CoreFoundation 0x314220dc __CFRUNLOOP_IS_CALLING_OUT_TO_A_TIMER_CALLBACK_FUNCTION__ + 12
3 CoreFoundation 0x31421cf2 __CFRunLoopDoTimer + 778
4 CoreFoundation 0x3142008e __CFRunLoopRun + 1206
5 CoreFoundation 0x3138ac22 CFRunLoopRunSpecific + 518
6 CoreFoundation 0x3138aa06 CFRunLoopRunInMode + 102
7 GraphicsServices 0x3607a27e GSEventRunModal + 134
8 UIKit 0x33c2e044 UIApplicationMain + 1132
9 deBodas 0x000d5c6e main (main.m:16)
10 deBodas 0x000c53fc ___lldb_unnamed_function1$$deBodas + 36
This is crash log when i install the build .It is happend when install the build adhoc not a debug build
When i install build through system it is not happend.Any body knows please help me
I am struck this issue last three days.

iphone application crash on replacing the video files

I only replace the video files in my existing code, but if i replace all the video files my application will crash in iphone. it is an universal application but Ipad support all the new video files and crash on iphone. the following warning occur:
[NSCFType setLength:]: unrecognized selector sent to instance
0x19d790 2012-02-29 15:13:49.932[584:307] * Terminating app due to
uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFType
setLength:]: unrecognized selector sent to instance 0x19d790'
* Call stack at first throw: ( 0 CoreFoundation 0x3759dc7b __exceptionPreprocess + 114 1 libobjc.A.dylib
0x32d9bee8 objc_exception_throw + 40 2 CoreFoundation
0x3759f3e3 -[NSObject(NSObject) doesNotRecognizeSelector:] + 98 3
CoreFoundation 0x37544467 __forwarding + 506
4 CoreFoundation 0x37544220
_CF_forwarding_prep_0 + 48 5 Visionaries 0x00005179 -[Visionaries_ViewController
connection:didReceiveResponse:] + 56 6 Foundation
0x35183cd5 -[NSURLConnection(NSURLConnectionReallyInternal)
sendDidReceiveResponse:] + 92 7 Foundation
0x35183c3b _NSURLConnectionDidReceiveResponse + 86 8 CFNetwork
0x302941b4
_ZN19URLConnectionClient29_clientSendDidReceiveResponseEP14_CFURLResponsePNS_26ClientConnectionEventQueueE
+ 64 9 CFNetwork 0x30284bc8 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl
+ 332 10 CFNetwork 0x30284d84 _ZN19URLConnectionClient26ClientConnectionEventQueue33processAllEventsAndConsumePayloadEP20XConnectionEventInfoI12XClientEvent18XClientEventParamsEl
+ 776 11 CFNetwork 0x30284984 _ZN19URLConnectionClient13processEventsEv + 100 12 CFNetwork 0x3028484c _ZN17MultiplexerSource7performEv + 192 13 CFNetwork
0x30284788 _ZN17MultiplexerSource8_performEPv + 12 14 CoreFoundation
0x375518d1 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION
+ 14 15 CoreFoundation 0x37521ecd __CFRunLoopDoSources0 + 384 16 CoreFoundation 0x375216f9 __CFRunLoopRun + 264 17 CoreFoundation
0x3752150b CFRunLoopRunSpecific + 226 18 CoreFoundation
0x37521419 CFRunLoopRunInMode + 60 19 GraphicsServices
0x33e76d24 GSEventRunModal + 196 20 UIKit
0x3591d57c -[UIApplication _run] + 588 21 UIKit
0x3591a558 UIApplicationMain + 972 22 Visionaries
0x00002391 main + 80 23 Visionaries
0x0000233c start + 40 ) terminate called after throwing an instance of
'NSException'
Somebody has an idea, please help.
By the crash log we see that, inside -[Visionaries_ViewController connection:didReceiveResponse:], you are calling the method setLength: on an object that does not have that method.
Can be a memory or logic problem. Please provide more info.

iOS5 - KERN_INVALID_ADDRESS in crash log

I need your help to understand what's going on in this crash log for my app on iPhone 4S.
Date/Time: 2011-10-23 07:51:33.669 -0700
OS Version: iPhone OS 5.0 (9A334)
Report Version: 104
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0xc0000008
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x3205afbc objc_msgSend + 16
1 UIKit 0x31a19b68 -[UIAnimator stopAnimation:] + 412
2 UIKit 0x31a195d4 -[UIAnimator(Static) _advance:withTimestamp:] + 260
3 UIKit 0x31a194c6 -[UIAnimator(Static) _LCDHeartbeatCallback:] + 46
4 QuartzCore 0x3166441c CA::Display::DisplayLink::dispatch(unsigned long long, unsigned long long)+ 160
5 QuartzCore 0x31664372 CA::Display::IOMFBDisplayLink::callback(__IOMobileFramebuffer*, unsigned long long, unsigned long long, unsigned long long, void*) + 54
6 IOMobileFramebuffer 0x32c58f8c IOMobileFramebufferVsyncNotifyFunc + 76
7 IOKit 0x34ea188a IODispatchCalloutFromCFMessage + 182
8 CoreFoundation 0x36cb9f3c __CFMachPortPerform + 356
9 CoreFoundation 0x36cc454c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
10 CoreFoundation 0x36cc44ee __CFRunLoopDoSource1 + 134
11 CoreFoundation 0x36cc333c __CFRunLoopRun + 1364
12 CoreFoundation 0x36c464d6 CFRunLoopRunSpecific + 294
13 CoreFoundation 0x36c4639e CFRunLoopRunInMode + 98
14 GraphicsServices 0x32921fe6 GSEventRunModal + 150
15 UIKit 0x318f673c UIApplicationMain + 1084
16 MyAppPro 0x0000214a main (main.m:13)
17 MyAppPro 0x00002108 start + 32
This link to a discussion in Developer Forums seems to imply bad hardware!?
A little confused!
Thanks.
Your question is a dupe of many other questions that involve EXC_BAD_ACCESS crashes.
Like this one:
how to understand Crash Log of iPhone
Why not step through your program and see if you can isolate where the crash is triggered?
The article you linked is talking about a Macintosh error with Safari, totally different than what you are experiencing.

xcode 4 iOS 4.3 project template doesn't work

I'm trying to create a multi-view iOS (4.3) application in xcode 4 using the view-based application template but have so far had no luck. Everything builds but then crashes without error, with me getting the message SIGABRT in the line "int retVal = UIApplicationMain(argc, argv, nil, nil);" in supporting file-> main.m
The same thing happens in both my application and the plain (view-based application ) template from xcode.
Any ideas what the problem might be?
Here's the log:
GNU gdb 6.3.50-20050815 (Apple version gdb-1518) (Sat Feb 12 02:52:12 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".Attaching to process 3884.
2011-03-15 18:18:16.226 Server-sideStory[3884:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'UISplitViewController is only supported when running under UIUserInterfaceIdiomPad'
*** Call stack at first throw:
(
0 CoreFoundation 0x00dc45a9 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x00f18313 objc_exception_throw + 44
2 CoreFoundation 0x00d7cef8 +[NSException raise:format:arguments:] + 136
3 CoreFoundation 0x00d7ce6a +[NSException raise:format:] + 58
4 UIKit 0x0031d512 -[UISplitViewController _commonInit] + 165
5 UIKit 0x0031d971 -[UISplitViewController initWithCoder:] + 92
6 Foundation 0x00784c24 _decodeObjectBinary + 3296
7 Foundation 0x00783d91 _decodeObject + 224
8 UIKit 0x00211979 -[UIRuntimeConnection initWithCoder:] + 212
9 Foundation 0x00784c24 _decodeObjectBinary + 3296
10 Foundation 0x007859f5 -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:] + 1354
11 Foundation 0x00786024 -[NSArray(NSArray) initWithCoder:] + 596
12 Foundation 0x00784c24 _decodeObjectBinary + 3296
13 Foundation 0x00783d91 _decodeObject + 224
14 UIKit 0x00210c36 -[UINib instantiateWithOwner:options:] + 804
15 UIKit 0x00212ab7 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
16 UIKit 0x0001817a -[UIApplication _loadMainNibFile] + 172
17 UIKit 0x00018cf4 -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 291
18 UIKit 0x00023617 -[UIApplication handleEvent:withNewEvent:] + 1533
19 UIKit 0x0001babf -[UIApplication sendEvent:] + 71
20 UIKit 0x00020f2e _UIApplicationHandleEvent + 7576
21 GraphicsServices 0x00ffd992 PurpleEventCallback + 1550
22 CoreFoundation 0x00da5944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
23 CoreFoundation 0x00d05cf7 __CFRunLoopDoSource1 + 215
24 CoreFoundation 0x00d02f83 __CFRunLoopRun + 979
25 CoreFoundation 0x00d02840 CFRunLoopRunSpecific + 208
26 CoreFoundation 0x00d02761 CFRunLoopRunInMode + 97
27 UIKit 0x000187d2 -[UIApplication _run] + 623
28 UIKit 0x00024c93 UIApplicationMain + 1160
29 Server-sideStory 0x00002719 main + 121
30 Server-sideStory 0x00002695 start + 53
)
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all
Current language: auto; currently objective-c
It's telling you that UISplitViewController is not supported on the iPhone - only works on the iPad.