iOS crash reports not get the correct line number - iphone

i want to look my mistake line of my app:
0 CoreFoundation 0x36e008a7 __exceptionPreprocess + 186
1 libobjc.A.dylib 0x33217259 objc_exception_throw + 32
2 CoreFoundation 0x36e00789 +[NSException raise:format:] + 0
3 CoreFoundation 0x36e007ab +[NSException raise:format:] + 34
4 Foundation 0x32a8e5b3 +[NSJSONSerialization JSONObjectWithData:options:error:] + 66
5 myshine 0x001f68d1 _mh_execute_header + 1046737
6 myshine 0x000fb27b _mh_execute_header + 17019
7 UIKit 0x35009cab -[UIApplication _callInitializationDelegatesForURL:payload:suspended:] + 1182
8 UIKit 0x350037dd -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 408
9 UIKit 0x34fd1ac3 -[UIApplication handleEvent:withNewEvent:] + 1010
10 UIKit 0x34fd1567 -[UIApplication sendEvent:] + 54
11 UIKit 0x34fd0f3b _UIApplicationHandleEvent + 5826
12 GraphicsServices 0x34f1e22b PurpleEventCallback + 882
13 CoreFoundation 0x36dd4523 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 38
14 CoreFoundation 0x36dd44c5 __CFRunLoopDoSource1 + 140
15 CoreFoundation 0x36dd3313 __CFRunLoopRun + 1370
16 CoreFoundation 0x36d564a5 CFRunLoopRunSpecific + 300
17 CoreFoundation 0x36d5636d CFRunLoopRunInMode + 104
18 UIKit 0x3500286b -[UIApplication _run] + 550
19 UIKit 0x34fffcd5 UIApplicationMain + 1080
20 myshine 0x000faa33 _mh_execute_header + 14899
21 myshine 0x000f9270 _mh_execute_header + 8816
mac04:skydrive pwang$ dwarfdump --uuid myshine.app.dSYM
UUID: DEB2D948-0339-31BF-B3A3-CE21B73171AC (armv7) myshine.app.dSYM/Contents/Resources/DWARF/myshine
UUID: 90212FF0-80ED-3083-9DFB-FC883F1EDBD0 (armv7s) myshine.app.dSYM/Contents/Resources/DWARF/myshine
mac04:skydrive pwang$ dwarfdump --uuid myshine.app/myshine
UUID: DEB2D948-0339-31BF-B3A3-CE21B73171AC (armv7) myshine.app/myshine
UUID: 90212FF0-80ED-3083-9DFB-FC883F1EDBD0 (armv7s) myshine.app/myshine
mac04:skydrive pwang$ /Applications/Xcode.app/Contents/Developer/usr/bin/atos -arch armv7 -o myshine.app/myshine 0x001f68d1
0x001f68d1 (in myshine)
it give me the 0x001f68d1,not the mistake line. can you tell me what should i do can get the correct line

Here are some links to how you can do attempt to read that crash report:
Symbolicating iPhone App Crash Reports
Ray Wenderlich tutorial HERE
That being said, sometimes you will not get the correct line for an error in your project. For example if you have instantiated a an unretained pointer for an object and something else tries to point to it after the retain count is zero, that will cause an error (bad access), but in reality the place where that bad access crash happens is not the place where the issue is (the declaration of the pointer). My first step (usually before trying to analyze the crash report, unless it is obvious), is to set a break point and then step through the code until the app crashes. You can also use break points and customize them to continue while sending output to the debugger or playing a sound, etc. See THIS tutorial for some info on debugging techniques.

Logs suggest that NSJSONSerialization is raising an exception. Write a try-catch block and put the exception causing code in it. Print the exception details, and you will come to know the issue.
You can also add a breakpoint for objc_exception_throw and +[NSException raise:format:] and debug the code. When the error condition occurs you will be able to trace the chain of events that caused this error. Refer to this link to see how to add these breakpoints.

Related

iPad app crashes on launch

I have an app which seems to work fine in debug mode, but now it's live in the app store it crashes every time. I have managed to find a crash log, which shows the following:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Crashed Thread: 0
Last Exception Backtrace:
0 CoreFoundation 0x3238329e __exceptionPreprocess + 158
1 libobjc.A.dylib 0x3a22e97a objc_exception_throw + 26
2 UIKit 0x3451837c +[UIStoryboard storyboardWithName:bundle:] + 436
3 UIKit 0x3435a58e -[UIApplication _loadMainStoryboardFileNamed:bundle:] + 38
4 UIKit 0x341e379c -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 524
5 UIKit 0x3418bc34 -[UIApplication handleEvent:withNewEvent:] + 1000
6 UIKit 0x3418b6c8 -[UIApplication sendEvent:] + 68
7 UIKit 0x3418b116 _UIApplicationHandleEvent + 6150
8 GraphicsServices 0x35e9659e _PurpleEventCallback + 586
9 GraphicsServices 0x35e961ce PurpleEventCallback + 30
10 CoreFoundation 0x3235816e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 30
11 CoreFoundation 0x32358112 __CFRunLoopDoSource1 + 134
12 CoreFoundation 0x32356f94 __CFRunLoopRun + 1380
13 CoreFoundation 0x322c9eb8 CFRunLoopRunSpecific + 352
14 CoreFoundation 0x322c9d44 CFRunLoopRunInMode + 100
15 UIKit 0x341e2480 -[UIApplication _run] + 664
16 UIKit 0x341df2fc UIApplicationMain + 1116
Does anyone know what this means? I really need to submit an update for this app quickly so I need to fix it.
One great place to start is this link:
http://www.raywenderlich.com/23704/demystifying-ios-application-crash-logs
It will show you how to read your crash log.
For instance EXC_CRASH (SIGABRT) means:
The exception code is a SIGABRT. Usually, a SIGABRT exception is raised when an object receives an unimplemented message. Or to put it in simpler terms, there’s a call for a nonexistent method on an object.
This should give you a hint as to what the problem is. It's not in your code as you can see that your classes are not called in the list to the right.
I would also say that if it doesn't work in the app store you might make sure that it works for all languages on Ad-Hoc. Maybe something is missing from your storyboard?
Check the storyboard names. Make sure you have a main storyboard selected for ipad and that the name matches.

How to read this iphone app crash log

My app (named MyLittleApplication) crashes randomly when I click on a button that pops view controller.
I could use some help (to find out where should I start looking) with crash log:
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x600332e0
Crashed Thread: 0
Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x351faf78 objc_msgSend + 16
1 Foundation 0x37d0a74c NSKVOPendingNotificationCreate + 216
2 Foundation 0x37d0a652 NSKeyValuePushPendingNotificationPerThread + 62
3 Foundation 0x37cfc744 NSKeyValueWillChange + 408
4 Foundation 0x37cd3848-[NSObject(NSKeyValueObserverNotification) willChangeValueForKey:] + 176
5 Foundation 0x37d55a14 _NSSetPointValueAndNotify + 76
6 UIKit 0x311f825a -[UIScrollView(Static) _adjustContentOffsetIfNecessary] + 1890
7 UIKit 0x31215a54 -[UIScrollView setFrame:] + 548
8 UIKit 0x31215802 -[UITableView setFrame:] + 182
9 POViO 0x000fcac8 0xf8000 + 19144
10 UIKit 0x31211b8e -[UIViewController _setViewAppearState:isAnimating:] + 138
11 UIKit 0x3126b8a8 -[UIViewController beginAppearanceTransition:animated:] + 184
12 UIKit 0x3121490c -[UINavigationController _startTransition:fromViewController:toViewController:] + 832
13 UIKit 0x312144fc -[UINavigationController _startDeferredTransitionIfNeeded] + 244
14 UIKit 0x3125e8e4 _popViewControllerNormal + 184
15 UIKit 0x3125e712 -[UINavigationController _popViewControllerWithTransition:allowPoppingLast:] + 386
16 UIKit 0x31242bba -[UINavigationController popToViewController:transition:] + 626
17 POViO 0x001074e6 0xf8000 + 62694
18 CoreFoundation 0x374553f6 -[NSObject performSelector:withObject:withObject:] + 46
19 UIKit 0x311eae00 -[UIApplication sendAction:to:from:forEvent:] + 56
20 UIKit 0x311eadbc -[UIApplication sendAction:toTarget:fromSender:forEvent:] + 24
21 UIKit 0x311ead9a -[UIControl sendAction:to:forEvent:] + 38
22 UIKit 0x311eab0a -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 486
23 UIKit 0x311eb442 -[UIControl touchesEnded:withEvent:] + 470
24 UIKit 0x311e9924 -[UIWindow _sendTouchesForEvent:] + 312
25 UIKit 0x311e9312 -[UIWindow sendEvent:] + 374
26 UIKit 0x311cf68e -[UIApplication sendEvent:] + 350
27 UIKit 0x311cef34 _UIApplicationHandleEvent + 5820
28 GraphicsServices 0x33c11224 PurpleEventCallback + 876
29 CoreFoundation 0x374cf51c __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 32
30 CoreFoundation 0x374cf4be __CFRunLoopDoSource1 + 134
31 CoreFoundation 0x374ce30c __CFRunLoopRun + 1364
32 CoreFoundation 0x3745149e CFRunLoopRunSpecific + 294
33 CoreFoundation 0x37451366 CFRunLoopRunInMode + 98
34 GraphicsServices 0x33c10432 GSEventRunModal + 130
35 UIKit 0x311fdcce UIApplicationMain + 1074
36 MyLittleApplication 0x000f90ae 0xf8000 + 4270
37 MyLittleApplication 0x000f9048 0xf8000 + 4168
I suspect that it has something to do with notificationCenter and UIDeviceOrientationDidChangeNotifications I use. Is this true or am I looking in the wrong direction?
I am calling
[notificationCenter removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil]
in viewDidUnload, this shuld be enough?
Can you please tell me what bug should i start looking for?
This is a stacktrace you see the stack of methods called when the crash happened.
You start at the bottom and work yourself up to the top and search for a method call from your app (the stacktrace includes calls from the frameworks too (e.g. -[UIScrollView(Static) _adjustContentOffsetIfNecessary])).
The topmost method call from your app is likely the cause of your error and you can see what the system tried afterwards.
In your case it seems that you call popToViewController and the iOS frameworks try to animate the transition from one UIViewController to the next. There seems to be a problem for the table view to set its frame and scroll to the contentOffset.
This is likely to be caused by a memory error. You get this hint by examining Exception Type: EXC_BAD_ACCESS (SIGSEGV)
EXC_BAD_ACCESS is likely a hint that you try to acces a something which is no more in the memory -> already released.
In general I would recomment to activate exveption breakpoints in Xcode:
Have you set the exception breakpoint?
got to breakpoint editor pane
click on the x in the bottom left corner
choose add exception breakpoint
Now you should see a stacktrace if an exception occurs. And Xcode should be at the line where the crash happens.
The second thing you should get familiar with is the zombie mode in Instruments.
You can find a good introduction to the zombi mode in this video.
In your case, you can see you have a EXC_BAD_ACCESS (SIGSEGV). This means you're trying to access something which isn't here, or at least was here but isn't anymore. If you can replicate the error, try using the Zombies mode of Instruments, it will tell will which thing it was expecting to access. The solution to this problem is often that you released the resource too early a resource you still need.
You might want to throw some NSLog statements in the methods just so you can have an idea of where things are going wrong. Sometimes those iOS messages can be a little cryptic.

iPhone app crash with unknown error

I am developing an application to take photos and upload the photos to remote server.
I have customized camera view using overlay view. App allows to take more than 1 photos per time and photos will be saved to device just after taking photos. When I am taking photos app gives memory warning and then crash. Followings are the from crash report. I have talked with Apple support team and they said this is not due to memory issue. This is because of trying to send an action to one of your controller object that no longer exists.
OS Version: iPhone OS 4.3.3 (8J2)
Report Version: 104
Exception Type: EXC_BAD_ACCESS
(SIGSEGV) Exception Codes:
KERN_INVALID_ADDRESS at 0x73980000
Crashed Thread: 0
Thread 0 name: Dispatch queue:
com.apple.main-thread Thread 0
Crashed: 0 libobjc.A.dylib
0x34499c9a objc_msgSend + 18 1
UIKit
0x30a8bc1a
-[UIBarButtonItem(UIInternal) _sendAction:withEvent:] + 86 2 CoreFoundation
0x308f056a -[NSObject(NSObject)
performSelector:withObject:withObject:]
+ 18 3 UIKit 0x309feec2 -[UIApplication
sendAction:to:from:forEvent:] + 78 4
UIKit
0x309fee62 -[UIApplication
sendAction:toTarget:fromSender:forEvent:]
+ 26 5 UIKit 0x309fee34 -[UIControl
sendAction:to:forEvent:] + 32 6
UIKit
0x309feb86 -[UIControl(Internal)
_sendActionsForEvents:withEvent:] + 350 7 UIKit
0x309ff41c -[UIControl
touchesEnded:withEvent:] + 336 8
UIKit
0x309e452e
_UIGestureRecognizerSortAndSendDelayedTouches
+ 2194 9 UIKit 0x309e3bfa
_UIGestureRecognizerUpdateObserver + 690 10 CoreFoundation
0x30957a2e
CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION
+ 10 11 CoreFoundation 0x3095945e __CFRunLoopDoObservers +
406 12 CoreFoundation
0x3095a754 __CFRunLoopRun + 848 13
CoreFoundation
0x308eaebc CFRunLoopRunSpecific + 224
14 CoreFoundation
0x308eadc4 CFRunLoopRunInMode + 52 15
GraphicsServices
0x30269418 GSEventRunModal + 108 16
GraphicsServices
0x302694c4 GSEventRun + 56 17 UIKit
0x30a10d62 -[UIApplication _run] +
398 18 UIKit
0x30a0e800 UIApplicationMain + 664 19
hand-e-pix
0x000025a4 main (main.m:14) 20
hand-e-pix
0x0000254c start + 32
Can anyone please help me to identify what cause this problem?
Many Thanks
Regards
Chin
This could easily be related to a retain/release issue. Make sure you balance your reetain/release calls. Also make sure you do not reference any deallocated objects in your code.
You might want to take a look at enabling NSZombieEnabled in order to track this one down.
You can find information about how to enable it here.

App Crashing in NSURLConnection

I am trying to figure out what is causing this crash. I have built and given the app to our testers but we cannot seem to reproduce this reliably. It just happens sometimes...
Thread 0 Crashed:
0 libobjc.A.dylib 0x000027da objc_msgSend + 18
1 Foundation 0x00032896 -[NSURLConnection(NSURLConnectionReallyInternal) sendDidFinishLoading] + 62
2 Foundation 0x00032818 _NSURLConnectionDidFinishLoading + 72
3 CFNetwork 0x00010dd8 URLConnectionClient::_clientDidFinishLoading(URLConnectionClient::ClientConnectionEventQueue*) + 160
4 CFNetwork 0x00004ad4 URLConnectionClient::ClientConnectionEventQueue::processAllEventsAndConsumePayload(XConnectionEventInfo<XClientEvent, XClientEventParams>*, long) + 96
5 CFNetwork 0x000049c4 URLConnectionClient::processEvents() + 64
6 CFNetwork 0x00004976 URLConnection::multiplexerClientPerform(RunLoopMultiplexer*) + 30
7 CFNetwork 0x000048f4 MultiplexerSource::perform() + 120
8 CFNetwork 0x00004872 MultiplexerSource::_perform(void*) + 2
9 CoreFoundation 0x00055f1e __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 6
10 CoreFoundation 0x00027ba0 __CFRunLoopDoSources0 + 376
11 CoreFoundation 0x00027444 __CFRunLoopRun + 224
12 CoreFoundation 0x00027270 CFRunLoopRunSpecific + 224
13 CoreFoundation 0x00027178 CFRunLoopRunInMode + 52
14 GraphicsServices 0x000045ec GSEventRunModal + 108
15 GraphicsServices 0x00004698 GSEventRun + 56
16 UIKit 0x0000411c -[UIApplication _run] + 396
17 UIKit 0x00002128 UIApplicationMain + 664
18 myapp 0x000020d8 main (main.m:14)
19 myapp 0x0000208c start + 32
Any advice would be greatly appreciated. The app is built in XCode 3.2.4 using SDK 4.1.
Cheers...
I would try turning on NSZombieEnabled and see if that sheds any light on the issue. Is the delegate for the connection still around and valid?
Ben has some sound advice. Turn NSZombieEnabled to on.
I can tell you with almost 100% certainty that it is crashing because you have a nil object when the delegate is attempting to send it a message.
The fact that it is only crashing sometimes, tells me that you are probably using autorelease. Autorelease never decrements the retain count at exactly the same time, so sometimes your object will still be alive when it gets a delegate message and the app works. However, sometimes that object will have been released and the app crashes.

NSObject doesNotRecogniseSelector crashes program

I am learning how to develop iPhone applications and I ran into an interesting problem. In my view controller class, I have a an int variable that I #synthesize and overload the setter (though) this is not needed. When I run the application, I get this trace back:
*** Call stack at first throw:
(
0 CoreFoundation 0x024e0919 __exceptionPreprocess + 185
1 libobjc.A.dylib 0x0262e5de objc_exception_throw + 47
2 CoreFoundation 0x024e242b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
3 CoreFoundation 0x02452116 ___forwarding___ + 966
4 CoreFoundation 0x02451cd2 _CF_forwarding_prep_0 + 50
5 Awesome App 0x00001ff1 -[Controller refreshView] + 69
6 Awesome App 0x00002180 -[Controller awakeFromNib] + 133
7 UIKit 0x004a3924 -[UINib instantiateWithOwner:options:] + 1556
8 UIKit 0x004a54b5 -[NSBundle(UINSBundleAdditions) loadNibNamed:owner:options:] + 168
9 UIKit 0x002b49bb -[UIApplication _loadMainNibFile] + 172
10 UIKit 0x002b590d -[UIApplication _runWithURL:payload:launchOrientation:statusBarStyle:statusBarHidden:] + 198
11 UIKit 0x002bf452 -[UIApplication handleEvent:withNewEvent:] + 1958
12 UIKit 0x002b8074 -[UIApplication sendEvent:] + 71
13 UIKit 0x002bcac4 _UIApplicationHandleEvent + 7495
14 GraphicsServices 0x02d46afa PurpleEventCallback + 1578
15 CoreFoundation 0x024c1dc4 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
16 CoreFoundation 0x02422737 __CFRunLoopDoSource1 + 215
17 CoreFoundation 0x0241f9c3 __CFRunLoopRun + 979
18 CoreFoundation 0x0241f280 CFRunLoopRunSpecific + 208
19 CoreFoundation 0x0241f1a1 CFRunLoopRunInMode + 97
20 UIKit 0x002b5226 -[UIApplication _run] + 625
21 UIKit 0x002c0b58 UIApplicationMain + 1160
22 Awesome App 0x00001e4c main + 102
23 Awesome App 0x00001ddd start + 53
)
terminate called after throwing an instance of 'NSException'
Program received signal: “SIGABRT”.
My attention got drawn to line 2. This happens when I try to assign an int value to my class iVar. Please can you tell me what the problem is and how to fix this?
Thanks a million.
Well, yeah. The default implementation of doesNotRecognizeSelector: is supposed to kill your program. That's not the problem. The problem is that you're sending an object a message it can't respond to. In this case, it looks like Controller can't respond to the message refreshView.
Let the exception be thrown and let the program crash on the uncaught exception. The exception contains all the information you need. You should see a log line that identifies the target of the method invocation and what method (that doesn't exist) was trying to be invoked.