I can't determine the cause of a crash.
While running the debug build of an app on an iPad 3.1 from Xcode, the app terminates but the debugger doesn't tell me anything. I have an all-exceptions breakpoint and that has certainly worked in the past to catch errors.
Not that I know how to use a crash dump, but when this happens the "Device Log" in the organizer devices pane shows an entry from process "Unknown" of type "Unknown".
I am also having memory warning problems, but in this case I'm not getting the memory warning method invoked (I have a log message and a breakpoint). Could this be a memory warning that doesn't invoke the method ever? [The memory warnings are a puzzle since Instruments isn't showing me any leaks and my own image objects aren't (obviously) being kept in memory -- but that's another problem].
Any idea what is happening to me and how I could get the debugger to trap the condition?
This sounds like your app is getting killed by the system because you allocate too much memory. Depending on how much memory you are allocating, it could very well happen that you never see the memory warning methods being called.
Check your app with instruments running and also check the crash report again, it should give you some more details. E.g. a list of processes with rpages, recent_max and (state) columns, with Largest process: shown above. I bet your process is named and also shows the state (suspended), which means: iOS killed it because you allocated too much memory.
Related
How can I solve this problem, I don't know that did it affect to my problem in this link My previous problem about Core data ?
This message will occur when I cmd+Q of the application.
Message from debugger: Terminated due to signal 15
and if who know the solution of my previous problem please tell me.
Message from debugger: Terminated due to signal 15 occurs whenever the user manually terminates the application (whether simulated in iOS simulator or on a provisioned iOS device) through CMD-Q (Quit) or STOP, which is toggled after you click on RUN.
In OS terms, signal 15 is a Linux enumeration for the signal, SIGTERM, which means signal terminate.
Message from debugger: Terminated due to signal 15 usually means that you quit the simulator while running the program.
I have same issue when i take screen short from simulator then terminated. This is xcode bug.
Just update your xcode version.
This only means that the system sent your application the kill signal. The system may do that for any number of reasons. It does not necessarily mean the application was killed due to memory pressure. In fact, this is very unlikely in the case that you describe. Most of the reasons the system might send a kill signal won't happen when the app is being debugged.
When the system kills an application it will track the reason and log it. If you are using a third party crash reporting service this will not capture the reason, and in fact can prevent a lot of critical information from being logged by the system.
Look for logs on the device. Watch the console log on the device when the issues reproduces - usually you will be able to see why it was killed. If it was memory pressure there would be a JetsamEvent log as well.
It is much more likely that your application is doing something "in the background" that it does not have a background mode or entitlement for. For example, it may be doing something past the background task assertion time limit, etc.
As far as your CPU and memory use, do not trust the gauges in Xcode. These are just an estimate and are often way off, and they do not capture the information you actually need (like dirty VM usage). Instead use Instruments.
https://www.reddit.com/r/iOSProgramming/comments/822id9/ideas_for_debugging_a_memory_leak_terminated_due/
Is there a way to send low memory crash reports with QuincyKit?
I looked through the code, and QuincyKit sends the crash reports found in:
/var/mobile/Application//Library/Caches/crashes
However when the app crashes due to a memory warning a file doesn't get created in that directory. I can view the low memory reports in Organizer (type Unknown), but where is the file located?
Can QuincyKit be modified quickly to send the memory reports?
Unfortunately this is not possible.
Out of memory crashes are actually kills by the watchdog process. Whenever you kill a process, there is no crash happening. The crash reports for those that you see in Organizer, are arbitrary reports written by the watchdog process that did the kill. So the only system that can provide information about these, is iOS itself.
It is not possible to retrieve the memory reports.
However, it would be possible to notice:
that a memory warning had been received and record the memory usage at that time - and
that X seconds later the application was no longer running (by maintaining a simple watchdog thread).
You could then deduce on the next run that the application had probably been killed due to an out of memory condition, and you would have some information about the memory usage at that time. Indeed, you could extend your memory warning handler to report the size of any caches you were running (and also to clean them up at the same time, thereby reducing the likelihood of a crash!).
All question you can see in title.
I don't know why it crashes when run without Xcode.
How can diagnose this?
How can get logs?
Does startup take longer than 30 seconds sometimes? If you are starting up your app and you are connected to the debugger springboard will let you app take any amount of time to start up. If you are not connected to a debugger, springboard will kill your app after 30 seconds.
If you have physical access to the device you can pull the logs directly from the device via the Xcode organiser when you next plug it in.
Another option, if you don't have physical access to the device would be to add a library to retrieve crash logs for you, such as Crashlytics which will upload the crash log to a server the next time the application is launched.
Generally in C it means you haven't initialised some memory, somewhere. Thus you'll sometimes have the correct conditions for startup, and other times not. A common case is expecting zero as the starting case for other calculations: if you haven't zeroed the block of memory in question, your process and others have (between this run and the last) written and rewritten that memory so that it will sometimes be zero (thus a successful startup) and other times not.
In your case, you could probably use callgrind to check where the crash is occurring.
I am currently importing all the facebook birthdays and inserting them in core data,then i sort them according to the latest bday's(fetching and sorting).
When i use facebook to sync and get all the contacts,my app retrieves all the contacts perfectly,but after it receives the contacts it soon crashes..
i tried using zombie objects.
i tried leaks.
i tried adding an exception in exception navigator.
i synced my ipod with itunes went to library and device logs but couldnt find any file which says low memory issue or something that sorta.
i am confused because the reason for the crash doesnt show up,it simply crashes and when i open my app again i can see all the contacts imported from facebook
there is no lldb in the debugger window,when i change it to gdb,i can see gdb but when i use backtrace(bt) it say "No Stack"
i also noticed there is one thing i.e if there are too many contacts my app crashes and if there are less contacts it works normally.
what can be the problem? does it crash because of a memory issue?
how am i supposed to know what is causing the crash?
thanks
Your app is most likely being terminated due to low memory.
The best thing is to look at the device console using Xcode's Organizer:
If iOS is running out of memory and killing your app, you should see something like this:
<Notice>: jetsam: kernel termination snapshot being created
<Warning>: Application 'UIKitApplication:com.yourapp[0x6337]' exited abnormally with signal 9: Killed: 9
You should use the Activity Monitor in Instruments to see how much memory your application is using.
You can also use the Memory Monitor instrument and enable graphing of "Physical Memory Free". If you see the graph approaching 0 before your crash you can be pretty sure it's a memory issue.
Try to put some code for memory releasing into viewDidUnload. For example, if you create a link between code and xib using mouse then xcode generates code for current element automatically.
I recently noticed that sometimes our app crashes right after receiving a memory warning. It's very hard to reproduce this problem on device, and even in simulator I get this crash in maybe one of ten attempts to “Simulate Memory Warning”.
What is a good strategy to debug memory warning handlers, considering issues often come from callbacks arriving “too late”, resources accidentally used after being destroyed in warning handler, etc?
Here's an approach that helped me find several severe bugs in my memory warning handlers.
First, I went to OS X Keyboard settings and assigned a shortcut to Simulate Memory Warning:
Then, when running the app in simulator, I kept these buttons pressed, so the Simulator would generate tens of memory warnings per second. While doing that, I would go around the app. Of course this is rarely what happens in the real world, but this stress-testing helped reveal some synchronization, callback and state issues, which I wouldn't have found otherwise.