App gets killed without Crash Log

Originator:oliver.drobnik
Number:rdar://13586175 Date Originated:April 05,2013
Status:Open Resolved:
Product:iOS SDK Product Version:6.1.3
Classification:Crash/Hang/Data Loss Reproducible:Always
 
Summary:

Frequent opening and closing of a UIDocument subclass (not using iCloud) leads to a silent termination of the app.


Steps to Reproduce:

- have UIDocuments with hundreds of images in them
- open these UIDocuments and close them several times until the app is just gone


Expected Results:

The app should not be terminated with signal 9. In the least a useful crash report should be created.


Actual Results:

App is killed with signal 9, on the console this output is logged:

Apr  5 15:47:22 Stefan-Gugarels-iPad iCatalogTest[2700] <Error>: shared connection error: Connection interrupted
Apr  5 15:47:22 Stefan-Gugarels-iPad com.apple.launchd[1] (com.apple.librariand[2672]) <Notice>: (com.apple.librariand) Exited: Killed: 9
Apr  5 15:47:23 Stefan-Gugarels-iPad com.apple.launchd[1] (com.apple.tccd[2681]) <Notice>: (com.apple.tccd) Exited: Killed: 9
Apr  5 15:47:23 Stefan-Gugarels-iPad com.apple.launchd[1] (UIKitApplication:com.int-color.icatalogtest[0x114b][2700]) <Notice>: (UIKitApplication:com.int-color.icatalogtest[0x114b]) Exited: Killed: 9
Apr  5 15:47:23 Stefan-Gugarels-iPad com.apple.debugserver-199[2698] <Warning>: 1 +0.000000 sec [0a8a/1303]: error: ::read ( 5, 0x1c89fc, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Apr  5 15:47:23 Stefan-Gugarels-iPad backboardd[26] <Warning>: Application 'UIKitApplication:com.int-color.icatalogtest[0x114b]' exited abnormally with signal 9: Killed: 9
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: vnode: table is full
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: 1250 desired, 1250 numvnodes, 0 free, 0 dead, 0 rage
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: vnode: table is full
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: 1250 desired, 1250 numvnodes, 0 free, 0 dead, 0 rage
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: vnode: table is full
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: 1250 desired, 1250 numvnodes, 0 free, 0 dead, 0 rage
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: vnode: table is full
Apr  5 15:47:23 Stefan-Gugarels-iPad kernel[0] <Debug>: 1250 desired, 1250 numvnodes, 0 free, 0 dead, 0 rage

We suspect that this is a bug in the iOS SDK.


Regression:

The problem started to occur when we switched to a UIDocument-based subclass for our document.


Notes:

I am using multiple UIDocuments for displaying Catalogs. I open UIDocuments show them and close them. I am repeating the previous step until the app is killed with signal 9.  (But i get no Crashlog and no Exception during Debugging). The only hint for me is found in iPad Console of device.

We verified that the UIDocument is being deallocated after showing. We are not using file presentation, but only the asynchronous loading facilities of UIDocument. We are not using iCloud and we do not need to save the UIDocument.

The out of vnodes condition seems to be related to using the NSFileWrapperReadingImmediate reading option of NSFileWrapper since we are able to show the termination both with an explicitly created file wrapper with this option as well as UIDocument. UIDocument appears to be using the same file wrapper reading option internally.

If we change the reading option to NSFileWrapperReadingWithoutMapping then the problem no longer occurs.

Even if this is "by design" then in the least we would expect for a useful exception to be raised such that an unsuspecting developer would have a clue how to work around that.

Comments

NSFileHandle

This radar helped me solve a tricky crash scenario in my application that was also silently crashing. My app was iterating over 1000+ files and using an NSFileHandle to check the first couple bytes of each file. When I initialized the handle with a URL, the application started working fine.

// Crashes after 1000 or so calls NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingAtPath:path];

// Does not crash NSFileHandle *fileHandle = [NSFileHandle fileHandleForReadingFromURL:[NSURL fileURLWithPath:path] error:nil];

However, I also found that I was not calling [fileHandle closeFile] before leaving the method. When I started calling [closeFile] my crash went away.

By tyler.poschel at May 1, 2013, 9:09 p.m. (reply...)

Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!