My application lately seems to randomly crash with no error or exceptions. The console just shows (lldb) in light blue. I have uncaught exception handling and still nothing. It happens at random times. I can do the same task over and over and sometimes it will happen and sometimes it won't. Also sometimes it will happen in random places within the application.
So far what I have read is it is possibly just the lldb debugger crashing and not my app however I haven't noticed it before.
Any ideas how to figure out what the cause of the crash is?
It seems to have started when I added MBProgressHUD to my application.
I also just encountered a similar error - where I was just getting a blue lldb in the console with no additional info. However I was getting an exc_bad_access in the debug navigator so I knew it had to be a memory problem. I ended up tracing it to a release command I should not have been making . . .
Are you getting any details of the error in the debug navigator?
If yes please provide.
An over released object might explain why the app would be crashing at random times since (from what I understand) the system won't always immediately dealloc your object just because you sent it a release command however it will do it sooner or later.
I ended up using crittercism and testflight crash reporting to help find the area where it was occurring. It looks like it was because I was running core data on a background thread.
I have been trying to fix this issue for the last 2 hours or so and I turned out I simply had a break point in Xcode. This might not be the case for you but if anyone stumbles upon this thread, check your breakpoints.
In Xcode click this arrow then right click your breakpoints and delete them.
Not sure if this will be helpful to anyone or if I was just being stupid, but save yourself 2 hours and check your breakpoints :)
Related
I'm building an app that uses Core Data, and everything works great, except for one thing. If I let the app sit idly, it suddenly throws a SIGTRAP error with no debugging prompt and no hint as to why it did so.
I suspect that it has to do with when the device automatically saves to it's UIManagedDocument seeing as that's the only function that would run in the background on it's own. Assuming that it is, does anyone have any ideas on how I could at least find out what is going on?
EDIT:
After learning what exception breakpoints were (lol), I've got the following errorstack in NSManagedObjectContext Queue: 0_cxa_begin_catch.
Have you tried committing changes immediately after updating to see if the issue occurs instead of relying on the auto save feature?
I am new here . Sorry if I this question is being repeated but I have a slightly different issue than the others.
My app crashes randomly after certain amount of time interval without any error logs or stack trace. I suspect it's an memory issue . I have the following questions :
1.) How to get stack trace (I have tried NSZombie enabled and NSUnacughtExcpetion handler) but didn't worked
2.) I get Memory warning frequently in my app. How do I confirm whether it's the prime suspect for the above issue? (I have used Leaks, my app crashes when it has just 4Mb usage so I am not quite sure whether memory leak is causing it my app to crash. I know certain application which take heap memory more than 4MB .)
3.) What is the upper limit for Memory leak for an application in iOS before app crashes ?
4.) Would ARC help me in this situation ?
Also, I have tried to debug issue using NSLog statements but since it crashes randomly , it would be hard for me to detect the root cause using this technique.
Any ideas would be or help would be really appreciated
My app crashes randomly after certain amount of time interval without any error logs or stack trace. I suspect it's an memory issue.
To confirm that it's a memory issue, sync your device with iTunes,and look in ~/Library/Logs/CrashReporter/MobileDevice/ for a files with LowMemory in their name. If you see (jettisoned) next to your app name, that confirms it was killed by iOS for using too much memory.
The only other way an app could exit without leaving a crash report is if it erroneously called exit().
For more information, see "Debugging Deployed iOS Apps", and "Understanding and Analyzing iOS Application Crash Reports".
Not sure but reading the registers might help.
First go to Exceptions tab and 'Add Exception Breakpoint' using the + at the bottom left corner.
Then when the app crashes click on "0 objc_exception_throw" under Thread 1
Finally in the console enter:
register read
(you should get a list of registers)
po $rax (normally the exception is in 'rax')
(you should see the exception output on the console)
Hope this helps.
That does sound like maybe the device is running low on memory and shutting you down. There's lots of threads on stackoverflow on debugging memory warnings.
This one talks a little about what to look for when using the Instruments tool.
Here is an explanation of how to get the memory warning level, and what the codes mean.
There is no fixed memory limit on iPhones. I've asked Apple support representatives this question, and they wouldn't give me a fixed answer (probably because the algorithm does not actually enforce any one hard limit for a 3rd-party app).
And, yes, ARC can be a wonderful thing. In your situation, you might have to rework a lot of code to make it all ARC-compliant, but ARC is definitely a useful feature, and can produce programs with fewer memory problems, with less work by the coders (leaving you more time to fix other problems!)
I recommend instrument
https://developer.apple.com/library/mac/#documentation/developertools/conceptual/InstrumentsUserGuide/AboutTracing/AboutTracing.html
In my case i closed all other apps and it started working normally, maybe it was a memory issue
i made an iPhone app that uses camera. It works fine in iPhone, no memory warnings at all. It is also running on iPod touch 4G but gives memory warnings and crashes after some time after getting level 2 warning.
If someone can point me the possible reason for this. Thanks.
The only way you are going to fix this is by being able to debug it on the device. I wrote this blog to explain how to debug EXC_BAD_ACCESS, which is what I assume you are getting
http://loufranco.com/blog/files/Understanding-EXC_BAD_ACCESS.html
The simplest things to do:
Run a Build and Analyze and fix every problem it finds (or at least rewrite it so that B&A doesn't think it's a problem) -- Having a clean B&A is a really good way to making sure you catch these problems early
Turn on Zombies and run your program -- this makes the last release sent to an object turn it into a zombie rather than dealloc it. Your program will leak tons of memory, but if you ever send a message to a zombie it will stop right there and you will see a bug that you need to fix, because in your real version, that would be a crash (sending a message to a dealloced object).
More techniques described at the link
It crashes on a specific operation or randomly?
if randomly,
use instrument to check your memory leaks and memory usage. It's hard to figure out where the problem lies in without going through all your app.
so when i'm running my app using XCode and I can see that my app gets "program received signal 0".
However , the background thread are still running. why is that ?
Second, I can't seem to find any solution to this problem.
I assumed it might be memory leak, but I see nothing special using LEAKS (instrument).
When I run the app on the device(without XCode) and then try to see the device crash inside the organizer, most of the times there is no log (I guess maybe because the app is still running and only the main thread crashed) and while there is a log, my app function are only hex addresses without names.
What other options do I have to solve this issues ?
Thanks!!
I've found that sometimes these errors are caused by trying to access deallocated memory. One great tool to debug these issues is NSZombieEnabled. Here's a link to a good explanation of how to use NSZombieEnabled: CocoaDev: NSZombieEnabled
Hey all
Im working on a game for iphone using cocos2d and sdk 4.1 and I am getting a sigkill error randomly (or what appears to be randomly) while running. Sometimes the error wont appear for hours of trying to simulate it. I have read around on forums and all sigkill problems seem to be when the user tries to close the app, but this is happening during gameplay. Can anyone think of why a sigkill msg is being set off without the user trying to actively close the app.
any advise or tips on trying to track this down would be much appreciated
thanks
g
I think SIGKILL can be raised for a number of different errors. You should try using the debugger and checking out your stack trace (function calls) to see where the error is happening if you can narrow it down.