From: Aram Hăvărneanu Date: Tue, 1 Jul 2014 23:34:06 +0000 (+1000) Subject: runtime: properly restore registers in Solaris runtime·sigtramp X-Git-Tag: go1.4beta1~1180 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=d7b678b2ca26928390078c29e3f71868e867a182;p=gostls13.git runtime: properly restore registers in Solaris runtime·sigtramp We restored registers correctly in the usual case where the thread is a Go-managed thread and called runtime·sighandler, but we failed to do so when runtime·sigtramp was called on a cgo-created thread. In that case, runtime·sigtramp called runtime·badsignal, a Go function, and did not restore registers after it returned LGTM=rsc, dave R=rsc, dave CC=golang-codereviews, minux.ma https://golang.org/cl/105280050 --- diff --git a/src/pkg/runtime/sys_solaris_amd64.s b/src/pkg/runtime/sys_solaris_amd64.s index dd34e24d01..83e8dfac56 100644 --- a/src/pkg/runtime/sys_solaris_amd64.s +++ b/src/pkg/runtime/sys_solaris_amd64.s @@ -164,7 +164,7 @@ TEXT runtime·sigtramp(SB),NOSPLIT,$0 MOVQ DI, 0(SP) MOVQ $runtime·badsignal(SB), AX CALL AX - RET + JMP exit allgood: // save g @@ -259,6 +259,7 @@ allgood: MOVQ 80(SP), R10 MOVQ R10, g(BX) +exit: // restore registers MOVQ 32(SP), BX MOVQ 40(SP), BP