#295 stage1: (save-image ...) core-dumps in AG-SAVE-IMAGE-ACTION — pre-existing (fails at f2767ea~1 too)

open
Opened by atgreen

Split from cave#294 (whose conditions family is fixed in 198df11). funcl-stage1-save-image-restart-evaluates still fails: stage1 (save-image X) SIGSEGVs inside AG-SAVE-IMAGE-ACTION (gdb). Proven OLD: an isolated worktree at f2767ea~1 (pre conditions-CLOS, pre the 2026-07-12 stack) reproduces the same core — so this is not a recent regression; the test was likely already failing before this week's suite runs. Needs its own bisect (or gdb-first localization) against the stage1 save path. Repro: printf '(save-image "/tmp/s1.img")\n' | build/funcl-stage1

Comments (1)

atgreen3992925843

gdb progress (2026-07-13): fresh core backtrace lands at #0 near AG-FILE-IS-FCO-P (+garbage offset — nearest-symbol; the real site is unnamed code after it) called from #1 near AG-IMAGE-RUNTIME-ROOTS. So the crash is in save-image's ROOTS-GATHERING phase, not the writer. ag-image-runtime-roots (image.lisp) builds the root container and makes two guarded funcall-by-name calls — (funcall 'mc-image-tables) behind ag-image-mc-present-p (index 6) and the cave#291 condition-tables call (index 7) — plus (gc-root-ranges). Since this reproduces at f2767ea~1, the condition-tables call (later commit) is NOT the cause at that commit, but the mc-present probe / root-ranges path predates it. Suspects in order: (a) ag-image-mc-present-p's probe misbehaving on the host build (the cave#294 lookup-at-stage1 class — if it consults ag-fn-lookup the result may be garbage at stage1), (b) funcall-by-name from baked warm code dispatching through a stage1-degenerate table. Next session: instrument ag-image-runtime-roots with write-string markers per index to pin the crashing element — the cave#294 fix pattern (same-tier gating) likely applies.