Skip to content

Comments

fix: mark Logger in Parser GC to prevent use-after-free#100

Merged
stackmystack merged 1 commit intoFaveod:masterfrom
yancya:fix/parser-gc-mark-logger
Feb 19, 2026
Merged

fix: mark Logger in Parser GC to prevent use-after-free#100
stackmystack merged 1 commit intoFaveod:masterfrom
yancya:fix/parser-gc-mark-logger

Conversation

@yancya
Copy link
Contributor

@yancya yancya commented Feb 16, 2026

Noticed in #99 CI that Parser does not mark the Logger Ruby object during GC, causing use-after-free when GC collects the Logger while tree-sitter still holds a callback pointer to it.

Adds dmark/dcompact to parser_data_type and stores VALUE logger in parser_t.

Parser was not marking the Logger Ruby object during GC, causing the
Logger to be collected while still referenced by tree-sitter's C
callback. This adds mark/compact functions to parser_t and stores the
Logger VALUE so GC keeps it alive.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@stackmystack
Copy link
Collaborator

Thanks again!

@stackmystack stackmystack merged commit bfd19f8 into Faveod:master Feb 19, 2026
19 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.

2 participants