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

Open
aclements opened this Issue May 31, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@aclements
Member

aclements commented May 31, 2016

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 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

This comment has been minimized.

Contributor

rsc commented Oct 27, 2016

Punt to Go 1.9?

@rsc rsc modified the milestones: Go1.8Maybe, Go1.8 Oct 27, 2016

@aclements

This comment has been minimized.

Member

aclements commented Oct 27, 2016

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment