]> Cypherpunks repositories - gostls13.git/commit
syscall: eliminate aliasing of syscall error strings in Plan 9
authorRichard Miller <miller.research@gmail.com>
Thu, 3 May 2018 10:27:48 +0000 (11:27 +0100)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 8 May 2018 14:57:01 +0000 (14:57 +0000)
commit1b49487692ec90e5438ae97cf3bbcb515bb47796
treefc6f3f01f782190a334aaf3c1291ec6bf00b784f
parentd148cbe1ec0f4cf9060c89561daff6ac5c3e0ad0
syscall: eliminate aliasing of syscall error strings in Plan 9

To avoid allocation between entersyscall and exitsyscall in Plan 9,
syscall error strings retrieved from the OS were being stored in
a shared buffer for each M, leading to overwriting of error strings
by subsequent syscalls, and potential confusion if exitsyscall
switched to a different M.  Instead, the error string is now
retrieved to the G stack and then copied to a new allocated array
after exitsyscall.

A new test TestPlan9Syserr is provided to confirm the correction.

Fixes #13770
Fixes #24921

Change-Id: I013c4a42baae80d03a5b61d828396527189f5551
Reviewed-on: https://go-review.googlesource.com/111195
Reviewed-by: David du Colombier <0intro@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: David du Colombier <0intro@gmail.com>
src/syscall/asm_plan9_386.s
src/syscall/asm_plan9_amd64.s
src/syscall/asm_plan9_arm.s
src/syscall/syscall_plan9_test.go [new file with mode: 0644]