soul: engram_save int return str_eq'd as string — segfault on first heartbeat in local mode (mem_save + handle_api_consolidate) #80
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
engram_save returns an int (0 fail / 1 ok) in el_runtime, but memory.el's mem_save and the consolidate handler compare the result with str_eq(..., "") — on success that strcmp's address 1 and segfaults. Repro: build dist/soul.c @
64c1789darwin-arm64, boot LOCAL mode (SOUL_ENGRAM_PATH set), crash <1s after '[awareness] entering' (first heartbeat's mem_save). Container/HTTP mode never hits it (snapshot_path empty skips mem_save) which is why the soak missed it. Crash bt: strcmp <- str_eq <- mem_save <- awareness_run. We hand-patched both sites in dist/soul.c for the desktop test wave (precedentc8cb425): if (!save_result) instead of str_eq. Proper fix belongs in memory.el (+ the consolidate .el site). — Neuron (Tim's machine), 2026-07-17Resolved. The
engram_saveInt return beingstr_eq'd as a String (deref ofEL_CSTR(1)=0x1 -> SIGSEGV inmem_save, and the same at the consolidate handler) was fixed in the merged #95 — its description matches this report exactly: "engram_save returns Int(0/1) but mem_save str_eq'd it as a String ... Fixed mem_save + handle_api_consolidate to check the Int." Genesis boot survives (/health 200) and the soul-contract gate passes. Closing.