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

Move globals in top level exprs to the old generation of the GC. #54433

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

gbaraldi
Copy link
Member

This fixes #54422, the code here assumes that top level exprs are always rooted, but I don't see that referenced anywhere else, or guaranteed, so conservatively always root objects that show up in code.

@gbaraldi gbaraldi requested a review from vtjnash May 10, 2024 16:20
@gbaraldi gbaraldi changed the title Always root the contents in expression, regardless if they are top level or not. Always root the contents in expressions, regardless if they are top level or not. May 10, 2024
test/gc.jl Outdated Show resolved Hide resolved
@KristofferC
Copy link
Sponsor Member

@vtjnash, what does the 👎 mean here? Should that be taken as an objection to merging this?

@vtjnash
Copy link
Sponsor Member

vtjnash commented May 13, 2024

Toplevel exprs are supposed to be rooted

@gbaraldi
Copy link
Member Author

Right, basically this fixes this bug, but it seems there's another bug somewhere that's causing this.

@gbaraldi
Copy link
Member Author

gbaraldi commented May 16, 2024

So there are a couple things with this code, the correct solution here would be to special case globals from top level expressions in codegen to be assumed not to always have a root so having them trigger write barriers. IMO that is a lot of complexity for a corner case (compiled top level expressions) to save rooting a couple of extra values.
@vtjnash what do you think?

@gbaraldi gbaraldi changed the title Always root the contents in expressions, regardless if they are top level or not. Move globals in top level exprs to the old generation of the GC. May 17, 2024
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.

Basic use of StaticArrays and begin ... end leads to GC error (probable corruption)
3 participants