Skip to content

gc: scrub popped-frame stack residue in GC completeness tests#33

Merged
gf712 merged 4 commits into
mainfrom
fix-gc-test
Jul 6, 2026
Merged

gc: scrub popped-frame stack residue in GC completeness tests#33
gf712 merged 4 commits into
mainfrom
fix-gc-test

Conversation

@gf712

@gf712 gf712 commented Jul 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

Comment thread src/memory/GarbageCollector_tests.cpp Outdated
@claude

claude Bot commented Jul 6, 2026

Copy link
Copy Markdown

Code review

Found 1 issue — see the inline comments.

gf712 and others added 3 commits July 6, 2026 15:51
The scrub memset ran from the buffer up to the frame header, past the
end of the array: an out-of-bounds write that aborts under ASan with
stack-buffer-overflow (verified empirically). Bound the memset by the
array itself and route the allocating helpers through a padded-frame
trampoline so their stale-pointer residue lands inside the span the
scrub can legally zero, instead of in the last few words below the
frame header that the buffer cannot reach.

Addresses the review comment on PR #33.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NJ25FGK2EUWCLz2PaUwbT
The garbage collector finds roots by conservatively scanning the
machine stack. ASan's use-after-return fake stack relocates locals to
heap memory the scan never sees, so the GC completeness tests fail
under an ASan build even with a correct stack scrub. Bake
detect_stack_use_after_return=0 into the test binary via
__asan_default_options so ASan builds work out of the box; the rest of
ASan's checks are unaffected.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017NJ25FGK2EUWCLz2PaUwbT
@gf712 gf712 merged commit 23886c0 into main Jul 6, 2026
2 checks passed
@gf712 gf712 deleted the fix-gc-test branch July 6, 2026 17:37
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