_canary_stack_overflow.nx
buildroot/runtime/_attic/_canary_stack_overflow.nx
about
Canary: deliberate infinite recursion to trigger SIGSEGV from
stack overflow. With SA_ONSTACK + sigaltstack(2) wired into
_narr_install_traps the produced ELF should NOT die silently
with "qemu: uncaught target signal 11"; instead the substrate
trap handler runs on the alt stack and emits a structured
[✗CHK] event naming WHO/WHAT/WHY/HOW before exiting 128+11=139.
USAGE:
_offc/nxc.elf bench/_canary_stack_overflow.nx 1>elf 3>asm
gcc-riscv64-linux-gnu (whatever) elf -> a.out
qemu-riscv64-static a.out 2>fd2 4>fd4
grep "received fatal signal 11" fd2 # MUST be present
PRE-FIX: handler tries to push signal frame onto exhausted stack
-> recursive SIGSEGV -> SIGKILL -> empty fd2.
POST-FIX: handler runs on alt stack -> emits [✗CHK] -> rc=139.
dependencies 1 imports · 0 importers
imports: nx_narr.nx (unresolved)
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 20 | func recurse(n: i64) -> i64 { |
| 26 | func main(argc: i64, argv: *u8) -> i64 {
calls 1: recurse |