This patch to libgo avoids crashing if there is no debug info when calling runtime.Callers. This is particularly useful because memory profiling, which is on at a low rate by default, will call runtime.Callers even though the program itself does not call it. This addresses part of GCC PR 64595. Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu. Committed to mainline.
Ian
diff -r 99f1142e61a7 libgo/runtime/go-callers.c --- a/libgo/runtime/go-callers.c Thu Jan 22 09:09:32 2015 -0800 +++ b/libgo/runtime/go-callers.c Fri Jan 23 11:46:26 2015 -0800 @@ -129,6 +129,11 @@ error_callback (void *data __attribute__ ((unused)), const char *msg, int errnum) { + if (errnum == -1) + { + /* No debug info available. Carry on as best we can. */ + return; + } if (errnum != 0) runtime_printf ("%s errno %d\n", msg, errnum); runtime_throw (msg);