How to debug crash in reference project? - objective-c

I have a project in which I'm taking reference of another library. I have changed something in the classes of reference project. How do i find that crash is occurring because of the changes. Gdb shows nothing when application crashes.

The simpliest way i see is testing without the changes you made, and see if the app is still crashing...
If you find out the modifications are not the source of crash, post some code, it will be better to solve your problem.

Related

Finding performance-related release-only bugs in Cocoa

I am currently developing a project and I'm working in debug during development.
Typically, I'm just working in release mode before I am releasing the next update to check if everything works as expected.
During the last release tests, I found a bug that just appears in release mode.
As soon as I set the optimization level to 1 or higher (I'm using LLVM 4.2), the bug starts to appear.
I don't have any clue what the error could be related to.
Does anyone have an idea what I could do to find the reason of the error?
Instruments maybe? Didn't find a mode that would fit.
It's a performance-related error and I can't seem to find it with breakpoints.
My first guess is that the main thread is running full so that not all events can be processed in time.
If that was it, why would that not happen in debug mode?

Titanium NSInvalidArgumentException

I'm trying to build a crossplatform (Android-ios) mobile application, using Titanium SDK. I didn't have a chance for a long time to build it for ios, I only used my Windows-android combination, to test it, and it works great on the Android system. But when i try to build it on the mac for the ios, i get this message, and the application shuts down in a second:
The application has crashed with an uncaught exception
'NSInvalidArgumentException'.
Since i can not provide any relevant code, because the exception doesn't show what's the problem with my javascript code, and I certainly didn't write any native, ios specific code, i have no idea, what to do.
From the few posts i have found here is what i have tried:
Restart Titanium Studio
Clean the project
Made sure to close any ResultSet, and DB objects when done with
them (as suggested here: topic)
Test the code on both 3.0.0 and 2.x.x versions
I'm looking forward to any advice, on how you solved this problem, if you had it!
Thanks in advance!
Update:
The problem was the following: I called hasOwnProperty on Titanium UI elements, and on the ios version these elements don't have this function (which is weird, since every javascript objects have it, if i'm not mistaken).
If you have similar problems, i recomend reading this article, besides mr.VVoos answer, it helps a lot in avoiding the problems i had!
I'm developing with Titanim and iOS & Android for a long time. Usually there are many differences between iOS and Android parts of the code.
In most cases this exceptions means that an operation is called that is not available for the called class. (In Java this would mean: Class.method() -> Class has no method called method()).
You can try to run the app in debug mode (on iOS Simulator). There is a big advantage debuggin iOS compared to Android. Usually the iOS simulator stops if there is an exception and it shows the JavaScript code that caused the exception. Unfortunately this doesn't work all the time and it only works on simulator.
If this does not provide any further information you can do the following:
- go to your app.js and set a breakpoint in one of the first lines.
- start app in debug mode.
- move on this breakpoint each time until your app crashes - maybe then you are able to detect the error or provide further information.
One last tip: Check your code if there are any platform-specific parts. (Like Android Intents and something that is not available on iOS).
I know that this can be very ugly but we had to solve many of these nasty issues while migrating from iOS to Android.

Accidental delete iOS framework

So i have been having the hardest time getting my iphone application approved. And i sorta when on a little rampage through some of my code.
In my shear stupidity I thought that maybe I did not need the SenTestingKit.framework. So i attempted to remove it from my program, and when asked if i would like to delete or remove references i accidently clicked delete.
However upon reviewing some crash logs PRE-Deletion of SenTestingKit.framework I found the following...
Again this error was before I deleted the framework. The crash code to this is 0xe7ffdefe
Could someone please tell me where i might get the sentestingkit.framework from? And also if you have anyidea why it is causing the crash that would be so amazing to hear.
Thanks!!!
To restore that framework, just re-install Xcode. Or maybe your trash still has it.
About the iOS devices that complain about not finding the SenTestkingKit: I'd assume so, as it's a Xcode-only framework used for test cases. You aren't supposed to link it when distributing the app. Why would the user want to run test cases?

Cannot Debug In Visual Studio

I have just a form in my VB.Net project and even when I try debugging that - there is nothing going on besides the form being loaded - I get the error:
No symbols are loaded for any call stack frame. The source code cannot be displayed.
I've tried using this solution from StackOverflow, but this is either oudated or pertains only to C++. I've also tried using this article from the MSDN Forum, however, this also did not seem to help as I wasn't quite sure what the answer was telling me to do.
Has anybody else came across this problem and found a solution? It's very frustrating that I'm receiving this error and I only have a form showing up.
Edit: I found another solution here but I don't quite know what that means ... yet. I was going to look into this but I'd really like to know why this doesn't work when Application Framework is enabled.
Make sure you are running in debug and not release. Build>Configuration Manager>Active Solution Configuration = Debug
Get rid of all compiler warnings/errors and rebuild. Look at your Sub New() and form_load events closely. Dodgy form inheritance can cause this. Dodgy module level vars also. From memory even when you fix the problem you need to rebuild to get the designer back. Might be a my.Settings issue.
Sorry for imprecise advice, I have had this problem before but I cannot remember the details.
A quick workaround is to just uncheck "Enable unmanaged code debugging" and "Enable the Visual Studio hosting process" in the Debug section of the Project Properties.

Help diagnosing crash in Cocoa framework - possible memory leak?

I'm currently migrating the Fragaria framework from a GC-only environment to GC being supported. After the work was done (or what I thought had to be done to make it work) I was able to run the examples that come with the framework without any problems and Instruments didn't show any major memory leaks.
I included non-GC Fragaria in my non-GC application and it crashes as soon as I place the cursor on it. To be honest the usage pattern is different from the examples as I'm embedding it in an instance of NSViewController instead of NSDocument.
Can you give me some tips on how to debug this? I'm a bit lost on where to proceed now.
First thing to do is Build and Analyze the code, then fix any problems it finds.
Next, try running with Zombie detection enabled (google NSZombie).
Finally, each crash's stacktrace should give you a pretty good idea where things have gone off the rails.