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

runtime: checkmark doesn't follow one-word objects with finalizers #15903

Closed
aclements opened this issue May 31, 2016 · 3 comments
Closed

runtime: checkmark doesn't follow one-word objects with finalizers #15903

aclements opened this issue May 31, 2016 · 3 comments
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.

Comments

@aclements
Copy link
Member

Oh, checkmark. For one-word pointer objects, we store the checkmark in the type bit. That means that, at the beginning of checkmark, the type bits of all one-word objects are set to "scalar", even though they're all pointers. For most objects this is fine, since we'll "mark" them before scanning them, which will set one-word objects to "pointer". However, for objects with finalizers, we scan the object without marking it. If the object isn't otherwise reachable, nothing will have set its checkmark, so scanobject will see it as a "scalar" word and not follow it.

This is such an obscure combination of circumstances that I'm not worried about fixing it for now. But there are a few ways to fix it. We could teach scanobject that one word objects are always a pointer, though that would potentially slow down an extremely hot code path for almost no gain. We could put the checkmark in the live/dead bit now that it's free. Or we could pull the checkmark out of the heap bitmap entirely (I already have a CL to do this locally).

/cc @RLH

@aclements aclements added the NeedsFix The path to resolution is known, but the work has not been done. label May 31, 2016
@aclements aclements added this to the Go1.8 milestone May 31, 2016
@aclements aclements self-assigned this May 31, 2016
@rsc
Copy link
Contributor

rsc commented Oct 27, 2016

Punt to Go 1.9?

@rsc rsc modified the milestones: Go1.8Maybe, Go1.8 Oct 27, 2016
@aclements
Copy link
Member Author

Very low priority. Punting to 1.9.

@aclements aclements modified the milestones: Go1.9Maybe, Go1.8Maybe Oct 27, 2016
@aclements aclements modified the milestones: Go1.10, Go1.9Maybe Jul 18, 2017
@rsc rsc modified the milestones: Go1.10, Go1.11 Nov 22, 2017
@ianlancetaylor ianlancetaylor modified the milestones: Go1.11, Go1.12 Jul 9, 2018
@aclements aclements modified the milestones: Go1.12, Go1.13 Jan 8, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
@gopherbot
Copy link

Change https://golang.org/cl/244539 mentions this issue: runtime: move checkmarks to a separate bitmap

@golang golang locked and limited conversation to collaborators Aug 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants