diff options
author | Ian Lance Taylor <iant@golang.org> | 2018-02-23 10:34:01 -0800 |
---|---|---|
committer | Ian Lance Taylor <iant@golang.org> | 2018-02-23 22:39:46 +0000 |
commit | 804e3e565e98e1ff3a22eb354a473225f6dc7351 (patch) | |
tree | 17140bfce6bd2ea40c967e9df4610b0a754b2fc3 /src/runtime/iface.go | |
parent | a5e8e2d99815346cdff61905237056e0095c75ea (diff) | |
download | go-804e3e565e98e1ff3a22eb354a473225f6dc7351.tar.gz go-804e3e565e98e1ff3a22eb354a473225f6dc7351.zip |
runtime: don't check for String/Error methods in printany
They have either already been called by preprintpanics, or they can
not be called safely because of the various conditions checked at the
start of gopanic.
Fixes #24059
Change-Id: I4a6233d12c9f7aaaee72f343257ea108bae79241
Reviewed-on: https://go-review.googlesource.com/96755
Reviewed-by: Austin Clements <austin@google.com>
Diffstat (limited to 'src/runtime/iface.go')
-rw-r--r-- | src/runtime/iface.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/runtime/iface.go b/src/runtime/iface.go index 7c5d3a05b2..bd6bc282f4 100644 --- a/src/runtime/iface.go +++ b/src/runtime/iface.go @@ -113,6 +113,14 @@ func (t *itabTableType) find(inter *interfacetype, typ *_type) *itab { // itabAdd adds the given itab to the itab hash table. // itabLock must be held. func itabAdd(m *itab) { + // Bugs can lead to calling this while mallocing is set, + // typically because this is called while panicing. + // Crash reliably, rather than only when we need to grow + // the hash table. + if getg().m.mallocing != 0 { + throw("malloc deadlock") + } + t := itabTable if t.count >= 3*(t.size/4) { // 75% load factor // Grow hash table. |