]> Cypherpunks repositories - gostls13.git/commit
runtime: fix traceback from goexit1
authorDmitry Vyukov <dvyukov@google.com>
Fri, 20 Feb 2015 17:07:02 +0000 (20:07 +0300)
committerRuss Cox <rsc@golang.org>
Sat, 28 Feb 2015 23:19:57 +0000 (23:19 +0000)
commit894024f478bff096871e20b5ea7bceb64c70d33f
treec9a972b8b91b3af01c2567276c5bdfaf9e8f8a5b
parent2dbee8919c5c0e19e26e9d80d9135c367d2bf4cf
runtime: fix traceback from goexit1

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/5460
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/asm_386.s
src/runtime/asm_amd64.s
src/runtime/asm_amd64p32.s
src/runtime/asm_arm.s
src/runtime/asm_ppc64x.s
src/runtime/proc1.go