]> Cypherpunks.ru repositories - gostls13.git/commit
runtime: ensure abort actually crashes the process
authorAustin Clements <austin@google.com>
Thu, 18 Jan 2018 22:33:04 +0000 (17:33 -0500)
committerAustin Clements <austin@google.com>
Thu, 8 Mar 2018 22:55:55 +0000 (22:55 +0000)
commit60a9e5d613d6de21735e54ca62246e3f8ef8c8d3
tree624041ce95b576aea8c360107d5560c980a5f268
parentc950a90d7240a6f2124ae38564c137b86866b191
runtime: ensure abort actually crashes the process

On all non-x86 arches, runtime.abort simply reads from nil.
Unfortunately, if this happens on a user stack, the signal handler
will dutifully turn this into a panicmem, which lets user defers run
and which user code can even recover from.

To fix this, add an explicit check to the signal handler that turns
faults in abort into hard crashes directly in the signal handler. This
has the added benefit of giving a register dump at the abort point.

Change-Id: If26a7f13790745ee3867db7f53b72d8281176d70
Reviewed-on: https://go-review.googlesource.com/93661
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
16 files changed:
src/cmd/vet/all/whitelist/386.txt
src/cmd/vet/all/whitelist/amd64.txt
src/cmd/vet/all/whitelist/arm.txt
src/cmd/vet/all/whitelist/arm64.txt
src/cmd/vet/all/whitelist/mips64x.txt
src/cmd/vet/all/whitelist/mipsx.txt
src/cmd/vet/all/whitelist/nacl_amd64p32.txt
src/cmd/vet/all/whitelist/ppc64x.txt
src/cmd/vet/all/whitelist/s390x.txt
src/runtime/crash_test.go
src/runtime/os3_plan9.go
src/runtime/signal_sighandler.go
src/runtime/signal_windows.go
src/runtime/stubs.go
src/runtime/testdata/testprog/abort.go [new file with mode: 0644]
src/runtime/testdata/testprog/empty.s [new file with mode: 0644]