1
0
mirror of https://github.com/golang/go synced 2024-11-17 05:44:52 -07:00

runtime: print error if mmap fails

Fixes #49687

Change-Id: Ife7f64f4c98449eaff7327e09bc1fb67acee72c9
Reviewed-on: https://go-review.googlesource.com/c/go/+/379354
Trust: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
This commit is contained in:
Ian Lance Taylor 2022-01-18 19:44:34 -08:00
parent c1296af151
commit bb7fb8a5fa
4 changed files with 4 additions and 0 deletions

View File

@ -72,6 +72,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
throw("runtime: out of memory") throw("runtime: out of memory")
} }
if err != 0 { if err != 0 {
print("runtime: mprotect(", v, ", ", n, ") returned ", err, "\n")
throw("runtime: cannot map pages in arena address space") throw("runtime: cannot map pages in arena address space")
} }
} }

View File

@ -73,6 +73,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
throw("runtime: out of memory") throw("runtime: out of memory")
} }
if p != v || err != 0 { if p != v || err != 0 {
print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
throw("runtime: cannot map pages in arena address space") throw("runtime: cannot map pages in arena address space")
} }
} }

View File

@ -66,6 +66,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
throw("runtime: out of memory") throw("runtime: out of memory")
} }
if p != v || err != 0 { if p != v || err != 0 {
print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
throw("runtime: cannot map pages in arena address space") throw("runtime: cannot map pages in arena address space")
} }
} }

View File

@ -189,6 +189,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
throw("runtime: out of memory") throw("runtime: out of memory")
} }
if p != v || err != 0 { if p != v || err != 0 {
print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
throw("runtime: cannot map pages in arena address space") throw("runtime: cannot map pages in arena address space")
} }
} }