MTImageMapView EXC_BAD_ACCESS - ios

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

Related

Migrating from AK4 to AK5 - AKOscillatorBank change to Synth

I'm migrating my project from AudioKit 4 to AudioKit 5 and currently stuck on a bad access error. The variables look like they are passed correctly into the SynthVoiceStart method. I'm quite stumped why it's throwing the error as it should be a simple change from AKOScillatorBank to the Synth object.
The project code is accessible HERE on GitHub.
I've attached a screenshot below.
XCode Error
Thank you, a simple mistake on my part.
let engine = AudioEngine()
Was accidentally inside the 'init' method and was not declared beforehand. This meant that AudioKit did not start correctly.
The corrected code is below.
XCode Correct Structure
This is more of a comment, but I don't have enough reputation.
In the past I've investigated and managed to solve EXC_BAD_ACCESS errors with AudioKit by using Address Sanitizer (ASan). In XCode go to Edit Scheme, Diagnostics tab, and tick the Address Sanitizer option. When your program is recompiled and run, ASan will print a report whenever a memory error occurs. This sometimes gives useful information to resolve the error.

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

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.

Debugging Crash in XCode

I have an application & I am debugging that after some time I am getting below message in console logs
Message from debugger: Terminated due to signal 3
Program ended with exit code: 0
Can anyone help me in telling about this signal 3 log & how can I get rid of this?
Can anyone help me in telling about this signal 3 log & how can I get rid of this?
You'll generally also get a stack trace and probably a lot of other information. You may need to scroll in the console to see it. The stack trace will show you what methods were executing at the point when the crash happened, and there's typically also some indication of what kind of error occurred.
This could have several issues, but probably it will be a memory issue. Try to use Instruments to cover that problem.
Ctrl-click on our Xcode Icon in the Dock
Open Developer Tool
Instruments
Select Leaks (or at least Allocations)
Select your app and start the measurement

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.

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.

Resources