I have inherited an iOS app which uses the Irrlicht engine for most of its functionality, and have come across a rather annoying problem.
We are using Facebook Connect to log in and register, due to what I can only assume are other memory issues I am using the FB app on iPhones and the dialog window on iPads.
However on an iPod Touch 4th gen the app crashes as soon as the login dialog appears. It works on the other devices - with a catch. If the iPad 1 is plugged into the Mac then that will also crash when the Facebook Dialog appears, regardless of whether I am actually running it through xcode or not. The 3GS seems to work no matter what, and I believe the iPad 3 works reliably as well. The iPad 3 and the problematic iPod are not on site so I am unable to test them as thoroughly.
Is there any reason why the iPod version would be crashing so readily, given that the 3GS version has no problems. They are both currently using the same set of assets, so if that was the problem I would expect them to both crash.
Any suggestions?
Edit: Here is the console output on the affected device.
May 30 23:16:23 unknown kernel[0] <Debug>: launchd[1298] Builtin profile: container (sandbox)
May 30 23:16:23 unknown kernel[0] <Debug>: launchd[1298] Container: /private/var/mobile/Applications/87B7926A-AA91-48BA-B7EE-73BCDBACCC17 [69] (sandbox)
May 30 23:16:23 unknown Golman[1298] <Warning>: Unknown class AdMobView in Interface Builder file.
May 30 23:16:37 unknown MobileMail[1245] <Warning>: Received memory warning.
May 30 23:16:38 unknown Golman[1298] <Warning>: Received memory warning.
May 30 23:16:38 unknown Golman[1298] <Warning>: Warning: Libinfo call to mDNSResponder on main thread
May 30 23:16:38 unknown SpringBoard[51] <Warning>: Received memory warning.
May 30 23:16:42 unknown Golman[1298] <Warning>: enter login page
May 30 23:16:53 unknown Golman[1298] <Warning>: leave login page
May 30 23:16:53 unknown Golman[1298] <Warning>: enter login page
May 30 23:17:00 unknown Golman[1298] <Warning>: leave login page
May 30 23:17:00 unknown Golman[1298] <Warning>: enter login page
May 30 23:17:18 unknown Golman[1298] <Warning>: leave login page
May 30 23:17:18 unknown Golman[1298] <Warning>: enter login page
May 30 23:17:21 unknown Golman[1298] <Warning>: leave login page
May 30 23:17:21 unknown Golman[1298] <Warning>: enter login page
May 30 23:17:24 unknown Golman[1298] <Warning>: leave login page
May 30 23:17:24 unknown Golman[1298] <Warning>: enter login page
May 30 23:17:38 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.plantpot.golman[0xaf95]) Exited: Killed: 9
May 30 23:17:38 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
May 30 23:17:39 unknown SpringBoard[51] <Warning>: Unable to send deactivation event to <SBApplication: 0xfda12e0> com.plantpot.golman userLaunch statusBarWindowContextId = 1325144038 statusBarOrientation = 3 activate: deactivate: animate animationStart = 36566.94129066667 animationScale = 0.001 animationDuration = 0.4 : (ipc/send) invalid destination port
May 30 23:17:39 unknown SpringBoard[51] <Warning>: Application 'Golman' exited abnormally with signal 9: Killed: 9
May 30 23:17:40 unknown kernel[0] <Debug>: launchd[1304] Builtin profile: container (sandbox)
May 30 23:17:40 unknown kernel[0] <Debug>: launchd[1304] Container: /private/var/mobile/Applications/8FF2FEC5-D24D-4DBB-BC6B-782F89051CFC [69] (sandbox)
May 30 23:17:41 unknown ReportCrash[1303] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2012-05-30-231741.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
May 30 23:17:46 unknown UIKitApplication:com.facebook.Facebook[0x4c2b][1304] <Notice>: wait_fences: failed to receive reply: 10004003
May 30 23:17:50 unknown Golman[1308] <Warning>: Unknown class AdMobView in Interface Builder file.
May 30 23:17:50 unknown kernel[0] <Debug>: launchd[1308] Builtin profile: container (sandbox)
May 30 23:17:50 unknown kernel[0] <Debug>: launchd[1308] Container: /private/var/mobile/Applications/87B7926A-AA91-48BA-B7EE-73BCDBACCC17 [69] (sandbox)
May 30 23:17:51 unknown Golman[1308] <Warning>: Logged into facebook
May 30 23:18:01 unknown MobileMail[1245] <Warning>: Received memory warning.
May 30 23:18:02 unknown SpringBoard[51] <Warning>: Received memory warning.
May 30 23:18:03 unknown Golman[1308] <Warning>: void SendDelegateMessage(NSInvocation*): delegate (webView:didCommitLoadForFrame:) failed to return after waiting 10 seconds. main run loop mode: kCFRunLoopDefaultMode
May 30 23:18:05 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilemail[0x6fdf]) Exited: Killed: 9
May 30 23:18:05 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
May 30 23:18:05 unknown SpringBoard[51] <Warning>: pid_suspend failed for [1304]: Unknown error: -1, Unknown error: -1
May 30 23:18:05 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.facebook.Facebook[0x4c2b]) Exited: Killed: 9
May 30 23:18:05 unknown SpringBoard[51] <Warning>: Application 'Mail' exited abnormally with signal 9: Killed: 9
May 30 23:18:06 unknown SpringBoard[51] <Warning>: Application 'Facebook' exited abnormally with signal 9: Killed: 9
May 30 23:18:06 unknown Golman[1308] <Warning>: Received memory warning.
May 30 23:18:07 unknown Golman[1308] <Warning>: Warning: Libinfo call to mDNSResponder on main thread
May 30 23:18:08 unknown ReportCrash[1310] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2012-05-30-231808.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
May 30 23:18:09 unknown Golman[1308] <Warning>: (friends list received)
May 30 23:18:11 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.plantpot.golman[0x8c4]) Exited: Killed: 9
May 30 23:18:11 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
May 30 23:18:11 unknown SpringBoard[51] <Warning>: Application 'Golman' exited abnormally with signal 9: Killed: 9
May 30 23:18:12 unknown SpringBoard[51] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=0
May 30 23:18:12 unknown SpringBoard[51] <Notice>: MultitouchHID: detection mode: 0->255
May 30 23:18:12 unknown UserEventAgent[12] <Warning>: DEBUG: Changing screen blanked state: 1
May 30 23:18:12 unknown UserEventAgent[12] <Warning>: DEBUG: We could backup; waking backupd to decide
May 30 23:18:12 unknown UserEventAgent[12] <Warning>: TRACE: <MBManagerClient: 0x1402d0> establishing connection with daemon...
May 30 23:18:13 unknown UserEventAgent[12] <Warning>: TRACE: <MBConnection: 0x155340> sending {
command = kMBMessageWakeUp;
}
May 30 23:18:14 unknown backupd[1313] <Warning>: INFO: Scheduling next backup at 5/31/12 11:01:35 PM
May 30 23:18:17 unknown ReportCrash[1314] <Notice>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2012-05-30-231817.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
Edit 2: I have just used the Allocations Instrument on the screen where this happens. The live bytes in the 'All Allocation' field only goes up to 34 / 35 MB at this point. That doesn't seem like it would be enough to be causing the memory issues. Also, the memory warnings start to appear before that point, when it is loading the textures into the game. The app uses the Irrlicht library if that sheds any light on the matter. Just about all of the images, animations, sounds etc are loaded at the very start but the app never crashes when that is happening. It is almost always when a webview of some kind is opened, such as the FB dialog. As mentioned in a comment, this project originally belonged to someone else. Unfortunately it was not completely stable when they had finished with it.
Edit 3: Have now tried with Memory Monitor. First time it crashed while loading textures and showed me it was using ~80MB real and ~200MB virtual memory. After that I stopped it from loading any of the textures, and it still crashed this time showing 69MB and 179MB. Removed audio and an animated 'dummy' which is initialized at the start and crashed at 38MB/147MB.
No idea how it could be using up so much memory so quickly without even loading textures.