CoreFoundation Trap error "Thread1:EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xdefe)" - ios

i need your help i've got this frustrating "random" error.
The app is compose of one Mapviewcontroller and a collectionview on the second controller.
Sometimes when I return to the map from the second controller the app suddenly crash with this error on the the "trap" line.
The crash report doesn't point to any of my lines of code.
EXC_BREAKPOINT (code=EXC_ARM_BREAKPOINT, subcode=0xdefe)
I said "random error" because the same version of the same app could be build and run smooth for days, then suddenly it stuck. The only way to regain control of the app is to delete manually from the iPad and rebuild.
For your information the app uses Coredata.
Any ideas? Some method to figure out where the error come from?
Any help is appreciated, thanks!

I had this error on line like that
NSLog(#"%#: tutorial view retain count = %ld",self.class,CFGetRetainCount(CFTypeRef(tutorialView)));
where tutorialView equals nil

Restart your iOS device - that worked for me. You can also try restarting Xcode.
I was getting the crash where I had a breakpoint set, but I had breakpoints turned off. I think that there are glitches in how Xcode handles breakpoints that can cause this issue even if there aren't issues in the code itself.

Related

Xcode 9 crashing when running split view app on iPhone

After working just fine on both iPhone and iPad for a month, my Xcode 9 app has consistently started crashing causing me the following fatal problem: When I build & run it on an iPhone (simulator or device) Xcode completes loading the app and then crashes too fast for me to copy/paste the error from the debugger. When I run on iPad it works fine leading me to believe this is a result of something related to the split master/detail view.
If I use either an exception breakpoint or an "all C++ exceptions" it will stop at the AppDelegate class and crash if I hit play. If I use only an "all Objective-C exceptions" it will crash as before.
In the debug view hierarchy I get the following errors as well:
Error: Unable to capture view hierarchy.
Details: Log Title: Data source expression execution failure.
Log Details: error evaluating expression “(id)
[[(Class)objc_getClass("DBGTargetHub") sharedHub]
performRequestWithRequestInBase64:#"...
Log Method: -[DBGDataSourceConnectionLibViewDebugger
_executeLLDBExpression:forRequest:onPotentialThread:iteration:]
_block_invoke_2
Method: -[DBGViewDebugger updateDebugHierarchy]_block_invoke_2
I have tested other apps and this issue is unique to the app I am working on. Any ideas or debugging tips for how to proceed? I might just have to redo this whole project again if I can't even find the root cause of this! Appreciate any help.
Quick solution: Reset Simulator Device
I managed to resolve the above issue thanks to some serious digging. First, to resolve the instantaneous crash problem, I set a breakpoint at every line in the app delegate. That allowed me to narrow the error to a memory handling problem. From there I started running the code on one of each device available, and realized the crash only occurred on devices I had used earlier in development. Resetting those devices solved the problem.
The core issue here is that when you clean/rebuild your xcode program, it updates the app code on the device, but not necessarily the data model information. So when I changed my data model by including new data and renaming old data it was not properly updated.

EXC_BAD_ACCESS(Code=EXC_ARM_DA_ALIGN) Only when running app on device from Xcode

I'm getting a really weird EXC_BAD_ACCESS(Code=EXC_ARM_DA_ALIGN) crash on my app which is written in swift but only when i run it on a 32 bit device and only if its running from Xcode (the device is still hooked to Xcode), If i start the app without Xcode it runs fine. I can't give any code since no matter what i do i get no stack trace or anything like that .Only the mention error on the AppDelegate, even though the crash is in different screens further in the app (crashes on second screen).
Any idea as to why the crash would happen only when Xcode is running the app
You are using some variable or object which is yet to be initialised. Please review your code and you will get the error. You can add exceptional break point to get the actual position of the error.
It's a memory alignment issue. Search on EXC_ARM_DA_ALIGN.
https://brewx.qualcomm.com/bws/content/gi/common/appseng/en/knowledgebase/docs/kb95.html
use memcpy
char*Code; int pc;
double f;
memcpy(Code+pc, &f, sizeof(f)); // instead of *(double*)(Code+pc)=f; that generates EXC_ARM_DA_ALIGN

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.

iOS: App freezes and gives me an SIGABRT in xcode

When I start my app everything goes well. But if I close it, I mean really close it, and then opens it again it shows me the last open view and the app is totally freezed and xcode shows an SIGABRT error.
I have done so much, it's not that easy to just step backwards and see where it breaks. Any ideas?
Have you added an Exception Breakpoint in XCode? If something's wrong in your execution (possibly as a result of stored state from the previous execution that is now being loaded?), then you'll be able to see exactly where an exception happened before the program received the SIGABRT.
Ehm ok I might have done a noobie misstake...
I disconnected my phone from my computer (with the app totally closed) opened it and closed it again. Now when I open it, everything works. I guess you can't do that when running from xcode... he he...

Resources