mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
runtime: better error message for newosproc failure
If creating a new thread fails with EAGAIN, point the user at ulimit. Fixes #15476. Change-Id: Ib36519614b5c72776ea7f218a0c62df1dd91a8ea Reviewed-on: https://go-review.googlesource.com/24570 Run-TryBot: Ian Lance Taylor <iant@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
8641e6fe21
commit
c7ae41e577
6 changed files with 16 additions and 0 deletions
|
|
@ -20,6 +20,8 @@ const (
|
|||
// From NetBSD's <sys/ucontext.h>
|
||||
_UC_SIGMASK = 0x01
|
||||
_UC_CPU = 0x04
|
||||
|
||||
_EAGAIN = 35
|
||||
)
|
||||
|
||||
type mOS struct {
|
||||
|
|
@ -162,6 +164,9 @@ func newosproc(mp *m, stk unsafe.Pointer) {
|
|||
ret := lwp_create(unsafe.Pointer(&uc), 0, unsafe.Pointer(&mp.procid))
|
||||
if ret < 0 {
|
||||
print("runtime: failed to create new OS thread (have ", mcount()-1, " already; errno=", -ret, ")\n")
|
||||
if ret == -_EAGAIN {
|
||||
println("runtime: may need to increase max user processes (ulimit -p)")
|
||||
}
|
||||
throw("runtime.newosproc")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue