Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GC bug: Args values are getting collected prematurely #2345

Open
seven1m opened this issue Nov 18, 2024 · 0 comments · May be fixed by #2357
Open

GC bug: Args values are getting collected prematurely #2345

seven1m opened this issue Nov 18, 2024 · 0 comments · May be fixed by #2357
Labels
bug Something isn't working

Comments

@seven1m
Copy link
Member

seven1m commented Nov 18, 2024

I discovered this during my work on #2274, with the builds of clang and gcc provided by nix.

Specifically this test:

spec/core/io/write_spec.rb gets this error: Errno::ENOENT

But the error message is a red herring. The actual issue is that File.open gets its path argument collected and overwritten with a different (nonsensical) string value.

Args has a Vector<Value>, which in turn has a pointer to the (non-GC-managed) heap. The GC doesn't know to follow the Vector and doesn't see the Values inside it as reachable.

There is some discussion in Discord: https://discord.com/channels/868454594085281793/1307889414457790464

@seven1m seven1m added the bug Something isn't working label Nov 18, 2024
This was referenced Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant