How do I debug a Thread 1: signabrt, debug console doesn't show any logs - ios

My ios project builds and installs on the device but has a runtime crash after launcher screen finishes.
I'm looking in the debugger console but I don't see any logs to help me diagnose what is going on. My project was working correctly before I upgraded react-native-firebase from v3 to v4 https://github.com/invertase/react-native-firebase/releases. Stepping into or over the code doesn't show me any errors in the code itself.
I'm hesitant to log an issue with the react-native-firebase project before I understand what the error could be - and whether it was a simple error somewhere.
However, the error seems pretty cryptic and I don't have any clues on what's actually causing the runtime crash. Is there a way that I can read more verbose logs that might give more info on the crash?

add an Exception breakpoint: by going to the breakpoint tab (command + 8) and the click the add "+" button on the bottom left corner and click on Exception breakpoint - all exceptions.
That will pause the code exactly were the exception is being raced therefore you will be able to see the line of code that it is causing the crash.

Related

Causes of CFDictionaryGetValue crash?

I'm having random crashes within my swift app and they are all throwing a similar error around CFDictionaryGetValue
Here are two screenshots from my Google Crashlytics showing the error and that its effecting to different URLs, Note these are from two separate crashes
Then here is also a screenshot directly from within Xcode where I was able to reproduct the error:
There doesn't seem to be any specific action that causes this issue and it occurs at random times.
And advise for trying to trace it and debug would be much appreciated!
Thanks
Oliver
As it turns out this issue was caused by a bug within the Firebase Performance SDK. After removing the SDK everything is working as expected
https://github.com/firebase/firebase-ios-sdk/issues/6734?fbclid=IwAR0L5U4dsBjyUGmklr8qEohlKTyY7P6zJwzWUnU3dUTnFmb0aclK4-rt5os
Try setting up an Exception breakpoint, it would probably give you more information to help you debug it:
In Xcode:
Go to Breakpoint Navigator (CMD+8)
Click the + button in the bottom left corner of the navigator and then choose Exception Breakpoint...
Select All in the Exception field
Re-run your app and you should get clearer information in the debugger

Xcode 5 not printing exception detail

I have a project built for iOS 7 and it worked fine so far, but after a Git merge, some settings or something became corrupted and exceptions are not outputted to console anymore. So the "Terminating app due to uncaught exception" error message is never displayed in console. I've tried the project on both the device and the simulator, same thing. I cannot find the reason why is this and how to fix it and I am humbly asking for your help.
The facts:
debugger is working and running,
debugger stops and highlights correct line,
all exceptions breakpoint is active,
NSLog commands are working,
po command in lldb is working.
What I have tried before asking for help?
Cleaning (including build folder) and rebuilding project,
Restarting Xcode,
Restarting OS X,
Reconnecting device,
Rebooting device.
What else can I do? Thank you for your help!
I ran into this issue when trying to debug an autolayout crash. Not sure if this applies to all cases, but here's my solution:
I did some hunting, and came across this link:
Investigating NSExceptions with LLDB
That led me to mess around with exception breakpoints to try to figure out what the issue was. In my case, I could always find the description on $eax, so I decided to add an action to the breakpoint, so I don't have to debug it each time. This caused it to always print $eax without a breakpoint, so it pretty much acts like I want it to (print the exception description, continue crashing).
Steps:
Solved the issue I was currently having, and I'm sure variations on this solution (po $ebx, po [NSThread callStackSymbols], etc) should get around most issues with missing exception descriptions.

Xcode console wont show error details

I have been developing iOS applications for about 2 years and have never come across this before.
I recently took on a project, but for some reason whenever it crashes while I am debugging the console shows no details about the error. The code highlights with a SIGABRT or ESC_BAD_ACCESS but never tells me the details of the crash in the console (like unrecognised selector sent to instance etc.)
I've come to the conclusion this is a problem with the project settings as I test other apps with the same xCode and don't have the same problem.
I've looked all over but can't find anyone with a similar problem please help!
Try adding an Exception breakpoint:
Open the breakpoint navigator and click the + icon and add an exception breakpoint
Add a breakpoint with the settings as shown
I don't think this is an Xcode problem. But try this two options:
1) In your VC or AppDelegate perform crash on purpose for example:
[self performSelector:#selector(methodNameNotExistingInMyProject:) withObject:nil];
This should return you some console output
2) Are you sure you have Debug configuration in scheme? You may want to check it out.

Seeing exception information in AppCode

I've been testing AppCode and I can't seem to find any information as to WHY an app is crashing.
I've added an exception breakpoint and I can see the line of code causing the crash but no info on why.
In Xcode the exception reason is printed into the console but in AppCode I just get "Exception = Exception Breakpoint".
Can someone point me in the direction of getting useful information out of the crash.
AppCode, Choses Run, View Break points settings, Click on "Log message to console" by default it is off.
Command liners use, shift-fn-command-f8
AppCode also prints the exception in the console, providing that you launch the app in debug mode (as, actually, the debugger does it).

Xcode stack trace not appearing in console

I am used to having a stack trace appear in the console when I don't catch an exception and it throws it back to the main function. Is there a build setting somewhere in Xcode 4.2 that I don't have on? Right now, it shows nothing in the console at all.
Try adding a breakpoint on exception.
Click on the breakpoint's tab (cmd + 6)
Click the add ('+') button bottom left.
Click 'Add Exception Breakpoint...'
Leave the defaults and click done.
Now when an exception is thrown it should drop you into debugger at the line that throws the exception.
This is usually indicative of a problem with LLDB (debugger). I love LLDB, but when it comes to showing stack traces and breaking on the exception rather than main in iOS apps, it's a pain in the ass and has been for a few releases now. No idea why Apple hasn't addressed this yet. To fix it is a two-step process:
Edit your current scheme and under the "Run" tab change the debugger from LLDB to GDB.
Go to https://developer.apple.com/bugreporter/ and report the bug so Apple addresses it.

Resources