]> Cypherpunks repositories - gostls13.git/commit
runtime: fix "invalid address in sys call" on Plan 9
authorDavid du Colombier <0intro@gmail.com>
Fri, 14 Feb 2014 21:27:47 +0000 (22:27 +0100)
committerDavid du Colombier <0intro@gmail.com>
Fri, 14 Feb 2014 21:27:47 +0000 (22:27 +0100)
commit56872f02f0f69f32d4d919e4cacee9672e7a5a97
tree29f51a25afd279e02590df4b7d2136dfc428b699
parent1dc82d25632fc402edb36b0d50ecf4d681d77286
runtime: fix "invalid address in sys call" on Plan 9

Rfork is not splitting the stack when creating a new thread,
so the parent and child are executing on the same stack.
However, if the parent returns and keeps executing before
the child can read the arguments from the parent stack,
the child will not see the right arguments. The solution
is to load the needed pieces from the parent stack into
register before INT $64.

Thanks to Russ Cox for the explanation.

LGTM=rsc
R=rsc
CC=ality, golang-codereviews
https://golang.org/cl/64140043
src/pkg/runtime/sys_plan9_386.s