-
Notifications
You must be signed in to change notification settings - Fork 18.7k
Closed
Labels
Milestone
Description
Tracking bug to decide whether to backport the fix to #15131 (Go binaries failing at start with procresize: invalid arg if there are more than 256 CPUs)
Request to do so from @mwhudson: #15131 (comment)
The fix (31cf1c1) is small and just caps the CPUs to 256:
diff --git a/src/runtime/proc.go b/src/runtime/proc.go
index 5145c84..1f55b0f 100644
--- a/src/runtime/proc.go
+++ b/src/runtime/proc.go
@@ -449,6 +449,9 @@ func schedinit() {
sched.lastpoll = uint64(nanotime())
procs := int(ncpu)
+ if procs > _MaxGomaxprocs {
+ procs = _MaxGomaxprocs
+ }
if n := atoi(gogetenv("GOMAXPROCS")); n > 0 {
if n > _MaxGomaxprocs {
n = _MaxGomaxprocs/cc @rsc @ianlancetaylor