]> Cypherpunks repositories - gostls13.git/commit
runtime: handle sysReserve failure in mHeap_SysAlloc
authorJoel Sing <jsing@google.com>
Sat, 26 Sep 2015 17:56:05 +0000 (03:56 +1000)
committerJoel Sing <jsing@google.com>
Thu, 1 Oct 2015 14:40:02 +0000 (14:40 +0000)
commit1d5251f707af711720cbd92891a1d62b89c15977
tree41be3fcd1fba1c187454fe31cfb3cb07e2d42fc2
parent59bacb285c9dd6626b3fa6c620eb38dd7ea095b3
runtime: handle sysReserve failure in mHeap_SysAlloc

sysReserve will return nil on failure - correctly handle this case and return
nil to the caller. Currently, a failure will result in h.arena_end being set
to psize, h.arena_used being set to zero and fun times ensue.

On the openbsd/arm builder this has resulted in:

  runtime: address space conflict: map(0x0) = 0x40946000
  fatal error: runtime: address space conflict

When it should be reporting out of memory instead.

Change-Id: Iba828d5ee48ee1946de75eba409e0cfb04f089d4
Reviewed-on: https://go-review.googlesource.com/15056
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Austin Clements <austin@google.com>
src/runtime/malloc.go