Skip to content

runtime: getproccount fails on systems with large CPU masks #11823

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
fweimer opened this issue Jul 22, 2015 · 1 comment
Closed

runtime: getproccount fails on systems with large CPU masks #11823

fweimer opened this issue Jul 22, 2015 · 1 comment
Milestone

Comments

@fweimer
Copy link
Contributor

fweimer commented Jul 22, 2015

runtime.getproccount() lacks a retry loop with a growing buffer. If the kernel CPU mask exceeds the supplied size (1024 bits), r will be an error code, and the function will panic.

This is from a system with a CPU mask size of 4096 bits:

panic: nil
fatal error: panic on system stack
runtime: panic before malloc heap initialized

runtime stack:
fatal error: gentraceback before goexitPC initialization
runtime: panic before malloc heap initialized
panic during panic

runtime stack:
fatal error: gentraceback before goexitPC initialization
runtime: panic before malloc heap initialized
stack trace unavailable

Note that the kernel CPU mask may be significantly larger than the number of threads supported by the system, depending on the CPU topology reported by the firmware to the kernel.

@rsc
Copy link
Contributor

rsc commented Jul 22, 2015

Started.

@rsc rsc changed the title Go 1.5 programs do not run on machines with many CPUs runtime: getproccount fails on systems with large CPU masks Jul 22, 2015
@rsc rsc added this to the Go1.5 milestone Jul 22, 2015
@rsc rsc closed this as completed in 77d38d9 Jul 22, 2015
@golang golang locked and limited conversation to collaborators Aug 5, 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

3 participants