• Austin Clements's avatar
    runtime: stop when we run out of hints in race mode · 4946d9e8
    Austin Clements authored
    Currently, the runtime falls back to asking for any address the OS can
    offer for the heap when it runs out of hint addresses. However, the
    race detector assumes the heap lives in [0x00c000000000,
    0x00e000000000), and will fail in a non-obvious way if we go outside
    this region.
    
    Fix this by actively throwing a useful error if we run out of heap
    hints in race mode.
    
    This problem is currently being triggered by TestArenaCollision, which
    intentionally triggers this fallback behavior. Fix the test to look
    for the new panic message in race mode.
    
    Fixes #24670.
    Updates #24133.
    
    Change-Id: I57de6d17a3495dc1f1f84afc382cd18a6efc2bf7
    Reviewed-on: https://go-review.googlesource.com/104717
    Run-TryBot: Austin Clements <austin@google.com>
    Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    4946d9e8
malloc.go 40.2 KB