• Keith Randall's avatar
    runtime: on a signal, set traceback address to a deferreturn call · 9dac0a81
    Keith Randall authored
    When a function triggers a signal (like a segfault which translates to
    a nil pointer exception) during execution, a sigpanic handler is just
    below it on the stack.  The function itself did not stop at a
    safepoint, so we have to figure out what safepoint we should use to
    scan its stack frame.
    
    Previously we used the site of the most recent defer to get the live
    variables at the signal site. That answer is not quite correct, as
    explained in #27518. Instead, use the site of a deferreturn call.
    It has all the right variables marked as live (no args, all the return
    values, except those that escape to the heap, in which case the
    corresponding PAUTOHEAP variables will be live instead).
    
    This CL requires stack objects, so that all the local variables
    and args referenced by the deferred closures keep the right variables alive.
    
    Fixes #27518
    
    Change-Id: Id45d8a8666759986c203181090b962e2981e48ca
    Reviewed-on: https://go-review.googlesource.com/c/134637Reviewed-by: 's avatarAustin Clements <austin@google.com>
    Reviewed-by: 's avatarCherry Zhang <cherryyz@google.com>
    9dac0a81
Name
Last commit
Last update
..
addr2line Loading commit data...
api Loading commit data...
asm Loading commit data...
buildid Loading commit data...
cgo Loading commit data...
compile Loading commit data...
cover Loading commit data...
dist Loading commit data...
doc Loading commit data...
fix Loading commit data...
go Loading commit data...
gofmt Loading commit data...
internal Loading commit data...
link Loading commit data...
nm Loading commit data...
objdump Loading commit data...
pack Loading commit data...
pprof Loading commit data...
test2json Loading commit data...
trace Loading commit data...
vendor Loading commit data...
vet Loading commit data...