1
0
mirror of https://github.com/golang/go synced 2024-11-08 09:06:15 -07:00
go/misc/cgo/testplugin/src
Lynn Boger 30a63ecee3 runtime: restore r2 when restoring state from gobuf in gogo on ppc64x
When using plugins with goroutines calling cgo, we hit a case where
an intermittent SIGSEGV occurs when referencing an address that is based
on r2 (TOC address). When the failure can be generated in gdb, the
contents of r2 is wrong even though the value in the current stack's
slot for r2 is correct. So that means it somehow switched to start
running the code in this function without passing through the beginning
of the function which had the correct value of r2 and stored it there.

It was noted that in runtime.gogo when the state is restored from
gobuf, r2 is not restored from its slot on the stack. Adding the
instruction to restore r2 prevents the SIGSEGV.

This adds a testcase under testplugin which reproduces the problem if
the program is run multiple times. The team who reported this problem
has verified it fixes the issue on their larger, more complex
application.

Fixes #25756

Change-Id: I6028b6f1f8775d5c23f4ebb57ae273330a28eb8f
Reviewed-on: https://go-review.googlesource.com/117515
Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2018-06-11 12:13:11 +00:00
..
common
host runtime, plugin: error not throw on duplicate open 2017-09-09 16:26:33 +00:00
iface
iface_a
iface_b
iface_i
issue18584 misc/cgo/testplugin: add test for issue 18584 2017-09-29 22:10:22 +00:00
issue18676
issue19418 cmd/link: support -X values for main.* in plugins 2017-10-04 00:46:06 +00:00
issue19529 cmd/link: type symbol name mangling for plugins 2017-10-05 09:51:31 +00:00
issue19534 plugin: resolve plugin import path issue 2017-04-26 00:54:54 +00:00
issue22175 cmd/link, runtime: put hasmain bit in moduledata 2017-10-13 01:13:33 +00:00
issue22295.pkg cmd/link, plugin: always encode path 2017-10-26 15:08:37 +00:00
issue24351 runtime: identify special functions by flag instead of address 2018-03-15 17:31:57 +00:00
issue25756 runtime: restore r2 when restoring state from gobuf in gogo on ppc64x 2018-06-11 12:13:11 +00:00
plugin1 cmd/go: pass plugin package name to compile -p 2017-09-01 18:27:59 +00:00
plugin2 cmd/go: pass plugin package name to compile -p 2017-09-01 18:27:59 +00:00
sub/plugin1