_canary_null_deref.nx source
↩ module page · 12 lines · 396 B
1// Canary: simpler SIGSEGV via NULL pointer deref. Stack is fine,
2// only memory access faults. This isolates whether the install
3// thunk works AT ALL — if the trap handler doesn't fire here, the
4// install itself is broken (sigaltstack is irrelevant).
5
6import "nx_narr.nx"
7
8func main(argc: i64, argv: *u8) -> i64 {
9 let p: *i64 = 0 as *i64
10 let v: i64 = *p
11 return v
12}