• Dmitry Vyukov's avatar
    runtime: fix traceback from goexit1 · 894024f4
    Dmitry Vyukov authored
    We used to not call traceback from goexit1.
    But now tracer does it and crashes on amd64p32:
    
    runtime: unexpected return pc for runtime.getg called from 0x108a4240
    goroutine 18 [runnable, locked to thread]:
    runtime.traceGoEnd()
        src/runtime/trace.go:758 fp=0x10818fe0 sp=0x10818fdc
    runtime.goexit1()
        src/runtime/proc1.go:1540 +0x20 fp=0x10818fe8 sp=0x10818fe0
    runtime.getg(0x0)
        src/runtime/asm_386.s:2414 fp=0x10818fec sp=0x10818fe8
    created by runtime/pprof_test.TestTraceStress
        src/runtime/pprof/trace_test.go:123 +0x500
    
    Return PC from goexit1 points right after goexit (+0x6).
    It happens to work most of the time somehow.
    
    This change fixes traceback from goexit1 by adding an additional NOP to goexit.
    
    Fixes #9931
    
    Change-Id: Ied25240a181b0a2d7bc98127b3ed9068e9a1a13e
    Reviewed-on: https://go-review.googlesource.com/5460Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
    894024f4
Name
Last commit
Last update
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib/time Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.gitattributes Loading commit data...
.gitignore Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTING.md Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README.md Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...