• Russ Cox's avatar
    runtime: make continuation pc available to stack walk · 14d2ee1d
    Russ Cox authored
    The 'continuation pc' is where the frame will continue
    execution, if anywhere. For a frame that stopped execution
    due to a CALL instruction, the continuation pc is immediately
    after the CALL. But for a frame that stopped execution due to
    a fault, the continuation pc is the pc after the most recent CALL
    to deferproc in that frame, or else 0. That is where execution
    will continue, if anywhere.
    
    The liveness information is only recorded for CALL instructions.
    This change makes sure that we never look for liveness information
    except for CALL instructions.
    
    Using a valid PC fixes crashes when a garbage collection or
    stack copying tries to process a stack frame that has faulted.
    
    Record continuation pc in heapdump (format change).
    
    Fixes #8048.
    
    LGTM=iant, khr
    R=khr, iant, dvyukov
    CC=golang-codereviews, r
    https://golang.org/cl/100870044
    14d2ee1d
panic.c 14.4 KB