]> Cypherpunks repositories - gostls13.git/commit
runtime: fix exit1 arguments on Darwin
authorAustin Clements <austin@google.com>
Fri, 16 Jun 2017 13:23:45 +0000 (09:23 -0400)
committerAustin Clements <austin@google.com>
Thu, 5 Oct 2017 20:34:45 +0000 (20:34 +0000)
commit91121ff704b937da9268ef0a7fc71c34233bbd1d
treebc7944f41eeac85c957e6c5a65780c9b05af1310
parentaac0d52d97351e0b2acaf5bb9b106eafc9e087cb
runtime: fix exit1 arguments on Darwin

exit1 calls the bsdthread_terminate system call on Darwin. Currently
it passes no arguments on 386, arm, and arm64, and an exit status on
amd64. None of these are right. The signature of bsdthread_terminate
is:

int bsdthread_terminate(user_addr_t stackaddr, size_t freesize, uint32_t port, uint32_t sem);

Fix all of the Darwin exit1 implementations to call
bsdthread_terminate with 0 for all of these arguments so it doesn't
try to unmap some random memory, free some random port, or signal a
random semaphore.

This isn't a problem in practice because exit1 is never called.
However, we're about to start using exit1.

Change-Id: Idc534d196e3104e5253fc399553f21eb608693d7
Reviewed-on: https://go-review.googlesource.com/46036
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/runtime/sys_darwin_386.s
src/runtime/sys_darwin_amd64.s
src/runtime/sys_darwin_arm.s
src/runtime/sys_darwin_arm64.s