]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: print error if mmap fails
authorIan Lance Taylor <iant@golang.org>
Wed, 19 Jan 2022 03:44:34 +0000 (19:44 -0800)
committerIan Lance Taylor <iant@golang.org>
Wed, 19 Jan 2022 21:46:55 +0000 (21:46 +0000)
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>
src/runtime/mem_aix.go
src/runtime/mem_bsd.go
src/runtime/mem_darwin.go
src/runtime/mem_linux.go

index 957aa4dcc2fa31486e3b80868a7ed327d0e3ee34..489d7928e155687ab63af0e893841d5ce66254ed 100644 (file)
@@ -72,6 +72,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
                throw("runtime: out of memory")
        }
        if err != 0 {
+               print("runtime: mprotect(", v, ", ", n, ") returned ", err, "\n")
                throw("runtime: cannot map pages in arena address space")
        }
 }
index b1525717921d1d588d27a7a9e73ee71bce95d283..49337eafbf6242b0d6f3ed7c919320e716fd7e1b 100644 (file)
@@ -73,6 +73,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
                throw("runtime: out of memory")
        }
        if p != v || err != 0 {
+               print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
                throw("runtime: cannot map pages in arena address space")
        }
 }
index 7fccd2bb8eed74ca57afcac7d80ea500450c14b1..9f836c08187b9dd8c9a673b3bda6031701f5c2ee 100644 (file)
@@ -66,6 +66,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
                throw("runtime: out of memory")
        }
        if p != v || err != 0 {
+               print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
                throw("runtime: cannot map pages in arena address space")
        }
 }
index f8f9c531701f97ac9682315aa648f7a4b2871cb1..f8333014c2ee6917ca595bce78d0ea4f34a69e5b 100644 (file)
@@ -189,6 +189,7 @@ func sysMap(v unsafe.Pointer, n uintptr, sysStat *sysMemStat) {
                throw("runtime: out of memory")
        }
        if p != v || err != 0 {
+               print("runtime: mmap(", v, ", ", n, ") returned ", p, ", ", err, "\n")
                throw("runtime: cannot map pages in arena address space")
        }
 }