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:
Ian Lance Taylor 2016-06-28 17:06:59 -07:00
parent 8641e6fe21
commit c7ae41e577
6 changed files with 16 additions and 0 deletions

View file

@ -165,6 +165,9 @@ func newosproc(mp *m, _ unsafe.Pointer) {
sigprocmask(_SIG_SETMASK, &oset, nil)
if ret != 0 {
print("runtime: failed to create new OS thread (have ", mcount(), " already; errno=", ret, ")\n")
if ret == -_EAGAIN {
println("runtime: may need to increase max user processes (ulimit -u)")
}
throw("newosproc")
}
}