23.8 · Reading sanitizer output, exit codes and runtime traps

Sanitizers and runtime checks fail loudly, but only if you know what they print, what the process exit status is, and what they cannot see.

Mental model. A failure is evidence: read the message, the exit status, and ask what the check could not have caught.

Sanitizer runs

Exit codes and options, and why a clean TSan run proves little.

  1. What does a failing Address Sanitizer run look like to CI: exit status, ASAN_OPTIONS, and how do you read the report? 23.8.1 · L5
    An ASan report has a fixed shape: the error kind and address (heap-buffer-overflow), the access (READ of size 8) with its stack, a line saying where the…
  2. What does a Thread Sanitizer report look like, how does it report to CI, and why does a clean TSan run not prove the code race free? 23.8.2 · L5
    TSan reports two accesses to the same address from different threads without ordering between them. The output names the kind (Swift access race or data race)…

Concurrency traps

What the runtime does when you break continuation, isolation and queue rules.

  1. Which runtime checks fire when you misuse continuations, MainActor.assumeIsolated or dispatch queues, and which of them crash? 23.8.3 · L5
    Several concurrency mistakes are caught at run time, and they differ in severity. Resuming a checked continuation twice traps with “SWIFT TASK CONTINUATION…

More in Debugging & Instruments