]> Cypherpunks repositories - gostls13.git/commit
runtime: abort on fatal errors and panics in c-shared and c-archive modes
authorElias Naur <elias.naur@gmail.com>
Sat, 11 Jul 2015 10:59:00 +0000 (12:59 +0200)
committerIan Lance Taylor <iant@golang.org>
Sat, 11 Jul 2015 11:39:05 +0000 (11:39 +0000)
commitb3a8b0574ad94c0b26cacb2e926848f18ecb29f3
tree48a05b7015d541aeacf8ca36894cff4490b22b63
parentd5004ee69e117936890bf85b924c38f3bb505a6d
runtime: abort on fatal errors and panics in c-shared and c-archive modes

The default behaviour for fatal errors and runtime panics is to dump
the goroutine stack traces and exit with code 2. However, when the process is
owned by foreign code, it is suprising and inappropriate to suddenly exit
the whole process, even on fatal errors. Instead, re-use the crash behaviour
from GOTRACEBACK=crash and abort.

The motivating use case is issue #11382, where an Android crash reporter
is confused by an exiting process, but I believe the aborting behaviour
is appropriate for all cases where Go does not own the process.

The change is simple and contained and will enable reliable crash reporting
for Android apps in Go 1.5, but I'll leave it to others to judge whether it
is too late for Go 1.5.

Fixes #11382

Change-Id: I477328e1092f483591c99da1fbb8bc4411911785
Reviewed-on: https://go-review.googlesource.com/12032
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/runtime/runtime1.go