Menu

Appendix B — Error and Trap Registry

Error-code and trap registry, cross-linked to the labs that prove them.

Typereference

Every code in this book’s labs, with the fixture that earned it. The checker’s error codes are falsifiable claims: each one exists because a violation exists. Bands: 10xx–70xx compiler front end, 32xx–37xx typecheck, 36xx MMIO, 50xx effects/contexts, 51xx stack bounds, | 52xx loader.

# Compile-time rejections verified in this book

CodeMeaningLab
E1018main must return exactly one value (the exit code)1.4
E2195legacy requires [ … ] predicate — use needs [ … ](migration note, ch. 4)
E2201imported interface not found for this platform12.6
E2203imported symbol not exported by the interface10.4
E2218interface/implementation word signature mismatch10.3
E2219interface/implementation word effect mismatch10.5
E3202stack underflow2.5
E3210word not found1.6
E3211signature stack underflow at a call(trace idiom, ch. 2)
E3212call-site type mismatch3.3
E3220declared stack effect vs computed body2.6, 6.2, 9.3
E3242if cannot pop a condition(ch. 2 notes)
E3243if condition is not a bool2.7 variant
E3246if branch depth mismatch2.7
E3251while cannot pop its condition(ch. 2 notes)
E3253while condition is not a quotation(ch. 2 notes)
E3257while body is not net-zero6.3
E3304bitcast size mismatch3.6
E3305raw pointer cast3.7
E3310contract verdict count wrong (one bool on top)4.4, 4.6
E3311contract verdict is not a bool4.5
E3312contract modified its inputs(registry; shape rarely reachable)
E3608MMIO bitfield is not addressable8.6
E3611MMIO register misaligned8.5
E3640MMIO without a platform descriptor8.7
E3644MMIO board instance not found8.3
E3647MMIO register-map rows disagree with the descriptor8.4
E3760call/spawn of an unannotated quotation12.4
E5001suspend where forbidden (main, lock, ISR)5.7, 11.3
E5002nested lock11.2
E5004capability missing (resource access outside its lock)5.6
E5005undeclared effect5.5
E5010dup of an iso value7.4
E5011implicit drop of an iso value7.5
E5012use after move7.6
E5020borrow escaped its block7.7
E5021conflicting live borrows of one root7.8
E5022dup of a live mutable borrow(ch. 7 prose, verified)
E5030ISR stack exceeds its budget11.5
E5031interrupt-reachable resource accessed unlocked11.4
E5040unbounded (self-recursive) handler6.4

# Runtime trap codes

Hosted exit status equals the trap code.

CodeNameFires whenMet in
10STACK_OVERFLOWdata-stack push past the limit(defense in depth — ch. 6)
20CONTRACT_FAILa needs/ensures promise broke1.3, 4.3, 5
21SUBTYPE_FAILa value left its declared range3.4
22ASSERT_FAILan assertion failed(registry)
23UNREACHABLEa state declared impossible was reached(registry)
24TASK_QUEUE_OVERFLOWthe scheduler’s queues filled(registry, ch. 12)

# Loader verdicts (chapter 13)

CodeRefusal
E5200ABI hash mismatch
E5201bad container (length/offset validation)
E5202signature invalid
E5203module declares an interrupt handler (static-ISR rule)
E5204unsupported relocation
E5205unresolved import
E5219–E5224platform/aperture/modinfo version family

Suite: cargo test -p execution-tests --test dynamic_negative executes ten of these as attempted crimes (Lab 13.4).

On this page