What is this obscure crash report (stack trace) saying? - ios

I've received a crash report in Crashlytics that seems nonsense to me; only based of a few characters and method name my guess is that it's somehow related to a model inherited from Realm Object.
Could you please give any clue what's going on here?
why Crashlytics was unable to provide line numbers? (while there's been no issue with other crash reports)

It's showing you where in your code the crash is occurring. It gets a bit tricky with these crash reports in Swift because you don't get exact line numbers, but you do get the closure number. It looks like the easiest place to start is BaseDao.swift at line 41, follow that closure to FavViewController's reloadItems function and check what's happening to the LeafBriefModel object?
We'd need to see more code to fully be able to help, but that should be a start.

Related

SIGABRT Error From An NSArray Out of Bounds Exception In a Swift App With No NSArrays

I am making an app, and I am doing my first test right now that should just show the basic layout and a little functionality. I have of course found all the compile time and runtime errors that xcode has caught, and I assume there are at least a few bugs will just make the app act weirdly, but I want to fix those after the app has actually run. Unfortunately, I am getting a SIGABRT error. First off, I am not even using Main.storyboard or ViewController.swift, so that is not the issue. No broken segues. This is what the console says: Console message.
So first I thought I just had an array out of bounds exception ("NSRangeException"), but the thing is, I never used an NSArray (I did use normal arrays though, and I am not ruling out a range out of bounds exception there, but I want to know why the console is saying it is an NSArray. If it is something else, I obviously need to know). Here is a "Stack trace" (or at least I assume so) also which I saw as a suggestion to find and error on a similar question (it was objective-c though, and he actually had an NSArray). Here is the link: similar question I don't know how to trace that back to the source, but that what it looks like leading up to the error. Basically, why I am asking this question is:
If you can tell me that I am completely wrong about thinking I have an array out of bounds error and what it is instead, please do that.
If you agree with me in thinking that is likely the issue, please explain to me why the compiler would refer to it as an NSArray; as far as I know, these are two completely different data structures.
Without code is very hard help you.
But you can check where is the error with an exception breakpoint.
Click on the Breakpoint navigator tab (the tab selected in the image):
Then click on the plus button in the bottom and select Exception breakpoint:
After this, you can reproduce the issue and when the app crashes the debugger stop all at the line where is our (empty) nsArray.

Command failed due to signal: Segmentation fault: with xCode 7.0.1

My code is unable to build on xcode 7. What is Segmentation fault?
A segmentation fault happens when your code tries to access memory that it isn't allowed to access. This is often a sign of an uninitialized reference.
It's not clear to me from your screenshot exactly what is going on, though. Perhaps you could provide more details?
From the screenshot it looks like it is happening when you build your project. If this is correct, you need to create a minimal example that displays the problem i.e a code fragment that crashes the compiler in the same way and then you need to raise a bug report about it with Apple (supplying your minimal example so they can reproduce it).
This has happened to me a couple of times in the past and the way I have identified the bit that crashes the compiler is to comment out everything in the source file and then add it back in function by function.That will narrow the problem down to the function. After that you repeat with the lines of code in the offending function, until you get the line that crashes the compiler.
Along the way you may find a work around to stop the compiler crashing. If you do, do not be tempted to skip reporting the bug to Apple. They need to know.

MTImageMapView EXC_BAD_ACCESS

I am using MTImageMapView for my project
https://github.com/stkim1/MTImageMapView
It's a great view and I find it very useful for my purposes.
Unfortunately sometime I encounter EXC_BAD_ACCESS error.
During profiling with Instruments XCode I found our a Zombie object
On stack trace there are two lines which probably cause this error
MTImageMapView.m line 82, which is property declaration
MTImageMapView.m line 183, which is assignment
I tried to contact the author but I didn't get any response from him.
Unfortunately my experience does not allow me to easily fix this.
Can anybody help me, this is very important.
Kind regards

Find out what line app crashes on?

Is there an easy way to find out what line an app crashes on? The console gives little or no help to help me track down this bug and I would just like to know which line it crashes on.
Thanks!
The easiest way is to run the app under the debugger. When it crashes the debugger will show you what line of code crashed.
If you are throwing an exception rather than actually crashing, you can put a breakpoint on objc_exception_throw using the gdb console window - "br objc_exception_throw".
Are you using xcode? It should give you a visual representation of where you are in the code.
Please post the error you are receiving. The first thing to try is adding some breakpoints. For bad access errors, you can also get a more pin-point analysis from the compiler if you use NSZombie.

about .dSYM and GDB

I encountered a crash in my app. It's not 100% reproduce rate crash. From the crash log and dSYM, I can get the point where the crash happened in the line of some cpp file. But most of time the app run well. So I don't know what cause it crash. Can I got more infos in the line of cpp where it crash,like some value of varible in this line when the app crash and so on. Any suggestion is welcomed. Thanks!
Your crash log should have information about the state of the registers in it and that can be quite useful. Beyond that, though, you can't recover state of the running app from just the crash report.
Sporadic bugs such as this can be the most difficult to hunt down.
First of all I suggest taking a close look at the code? e.g. Is there a de-referencing of a pointer on this line. Does your crash log indicate that the error occurred before or after the tread returned to the run loop? Can you surround this crash line with an exception and log the state in the catch block?
It will help if you post the code which causes the crash!

Resources