Skip to main content

Checkpoint: Detection Without Tools

Challenge on lesson: Checkpoint: Detection Without Tools

CHALLENGE
Difficulty: advanced+25 XP

The course's detection discipline, integrated: invariants + reasoning replacing the sanitizers this image cannot run. Implement a tiny ownership ledger exactly as specified โ€” the tests probe every failure mode by observable state, the way the module taught you to detect bugs without ASan: ``c #define LEDGER_CAP 8 typedef struct { int ids[LEDGER_CAP]; int count; } ledger_t; void ledger_init(ledger_t *lg); /* count = 0, ids zeroed */ int ledger_acquire(ledger_t *lg, int id); /* 1 ok; 0 duplicate; -1 full */ int ledger_release(ledger_t *lg, int id); /* 1 ok; 0 missing */ int ledger_live(const ledger_t *lg); /* number of live ids */ int ledger_audit(const ledger_t *lg); /* 1 if count in [0,CAP] and no duplicate ids; else 0 */ ``

Back to lesson: Checkpoint: Detection Without Tools