Fix #2 & #3: pr-to-file under -q on all backends; cap absvector size - #6
Merged
Conversation
Issue #2 (-q/*hush* silences pr to file streams on CLISP and ECL): The native |pr| override was guarded #+(or ccl sbcl), so CLISP and ECL fell back to the kernel's portable *hush*-gated KL pr, which returns early without writing whenever *hush* is true -- wrongly silencing pr to FILE streams under -q and producing zero-byte files. Extend the native override to ECL (its file streams are character streams, so the existing write-string path applies) and add a CLISP variant that dispatches on stream-element-type (CLISP opens files as 'unsigned-byte per shen.openh, so it uses a write-byte path). All backends now write to a non-stdout stream regardless of *hush*, matching SBCL/CCL. Issue #3 ((absvector <huge>) -> uncatchable SBCL heap exhaustion): make-array with an oversized count triggers an uncatchable HEAP-EXHAUSTED-ERROR abort that trap-error cannot recover from, taking down the image. Add a sanity cap (2^24 slots, ~800x the largest vector the kernel ever allocates) so an excessive request raises a catchable Shen simple-error instead of crashing. Matches shen-go's intent. Verified before/after on SBCL, CLISP and ECL (all binaries installed): - pr -q to a file now writes 'payload' on all three backends. - (trap-error (absvector 100000000000) (lambda E E)) returns the error object instead of aborting. Canonical kernel suite 134/134 on SBCL and CLISP; port suite 126/126 on SBCL. Kernel (klambda/*.kl) untouched; fix lives in the runtime layer. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This was referenced Jun 14, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2. Fixes #3.
Two host-runtime fixes (canonical
klambda/*.kluntouched), combined per cross-impl cluster.#2 — CLISP/ECL silence
prto file under-q: the nativeproverride was guarded#+(or ccl sbcl), so CLISP and ECL fell back to the kernel's*hush*-gatedprand silenced all streams. Extended the override to ECL (#+(or ccl sbcl ecl), character streams) and added a#+clispvariant that dispatches onstream-element-type(CLISP opens files asunsigned-byte, so file streams take a write-byte loop). All backends now write to non-stdout streams regardless of*hush*, matching SBCL.#3 —
(absvector <huge>)uncatchable heap exhaustion: added a2^24-slot cap (~800×the largest vector the kernel itself allocates); an out-of-range size now raises a catchablesimple-errorinstead of an SBCL heap-exhaustion abort.(trap-error (absvector 100000000000) (lambda E E))now returns the error; legitimate and boundary sizes still succeed.Verification: kernel certification SBCL 134/134, CLISP 134/134; port regression suite 126/126 on SBCL. Both repros pass on sbcl/clisp/ecl.
🤖 Generated with Claude Code