Existing users, log in.  New users, create a free account.  Lost password?

Special report: troubleshooting iPhone application crashes

Posted 20 July 2007 @ 1pm in Applications, Troubleshooting

Because of the largely seamless experience, it’s sometimes easy to forget that the iPhone is actually a miniature OS X computer, with real applications that are susceptible to the same unexpected quits and general freezes as their desktop brethren.


The most common iPhone crash is one where the application you are working in suddenly ceases operation, the screen momentarily turns black, then the iPhone home screen appears. In a slightly more serious manifestation, the crash will result in a complete freeze where the iPhone is unresponsive.

Preventing crashes As previously reported, the most crash-prone application on the iPhone is Safari, with Google Maps being a close second. Several readers have reported, and we’ve experienced many times in-house, an issue where Safari suddenly quits when attempting to load Web pages or when scrolling/zooming Web pages.

Crashes are most likely to occur when loading graphics-heavy pages, or those with large (in terms of file size) images. We’ve also noted repeated crashes when using the iPod function in the background then browsing pages with Safari.

There are a few preventative measures for these types of crashes.

  • Safari-specific: clear cache, cookies, history Try these options first if you are seeing repeated crashes in Safari. Safari for the iPhone doesn’t have a very aggressive caching mechanism, but sometimes clearing it can trigger stubborn pages to load. Cookies can also become problematic. Delete them and re-try loading the page(s). Finally, deleting History can be effective on the Desktop versions of Safari, and may also be so on the iPhone. All of these items can be cleared by using the Settings application then tapping Safari.
  • Full reboot Perform a hard reboot of your iPhone as follows: Turn the iPhone off completely, by pressing and holding the Sleep/Wake button (on top of the device) for a few seconds then slide the red slider. Turn it back on by holding the Sleep/Wake button until the Apple logo appears. This can clear potentially problematic data, preventing some crash-types.
  • Keep adequate free space on the iPhone’s internal memory Like its desktop relative Mac OS X, the iPhone’s OS X operating system needs some head-room on the internal flash memory in order to operate properly. Try keeping at least 10% of the total space free to potentially prevent some crashes in applications, freezes and other problems.
  • Restore the iPhone Try performing a restore of your iPhone. Connect it to your Mac or PC and, in iTunes, click the Restore button under the Summary tab. Restoring the phone will erase contacts, calendars, photos and other data on the phone, but will restore automatically backed-up information including text messages, notes, call history, contact favorites, sound settings, widget settings, etc.
  • Erase all content and settings As a last resort, go to the Settings application, tap General then select the Erase All Content and Settings. This will delete all media and data on the iPhone, as well as recent calls, etc., and all other settings. If you perform this operation and stop experiencing crashes, you might have problematic data being synchronized to the iPhone that is automatically put back when the phone is restored. In this case, you might want to go to iTunes, select Preferences from the File menu, then iPhone and delete your backed up iPhone settings — this includes text messages, notes, call history, contact favorites, sound settings, widget settings. Again, one or more of these data might be problematic.

Finding out what caused crashes Just like Mac OS X, the iPhone generates crash reports when things go wrong. These files are sent back to your computer whenever the iPhone is connected and synchronized with iTunes. In Mac OS X, they’re located in /Library/Logs/Crashreporter/MobileDevice/ under the name of your iPhone.

You might find a variety of files here with different prefixes that end in .crash. For instance, files that start with:

  • “Maps” indicate a crash in the Google Maps application
  • “MobileSafari” indicate a crash in Safari for iPhone
  • “MobilePhone” indicate a crash from the phone application (yes, the phone functionality of the iPhone is an application, and can crash)
  • “SpringBoard” indicate a crash from the iPhone application launcher — kind of like the Finder in Mac OS X or Windows Explorer.

You can open these files with any text editor to view their contents. The first section looks like this:

  • Process: MobilePhone [30]
  • Path: /Applications/MobilePhone.app/MobilePhone
  • Version: N/A (N/A)
  • Code Type: 0000000C (Native)
  • Effective UID: 0
  • Parent Process: SpringBoard [15]
  • Date/Time: 2007-07-13 17:27:36.372 -0700
  • OS Version: OS X 1.0 (1A543a)
  • Report Version: 6

Process tells you the name of the application that crashed, and its process number (in brackets). Path tells you where in the iPhone filesystem the application that crashed resides. Parent Process This is usually SpringBoard, the iPhone’s application launcher.

As you can see, you’ll also be presented with information about the version of OS X currently being used by the iPhone, the date and time that the iPhone crash occurred.

Next you’ll see:

  • Exception Type: EXC_BAD_ACCESS
  • Exception Codes: KERN_PROTECTION_FAILURE at 0×00000005
  • Crashed Thread: 0

This tells the user exactly what type of processor exception caused the crash. The above depicted, for instance, “EXC_BAD_ACCESS/KERN_PROTECTION_FAILURE” is caused by the thread trying to write to read-only memory. This is always caused by data access.

Next you’ll see the backtrace, which shows, in reverse chronological order, the series of events that happened right before the crash in each thread, e.g.:

  • Thread 0 Crashed:
  • 0 libobjc.A.dylib 0×30e980bc 0×30e8a000 + 57532
  • 1 Maps 0×00006abc 0×1000 + 23228
  • 2 Maps 0×0000745c 0×1000 + 25692
  • 3 UIKit 0×3240a9fc 0×323ab000 + 391676

Now you know (in the above example) that the crash occurred while libobjc.A.dylib was being accessed, but before that came the Maps process, and before that the UIKit process. You’ll see files with the dylib suffix often in crash reports. These are OS X dynamic libraries integral to core-level iPhone functions.

RIght now, the best use of iPhone crash logs is seeking of patterns. Look for the most commonly implicated applications and processes, then direct your troubleshooting techniques appropriately. Lots of SpringBoard crashes? Try a reset. Repeated Safari crashes? Clear the cache, cookies and history as aforementioned.

A secondary use is to look for data that might be implicated in the crash, then delete it as mentioned above in the Preventing Crashes section.

Also, remember that you can send these crash reports to Apple when your iPhone is connected, providing the iPhone software team with valuable data that might be rolled into a future update.

Feedback? info@iphoneatlas.com.

[ Digg this  |  Bookmark on del.icio.us ]

Print This Post Print This Post

4 Comments

Posted by Kee Hinckley
24 July 2007 @ 4am

It appears that if the OS was unable to get a traceback for the crash (which seems to be the case in a lot of my crashes), the exception code given is: 0×8badf00d.

Could be worse. I remember one company getting a confused call from a customer about a 0xdeadbeef crash.

Posted by israelblanco
3 April 2008 @ 12pm

I install some thir’d party applicattions, i don’t remember how much, but i think in 3 or two(smsnotify and others), after that my iphone restart and restart with the window: Edit Home Screen.
I enter by ssh and execute: ps -A:
1 ?? Ss 0:07.95 /sbin/launchd
12 ?? Ss 0:00.06 /opt/iphone/afp/afpd -d -D -U uams_dhx.so
15 ?? Ss 0:00.96 /usr/sbin/BTServer
16 ?? Ss 0:04.43 /System/Library/Frameworks/CoreTelephony.framework/Support/CommCenter
19 ?? Ss 0:14.60 /usr/sbin/configd
20 ?? Ss 0:01.83 /usr/libexec/crashreporterd
21 ?? Ss 0:00.04 /usr/sbin/cron
22 ?? Ss 0:00.86 /System/Library/Frameworks/IAP.framework/Support/iapd
23 ?? Ss 0:00.22 /usr/sbin/mDNSResponder -launchd
24 ?? Ss 0:05.74 /usr/libexec/lockdownd
25 ?? Rs 2:37.69 /usr/sbin/syslogd
26 ?? Ss 0:00.52 /usr/sbin/update
28 ?? Ss 0:10.54 /usr/sbin/mediaserverd
29 ?? Ss 0:21.52 /usr/sbin/notifyd
100 ?? S 0:02.78 /usr/sbin/sshd -i
1042 ?? S 0:00.86 /usr/sbin/sshd -i
1092 ?? Rs 0:03.43 /System/Library/CoreServices/SpringBoard.app/SpringBoard
1093 ?? Ss 0:00.13 /usr/local/bin/dock/dock
1094 ?? Ss 0:00.06 /usr/libexec/securityd
1096 ?? S 0:00.43 /Applications/MobilePhone.app/MobilePhone –launchedFromSB –firstLaunch –suspende
1098 ?? R 0:00.32 crashdump -p 1097
109 p0 Ss 0:00.14 -sh
1068 p0 S+ 0:00.06 bash
1045 p1 Ss 0:00.07 -sh
1047 p1 S+ 0:00.09 bash
1099 p1 R+ 0:00.02 ps -A

the number of varios applications change when iphone restart

1 ?? Ss 0:09.95 /sbin/launchd
12 ?? Ss 0:00.06 /opt/iphone/afp/afpd -d -D -U uams_dhx.so
15 ?? Ss 0:01.10 /usr/sbin/BTServer
16 ?? Ss 0:04.95 /System/Library/Frameworks/CoreTelephony.framework/Support/CommCenter
19 ?? Ss 0:17.05 /usr/sbin/configd
20 ?? Ss 0:02.18 /usr/libexec/crashreporterd
21 ?? Ss 0:00.05 /usr/sbin/cron
22 ?? Ss 0:00.94 /System/Library/Frameworks/IAP.framework/Support/iapd
23 ?? Ss 0:00.22 /usr/sbin/mDNSResponder -launchd
24 ?? Ss 0:06.92 /usr/libexec/lockdownd
25 ?? Ss 3:10.62 /usr/sbin/syslogd
26 ?? Ss 0:00.58 /usr/sbin/update
28 ?? Ss 0:12.60 /usr/sbin/mediaserverd
29 ?? Ss 0:25.50 /usr/sbin/notifyd
100 ?? S 0:02.78 /usr/sbin/sshd -i
1042 ?? S 0:00.93 /usr/sbin/sshd -i
1295 ?? Ss 0:03.69 /System/Library/CoreServices/SpringBoard.app/SpringBoard
1296 ?? Ss 0:01.83 /usr/local/bin/dock/dock
1299 ?? S 0:00.43 /Applications/MobilePhone.app/MobilePhone –launchedFromSB –firstLaunch –suspende
1302 ?? R 0:00.49 crashdump -p 1295
109 p0 Ss 0:00.14 -sh
1068 p0 S+ 0:00.06 bash
1045 p1 Ss 0:00.07 -sh
1047 p1 S+ 0:00.12 bash
1303 p1 R+ 0:00.02 ps -A

I don’t know what is the problem.
This is the content of /Applications directory:
bash-3.2# ls /Applications/
Aplicaciones.app Configuracion.app MobileNotes.app Pool.app
Apollo.app DemoApp.app MobilePhone.app Preferences.app
Battery.app Domino.app MobileSMS.app ShowTime.app
Bluetooth.app DropCopy.app MobileSafari.app Stocks.app
BooksJ.app Insomnia.app MobileSlideShow.app SwirlyMMS.app
BossPrefs.app Installer.app MobileStore.app Terminal.app
BossTool.app Juegos.app MobileTimer.app VNotes.app
Calculator.app Lockbox.app NetServices.app VNsea.app
Camara.app Maps.app Ocio.app Weather.app
CameraPro.app MobileAddressBook.app PDFViewer.app YouTube.app
Categories.app MobileCal.app PhotoBoard.app iLevel.app
Chess.app MobileMail.app PocketTouch.app iShare.app
Collage.app MobileMusicPlayer.app Poof.app iSplit.app

I have the error log /var/logs/AppleSupport/general.log, write here some lines of that:
2008-04-03 13:31:05 -0600,109,BC852674-4619-45DF-B905-A1DAA3167DD2,101,ptpd,0×00000102, 0×3099bc0e
2008-04-03 13:31:09 -0600,109,42F1DA79-1734-499B-9E0A-AFD36B968B66,101,SpringBoard,KERN_PROTECTION_FAILURE at 0×00000004
2008-04-03 13:31:15 -0600,109,B7BE8BCE-C309-4BA2-87B4-F5EBE317A208,101,ptpd,0×00000102, 0×3099bc0e
2008-04-03 13:31:20 -0600,109,DB78C877-72C3-4B06-B2FF-8392262984CC,101,SpringBoard,KERN_PROTECTION_FAILURE at 0×00000004

Can someone help me?

Posted by israelblanco
3 April 2008 @ 12pm

I want to add more info to my previous comment:

OS Version: OS X 1.1.4 (4A102)

Posted by israelblanco
3 April 2008 @ 12pm

I need to restore my firmware? how do it without lost th unlock?.

You must log in or register to post a comment.