iOS may run out of memory while loading dynamic libraries.

Originator:eloy.de.enige
Number:rdar://25126016 Date Originated:12-Mar-2016
Status:Duplicate/24278648 Resolved:
Product:iOS Product Version:9.1
Classification:Serious bug Reproducible:Sometimes
 
Summary:
* A colleague ran into a situation where the app would crash on launch. Important to note is that she was _also_ seeing it with other apps, such as LinkedIn.app.
* A restart of her device ‘fixed’ the issue.

## Info about the errors

```
Dyld Error Message:
Dyld Message: Library not loaded: @rpath/CocoaLumberjack.framework/CocoaLumberjack
  Referenced from: /var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Artsy
  Reason: no suitable image found.  Did find:
	/private/var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack:
	mremap_encrypted() => -1, errno=12 for /private/var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack

	/private/var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack:
	mremap_encrypted() => -1, errno=12 for /private/var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Frameworks/CocoaLumberjack.framework/CocoaLumberjack

	/private/var/mobile/Containers/Bundle/Application/D693664B-F6D0-43CB-A839-358E15CAF9E6/Artsy.app/Frameworks/C
  Dyld Version: 370.1
```

* The error message and codes are always the same.
* The error is not specific to a framework, it happens with various frameworks.
* It appears to have started from iOS 9.1 and up.

Based on retracing steps through dyld/xnu, the error numbers appear to be `ERESTART` (-1) and `ENOMEM` (12).

Steps to Reproduce:
We have been unable to reproduce the issue in house.

Expected Results:
iOS clears memory (e.g. via jetsam) and loads the app.

Actual Results:
Crashes at startup.

Version:
iOS 9.1

Notes:
You can find a more comprehensive version of this report on https://github.com/artsy/eigen/issues/1246.

Configuration:
Any iOS 9 compatible device.

Comments

Still happening on 9.3

Apple had mentioned fixing this on 9.3, however signs are pointing to this still being an issue

Where did they mention this?

By eloy.de.enige at April 1, 2016, 11:03 a.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!