Debugging sporadic app crashes with dylib in iOS13/iPadOS 13

It seems that the dyld3 saves the generated clojure files in the app tmp directory and if you use NSFileProtectionComplete the closure files have this property too.

To generate a crahs close the app, lock the phone, send a push that will wake up the app and then the crash is generated.

The solution seems to be simple, just change the permissions for the app tmp direcptry to NSFileProtectionCompleteUntilFirstUserAuthentication and the app will not crash. I really don't know why apple did this.


I could consistently reproduce this issue in iOS 13.1. But I tested today on iOS13.2 beta 4 and can no longer reproduce this issue. I would suggest reverting the file protection level to complete and then testing on the latest 13.2 beta.