6.9 · How a process dies, what it costs, what confines it and what seals it

An app is a process, and a process has an exit status, a memory bill, a sandbox profile and a code signature. Each one can be inspected with ordinary tools.

Mental model. Everything the platform does to your app is visible as a signal, a kernel counter, a denied system call or a failed signature check. Learn to read those four and the crash logs stop being mysterious.

Dying and measuring

Exit statuses and signals, and the one memory number that counts.

  1. How does a process end, and which signal or exit status does each kind of failure produce? 6.9.1 · L3
    A process ends in one of two ways: it exits with a status (exit(3), or returning from main), or the kernel kills it with a signal. The check separates them…
  2. Which memory number does the system judge your app by, and why do virtual size and “resident” mislead? 6.9.2 · L5
    A process has several sizes. Virtual size is the address space you have reserved: in the check, mapping 200 MB with mmap raised it by about 200 MB and raised…

Confinement and signatures

How the sandbox says no, and what a code signature actually seals.

  1. How is the sandbox actually enforced, what does a denied operation look like, and what does the simulator not enforce? 6.9.3 · L5
    The iOS sandbox is the same Seatbelt mechanism that exists on macOS: a profile is attached to the process at launch and the kernel checks it on each operation…

More in iOS platform internals