Wheres my stack trace gone? - ios

I'm not sure what I've done, how long it's been like this (as I've been putting up with it for a while)... but I've lost my stack trace in the debugger in Xcode...sort of. Below is a screen shot of what I see when my app crashes:
And in the console I see this:
So I can figure out what went wrong from the console, but I miss the stack trace that I could click on class files and jump to the source of the crash.
Could it be LLDB? Latest Xcode? Something else swallowing my exceptions? Any ideas?

The problem is that the debugger isn't stopping when the exception occurs, it is stopping when the program crashes. This happens after the the exception unwinds the stack, which means the source is no longer there. If you want the debugger to stop before the stack is unwound, you need to set a breakpoint when the exception is thrown. Xcode makes this easy. Go to the breakpoints section in the project window.
Then, click the + button in the bottom-left corner and choose "Add Exception Breakpoint…". Make sure that the new breakpoint is set to trigger on throw, or it will still occur after the stack is unwound.

Related

XCode App randomly crashing - message sent to deallocated instance

I am getting the following error on my app when it randomly crashes during testing.
The logs show the following:
Is there any way possible I can track why this error is apprearing? I'll be super grateful.
Best.
Go to the Breakpoint Navigator. Click the plus sign on the bottom left. Add exception breakpoint. It will break right before the weird error you are seeing :)
You know the pane on the left that shows your files? At the top of it there are 7 buttons or so, and one is shaped like a breakpoint. That's the navigator.

Invisible breakpoint in Xcode

Xcode 6 have some strange break point issue. I have removed all break points from my project but still its hitting some invisible break point every time.
I have tried below things.
Commad + 7 and delete all break points.
(lldb) br delete
error: No breakpoints exist to be deleted.
I don't see any break point but still its hitting some break point. see below screenshots for reference.
..Nitin
This is not a breakpoint, but rather an exception in the view controller (whose name you've partially redacted here). Click on that second item in the stack trace, and it will like show you the offending line. Just go up the stack trace until you get to your own code.
It's hard to tell on the basis of so little information, but looking at the stack trace, the assembly code shown, and the exception, it looks like you've encountered a problem during a segue where a cast failed. Perhaps have a prepareForSegue method that is trying to cast segue.destinationViewController to a particular view controller class in order to pass some data to the destination, but the cast failed for some reason. Perhaps you neglected to set the base class for the destination scene in the storyboard.
But if you click on that second line in your stack trace (right below the currently highlighted line) and you'll probably be taken directly to the offending line of code.
There don't have to be any breakpoints set in you project to encounter this kind of behaviour. It means that the thread was aborted because of a fatal error. You just can't see the code, because it happened somewhere deeper in the system, so the Xcode only shows you the assembly code.
As I can see from your stack trace, these threads could be related to your question:
swift prepareForSegue not working / exc_breakpoint (code=exc_i386_bpt subcode=0x0)
Don't know what this means Thread 1: EXC_BREAKPOINT(code=EXC_1386_BPT,subcode=0x0)

How to find EXC_BAD_ACCESS variable from memory address in XCode6? [screenshot included]

This EXC_BAD_ACCESS error pops up once every 5~8 runs.
I am aware that it's caused by duplicate or bad variable usages, etc.
But I can't find exactly WHERE it is causing this error from my codes.
Is there a way to find out which variable is causing such problem?
You can use Zombie to get symbolicated info related to crash
Enable Zombie Objects by-
And then, checking the Enable Zombie Objects checkbox,
Run(profile) your project in simulator -
The instruments will be launched as-
Instruments would show a message similar to the following:
Your next step should be to set an exception breakpoint in Xcode. When your app crashes, Xcode will pause your app at the point where the crash occurs. To set an exception breakpoint, open the breakpoint navigator by choosing View > Navigators > Show Breakpoint Navigator. Click the + button at the bottom of the navigator and choose Add Exception Breakpoint.

Enable and Debug Zombie objects in iOS using Xcode 5.1.1

I have an iOS(7.1) app which crashes due to EXC_BAD_ACCESS. If I am not wrong, this happens due to the use of an object which is already de-allocated. After a bit of searching, I found out that enabling Zombie objects help to pin point the line of error. As I am using xcode 5.1.1, I have done the following to Enable Zombie Objects.
And then, checking the Enable Zombie Objects checkbox,
Then I went to Instruments panel, selected Zombies,clicked Profile and got this,
Now the simulator (in the left background), which had a button and a textfield is running blank and also I can't understand anything on the Instruments panel.
What should be the next step? I mean how can I get the lines which are causing the bad access? I am stuck on this for hours but still couldn't find the procedure.
Any help is appreciated.
Accessing a deallocated object is not the only reason you would get EXC_BAD_ACCESS. Other causes of bad access errors include accessing nil pointers and going past the bounds of an array.
Looking at your screenshots, you are not using a deallocated object. If you were using a deallocated object, the Zombies template in Instruments would let you know. Instruments would show a message similar to the following:
Your next step should be to set an exception breakpoint in Xcode. When your app crashes, Xcode will pause your app at the point where the crash occurs. To set an exception breakpoint, open the breakpoint navigator by choosing View > Navigators > Show Breakpoint Navigator. Click the + button at the bottom of the navigator and choose Add Exception Breakpoint.

App pausing but not getting an error after running a clean

I have no idea what is after going wrong but I'll state the events that happened before the error occurred
1: App was running fine as I was adding functionality.
2: I noticed that one of the view controllers was not showing the correct version but an older one. (I had added in a segmented control and it wasn't showing up)
3: I tried to uninstall the from my phone and build it again but it was still showing the old controller
4: I tried cleaning the project to recompile everything, after this step the application started to give me this problem
http://i.imgur.com/105yDr8.png
Some extra information:
1: This error occurs on the black screen before any view controllers load
2: The view controller I was working on was not the first view controller (so I do not think that it is the problem)
3: The main view controller has not been changed in days and was working perfectly since it was finished
I have absolutely no idea what is going wrong, and help would be greatly appreciated
UPDATE 1
New error message
http://i.imgur.com/5XVJWHT.png
UPDATE 2
Screenshot of storyboard and a finder window that opened when I clicked "show in finder on the storyboard". This would lead me to believe that it does know where the file is
http://i.imgur.com/Ybas1Yx.png
You've (probably accidentally) set a breakpoint at the return UIApp...-line.
You can identify a breakpoint by it's blue color at the left of a line. If it's activated, it's dark blue, else it's light blue. You can just drag it either to the trash can or somewhere else in your window to completely delete the breakpoint.
your app is getting crashed due to exception check the pannel objc_exception_throw
add exception breakpoint and you'll get the line of code where your app is crashing
It sounds like something is broken, and throws an exception. You're just seeing the exception being caught.
The way to investigate what is throwing is to add an exception breakpoint. Go to the breakpoints list and hit +, choose exception breakpoint and leave it at all. This should give you a breakpoing at the point where the except is being thrown.
As to what is happening. You had an app that ran with an old VC, you deleted the app and re-installed and now it crashes, so best guess is that your old version had the VC, but new one doesn't. Sounds like a missing xib or storyboard. It clearly isn't missing from the project, as you'd see that immediately, but check for target membership, changed name or localization problems.
I fixed the problem by renaming the storyboard to MainStoryboard1 and changing the target in
project > target > summary > iphone/ipod deployment

Resources