Skip to content

runtime: m->procid not set when using cgo #9914

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

Closed
derekparker opened this issue Feb 18, 2015 · 3 comments
Closed

runtime: m->procid not set when using cgo #9914

derekparker opened this issue Feb 18, 2015 · 3 comments
Milestone

Comments

@derekparker
Copy link
Contributor

Internally, m->procid is set by the OS specific functions defined by the Go runtime such as runtime.clone on Linux. These functions are not called when using cgo, preferring instead the C version.

Would it make sense to set m->procid in the various runtime.minit functions that are OS specific? That would ensure m->procid is always set, as I assume runtime.minit will always be called for any new thread.

@minux
Copy link
Member

minux commented Feb 18, 2015 via email

@derekparker
Copy link
Contributor Author

For debuggers, mostly - the actual runtime never cares about procid as far as I know. An M still represents an OS thread and will exist whether or not cgo is enabled, so procid should contain the correct thread ID.

@mikioh mikioh changed the title m->procid not set when using cgo runtime: m->procid not set when using cgo Feb 18, 2015
@rsc rsc added this to the Go1.5Maybe milestone Apr 10, 2015
@gopherbot
Copy link
Contributor

CL https://golang.org/cl/11341 mentions this issue.

@rsc rsc closed this as completed in a9e5364 Jun 24, 2015
@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jun 24, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants