Skip to content

Avoid deep Array#== in test_spill_frames_stack - #1149

Merged
byroot merged 1 commit into
masterfrom
claude/json-parser-stack-overflow-40b262
Nov 16, 2026
Merged

byroot merged 1 commit into
masterfrom
claude/json-parser-stack-overflow-40b262

Conversation

@hsbt

@hsbt hsbt commented Nov 16, 2026

Copy link
Copy Markdown
Member

test_spill_frames_stack has been failing with SystemStackError on the windows-latest head job since ruby/ruby@c65a8e03f1, for example https://github.com/ruby/json/actions/runs/43444925365/job/131951843336.

That commit checks the machine stack on the rb_funcall fast path. The 1000 levels of Array#== recursion in assert_equal now trip that check on the mingw build, whose main thread stack is only 2MB.

This compares the generated JSON with the input instead, so the assertion no longer recurses through rb_funcall.

Generated with Claude Code

Comment thread test/json/resumable_parser_test.rb Outdated
@parser << json
assert @parser.parse
assert_equal expected, @parser.value
# Array#== on 1000 nested levels raises SystemStackError on ruby-head mingw since ruby/ruby@c65a8e03f1.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# Array#== on 1000 nested levels raises SystemStackError on ruby-head mingw since ruby/ruby@c65a8e03f1.

Since ruby/ruby@c65a8e03f1 checks the machine stack on the rb_funcall fast path, comparing the 1000 levels deep arrays raises SystemStackError on the mingw build of ruby-head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@byroot
byroot force-pushed the claude/json-parser-stack-overflow-40b262 branch from 0539a74 to bef64b4 Compare November 16, 2026 08:23
@byroot
byroot merged commit 1955c7d into master Nov 16, 2026
84 checks passed
@byroot
byroot deleted the claude/json-parser-stack-overflow-40b262 branch November 16, 2026 08:24
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.

2 participants