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

Unsafe scope checking for CCs #137

Open
shwestrick opened this issue Apr 13, 2021 · 0 comments
Open

Unsafe scope checking for CCs #137

shwestrick opened this issue Apr 13, 2021 · 0 comments
Labels

Comments

@shwestrick
Copy link
Collaborator

Background: To do concurrent collection, we need an efficient way of checking whether or not a chunk is in scope of the collection. Currently this is done by, at the beginning of collection, marking each in-scope chunk with a identifier that
uniquely identifies the collection. Then we can determine if a chunk is in-scope by inspecting the identifier. When CC was implemented, this was perfectly safe, because chunk descriptors (where the identifier is stored) were never overwritten
throughout execution.

Problem: Under the new chunk allocator design (#135), this approach is no longer safe. Chunks freed by local collections might be recycled into a different size class, causing their chunk descriptor to be potentially overwritten. The likelihood of this causing a problem in practice, however, is exceedingly rare.

Suggested solution: At the beginning of CC, construct a hash-set of in-scope chunk ids. To check that an object is in-scope, get its chunk id (by masking its address) and check if the chunk-id is in the hash-set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant