Change in iOS 14 Beta 3 to trigger 0xdead10cc

We've noticed that our app is now immediately crashing on background on iOS 14 Beta 3 with the 0xdead10cc termination reason. This indicates (as per Technical Note TN2151) that the app held on to a file lock or sqlite database lock during suspension.

However this crash didn't occur at all prior to beta 3.

Did something change in iOS that might cause this? Stricter enforcement?

This is a hard crash for us to debug with little than the technical note to go on and potentially an unknown change in iOS itself.



My app and widget extension use Core Data to access the same
persistent store via a shared app group and are frequently getting
this crash.
Can you post a full crash report? Use the text attachment feature so it doesn’t clutter up the timeline.
Attached an example of the crash. Thanks for taking a look.
Thanks for the crash report. Unfortunately I don’t have any good insight into this. My advice is that you start a new thread for this issue, making sure to:
  • Include your crash report (again as a text attachment), or possibly just reference back to this thread.

  • Tag it with Core Data, so that folks with more experience with Core Data can find it.

Hopefully someone will respond there but, if not, open a DTS tech support incident so that you can discuss this with our Core Data specialist.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@apple.com"

To avoid this we’ve changed iOS 14.0b7 and later to be more forgiving in this case (r. 66931425).

If you must use a file lock, make sure to release it before you become eligible for suspension.

I wonder how "future-proof" this forgiving treatment is.

Thing is, I'm using file locks in a bit of inconventional way: to find out which processes in the same app group are actually alive. It works like this:

  • When a process (a main app, share extension, etc.) starts, it obtains a unique "virtual process ID" from a shared SQLite DB, creates a file with that ID in a shared app container and puts a file lock on it.
  • This virtual PID is used a key/token to put a temporary modification protection on shared virtual resources (basically, files in a shared VFS).
  • When other process wants such resource and "sees" that it is protected by some other VPID, it can query VPID DB and/or relevant VPID file's lock to see if such process still actually exist and still wants the resource for itself. If process (e.g. a share extension) have finished normally, it will simply delete it's VPID file (raising a file lock along the way) and DB record; if it was abruptly terminated by the OS, the DB record will stay, but the file lock will be raised automagically.

As you can see, this use case would not produce any deadlocks (since lock on a each file is put exactly once and only queried afterwards), but totally relies on ability to hold file locks in background. So, I wonder how valid/future-proof is that.

Change in iOS 14 Beta 3 to trigger 0xdead10cc
 
 
Q