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

aclements opened this issue May 31, 2016 · 3 comments

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

aclements opened this issue May 31, 2016 · 3 comments


Copy link

@aclements 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
Copy link

@rsc rsc commented Oct 27, 2016

Punt to Go 1.9?

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

@aclements 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
@aclements aclements modified the milestones: Go1.12, Go1.13 Jan 8, 2019
@andybons andybons removed this from the Go1.13 milestone Jul 8, 2019
Copy link

@gopherbot gopherbot commented Jul 23, 2020

Change mentions this issue: runtime: move checkmarks to a separate bitmap

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.