• Vladimir Stefanovic's avatar
    runtime/pprof: prevent a deadlock that SIGPROF might create on mips{,le} · 835dfef9
    Vladimir Stefanovic authored
    64bit atomics on mips/mipsle are implemented using spinlocks. If SIGPROF
    is received while the program is in the critical section, it will try to
    write the sample using the same spinlock, creating a deadloop.
    Prevent it by creating a counter of SIGPROFs during atomic64 and
    postpone writing the sample(s) until called from elsewhere, with
    pc set to _LostSIGPROFDuringAtomic64.
    
    Added a test case, per Cherry's suggestion. Works around #20146.
    
    Change-Id: Icff504180bae4ee83d78b19c0d9d6a80097087f9
    Reviewed-on: https://go-review.googlesource.com/42652
    Run-TryBot: Cherry Zhang <cherryyz@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    835dfef9
Name
Last commit
Last update
..
internal/profile Loading commit data...
testdata Loading commit data...
elf.go Loading commit data...
label.go Loading commit data...
label_test.go Loading commit data...
map.go Loading commit data...
mprof_test.go Loading commit data...
pprof.go Loading commit data...
pprof_test.go Loading commit data...
proto.go Loading commit data...
proto_test.go Loading commit data...
protobuf.go Loading commit data...
protomem.go Loading commit data...
protomem_test.go Loading commit data...
runtime.go Loading commit data...
runtime_test.go Loading commit data...