From 35fe24981f6cb177f8631ff40eeb6ce499800229 Mon Sep 17 00:00:00 2001 From: Ayke van Laethem Date: Sat, 15 Sep 2018 18:55:49 +0200 Subject: [PATCH] runtime/unix: panic: call abort() instead of exit(2) abort() will cause gdb to show a backtrace when running inside the debugger, and abort() seems more appropriate anyway for critical errors. --- src/runtime/runtime_unix.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/runtime/runtime_unix.go b/src/runtime/runtime_unix.go index 9baf66c46..82937bb01 100644 --- a/src/runtime/runtime_unix.go +++ b/src/runtime/runtime_unix.go @@ -9,7 +9,7 @@ import ( func _Cfunc_putchar(c int) int func _Cfunc_usleep(usec uint) int func _Cfunc_calloc(nmemb, size uintptr) unsafe.Pointer -func _Cfunc_exit(status int) +func _Cfunc_abort() func _Cfunc_clock_gettime(clk_id uint, ts *timespec) type timeUnit int64 @@ -52,7 +52,7 @@ func ticks() timeUnit { func abort() { // panic() exits with exit code 2. - _Cfunc_exit(2) + _Cfunc_abort() } func alloc(size uintptr) unsafe.Pointer {