diff options
author | Keith Randall <khr@golang.org> | 2018-07-16 14:39:40 -0700 |
---|---|---|
committer | Keith Randall <khr@golang.org> | 2018-07-24 21:06:55 +0000 |
commit | fe68ab3bcde97e3a325e4aa3c70f5f9172540453 (patch) | |
tree | 2181dfee533b37de34b2bab525c88f4104c34942 /src/runtime/os_solaris.go | |
parent | 5fc70b6fac0664f3f9d2c2948ba78db420ba70c5 (diff) | |
download | go-fe68ab3bcde97e3a325e4aa3c70f5f9172540453.tar.gz go-fe68ab3bcde97e3a325e4aa3c70f5f9172540453.zip |
runtime: traceback from outermost libc call
If we're in a libc call and get a trap, don't try to traceback the libc call.
Start from the state we had at entry to libc.
If there are multiple libc calls outstanding, remember the outermost one.
Fixes #26393
Change-Id: Icfe8794b95bf3bfd1a0679b456dcde2481dcabf3
Reviewed-on: https://go-review.googlesource.com/124195
Reviewed-by: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/runtime/os_solaris.go')
-rw-r--r-- | src/runtime/os_solaris.go | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/runtime/os_solaris.go b/src/runtime/os_solaris.go index 703a2e5430..4575b5e641 100644 --- a/src/runtime/os_solaris.go +++ b/src/runtime/os_solaris.go @@ -37,12 +37,14 @@ func sysvicall0(fn *libcFunc) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil // See comment in sys_darwin.go:libcCall } var libcall libcall @@ -64,12 +66,14 @@ func sysvicall1(fn *libcFunc, a1 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall @@ -92,12 +96,14 @@ func sysvicall2(fn *libcFunc, a1, a2 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall @@ -119,12 +125,14 @@ func sysvicall3(fn *libcFunc, a1, a2, a3 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall @@ -146,12 +154,14 @@ func sysvicall4(fn *libcFunc, a1, a2, a3, a4 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall @@ -173,12 +183,14 @@ func sysvicall5(fn *libcFunc, a1, a2, a3, a4, a5 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall @@ -200,12 +212,14 @@ func sysvicall6(fn *libcFunc, a1, a2, a3, a4, a5, a6 uintptr) uintptr { if gp != nil { mp = gp.m } - if mp != nil { + if mp != nil && mp.libcallsp == 0 { mp.libcallg.set(gp) mp.libcallpc = getcallerpc() // sp must be the last, because once async cpu profiler finds // all three values to be non-zero, it will use them mp.libcallsp = getcallersp() + } else { + mp = nil } var libcall libcall |