Skip to content

Fix CopySpace::is_live #1317

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix CopySpace::is_live #1317

wants to merge 1 commit into from

Conversation

k-sareen
Copy link
Collaborator

This commit fixes the CopySpace::is_live function to check if a to-space object's address is actually below the current page resource cursor. By definition, a to-space object cannot be live if it is beyond the cursor.

This commit fixes the `CopySpace::is_live` function to check if a to-space object's address is actually below the current page resource cursor. By definition, a to-space object cannot be live if it is beyond the cursor.
@k-sareen
Copy link
Collaborator Author

k-sareen commented May 10, 2025

Ran into this bug when I was using fixed extent semi-spaces. Since we don't zero pages on release, we could have stale data there from the last GC wherein the (dead) object is beyond the cursor but it was forwarded so both !self.is_from_space() and is_forwarded will return true. The fix now makes it clearer that it needs to be mutually exclusive, i.e. we can't have forwarded objects in to-space.

@qinsoon
Copy link
Member

qinsoon commented May 10, 2025

Ran into this bug when I was using fixed extent semi-spaces. Since we don't zero pages on release, we could have stale data there from the last GC wherein the (dead) object is beyond the cursor but it was forwarded so both !self.is_from_space() and is_forwarded will return true. The fix now makes it clearer that it needs to be mutually exclusive, i.e. we can't have forwarded objects in to-space.

The function is_live requires an object reference. But in this case, what gets passed to the function is not a valid object reference.

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