raz / commit fa546d68

commit
fa546d68addf32f346c9d2515689dea98f12c4ef
author
Luis <42945842+ldiaz94@users.noreply.github.com>
date
parent
02c4c3cc
StackOverflow test: a frame big enough to fault in its prologue

With a 512-byte frame, where the stack started (the env's size) put
the guard page under the body's pushes in ~3% of runs, so CI saw
7:5 for 4:1. Its own reading (a signal is told where it stopped) was
right; the test wasn't. A 512 KB frame: 0 of 526 env sizes misplace it.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

patch · log

2 files changed, +7 -4

test/run/StackOverflow.raz (history) modified +6 -3

@@ -1,10 +1,13 @@
11 module StackOverflow;
2-(* A recursion with no end runs out of stack: SIGSEGV, said as such *)
2+(* A recursion with no end runs out of stack: SIGSEGV, said as such.
3+ The frame is big so that the fault lands in the prologue, which
4+ zeroes it from the bottom: with a small one, where the stack starts
5+ could put the guard page under the body's pushes instead. *)
36
47 proc down(n: I64): I64;
5-var pad: [64]I64;
8+var pad: [65536]I64;
69 begin
7- pad[n mod 64] := n;
10+ pad[n mod 65536] := n;
811 return down(n + 1) + pad[0];
912 end;
1013

test/run/StackOverflow.stderr (history) modified +1 -1

@@ -1 +1 @@
1-test/run/StackOverflow.raz:4:1: stopped by a stack overflow
1+test/run/StackOverflow.raz:7:1: stopped by a stack overflow