Skip to content

Test that recursion through Pharo ends at the stack limit - #11

Merged
noha merged 1 commit into
mainfrom
stack-limit-through-callbacks
Oct 29, 2026
Merged

noha merged 1 commit into
mainfrom
stack-limit-through-callbacks

Conversation

@noha

@noha noha commented Oct 29, 2026

Copy link
Copy Markdown
Contributor

A closure that calls the method calling it runs JS, Pharo and JS again on the one C stack. Only the outermost evaluation sets the stack top, so the 1 MB limit QuickJS keeps by default counts the frames in between and ends the recursion with an error; the context works afterwards.

  • test_shim.c: a fake Pharo selector again: that calls a JS function once and fails with its exception, like QJSContext>>handleCall:.
  • QJSSandboxTest: the same recursion through QJSTestGrid>>rowsDo:, with real Pharo frames on the stack. The message is not checked: at the deepest level toString of the error can hit the limit too, and Bellard's QuickJS then answers no message.
  • QJSRuntime and README name the stack limit.

A closure that calls the method calling it runs JS, Pharo and JS again
on the one C stack. Only the outermost evaluation sets the stack top, so
the 1 MB limit QuickJS keeps by default counts the frames in between and
ends the recursion with an error; the context works afterwards.

- test_shim.c: a fake Pharo selector again: that calls a JS function
  once and fails with its exception, like QJSContext>>handleCall:.
- QJSSandboxTest: the same recursion through QJSTestGrid>>rowsDo:, with
  real Pharo frames on the stack. The message is not checked: at the
  deepest level toString of the error can hit the limit too, and
  Bellard's QuickJS then answers no message.
- QJSRuntime and README name the stack limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@noha
noha merged commit 98b920c into main Oct 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant