• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: debugging an iOS silent app crash on device
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: debugging an iOS silent app crash on device


  • Subject: Re: debugging an iOS silent app crash on device
  • From: Jean-Denis Muys <email@hidden>
  • Date: Wed, 30 Mar 2011 10:09:42 +0000
  • Thread-topic: debugging an iOS silent app crash on device


On 28 mars 2011, at 20:31, Fritz Anderson wrote:

On 28 Mar 2011, at 9:59 AM, Jean-Denis Muys wrote:

- the crash happens when stepping over this code line: [self drawInRect:destRect]; where "self" is a UIImage
- the app display all go away, showing the springboard.
- the Xcode button is still enabled, suggesting that my app is still running.
- the debugger console doesn't report anything *at all*: no error, no exception, nothing
- the debug navigator is empty and only shows "Process Running"
- the pause/continue button is in its "continue" state (right pointing arrow), just as it was before stepping over. pressing it does nothing
- pressing my app icon on the device's multitasking bar restarts it from scratch.
- pressing Xcode's stop button seems to kill the app, but without any additional output in the debugger console

The code is from a small category I wrote on UIImage to draw thumbnails for images. It's quite straightforward and shown entirely below.

My suspicion is that this problem is memory related, as the image I am trying to scale down here is 6622x9361 pixels in a 6 MB JPEG file.

Um, yeah. That image would require about 248 million bytes to render in memory; JPEGs are compressed when they're files, but to work with them, they have to be rendered into big bad bitmaps. 248M is (to understate) a large chunk of the RAM on most devices.

If you run yourself out of memory, you will be evicted. No warning (if you do it all at once), no console message, you're dead. Apparently Xcode 4 doesn't catch up to the death of the process, and the debugging session has to be stopped manually.

You don't see it in the Simulator because the Simulator, and the apps it runs, are Mac OS X applications. They have access to many times the RAM your device has, backed with a swapping virtual memory system. You can't (unless you try) run a simulated app out of memory.

In the Device Organizer, select the "Device Logs" item for your test device. A crash log for your app will appear in the listing, but all it's going to tell you is that you ran out of memory. You know that.

No crash log for the device. This is weird. However, if look at the "Device console" when doing it, I get indeed console warning about memory being low, with the eventual notice that my app has been killed:

Wed Mar 30 11:50:43 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.cmd-informatique.surveyor[0x17ae]) Exited: Killed
Wed Mar 30 11:50:43 unknown SpringBoard[2223] <Warning>: Application 'Surveyor' exited abnormally with signal 9: Killed
Wed Mar 30 11:50:43 unknown ReportCrash[12368] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2011-03-30-115043.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0

But contrary to that last line, a crash report is not saved.


Run your app under Instruments, with the Allocations template. Adjust the VM instrument to sample every second or so instead of manually. Run your app, and look particularly at the "dirty" memory, which is the actual burden on RAM. That will give you a clue to what's eating up memory.


When I trigger the "crash" on the device, Instruments beachballs. I will try on another Mac.

But you already know: You're trying to fill a quarter-gigabyte of RAM on a non-swapping machine that doesn't have that much memory to spare.

— F


Yeah of course I know. The near impossibility to confirm that through debugging tools is puzzling though.

JD

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >debugging an iOS silent app crash on device (From: Jean-Denis Muys <email@hidden>)
 >Re: debugging an iOS silent app crash on device (From: Fritz Anderson <email@hidden>)

  • Prev by Date: Re: testing receipt validation procedure fails
  • Next by Date: Xcode doesn't show you why it stopped anymore?
  • Previous by thread: Re: debugging an iOS silent app crash on device
  • Next by thread: Xcode4: GCC_AUTO_VECTORIZATION gone?
  • Index(es):
    • Date
    • Thread