aboutsummaryrefslogtreecommitdiff
path: root/libgo/runtime/runtime.h
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2018-12-29 00:07:06 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-12-29 00:07:06 +0000
commite20bfbd18e64b8ab9428aa518b5d7b74a73461d9 (patch)
treea5200fb4bd7b40981b58590f089defa85c251512 /libgo/runtime/runtime.h
parent50bec22834e0b147fca92bea80501bccc309ce4d (diff)
downloadgcc-e20bfbd18e64b8ab9428aa518b5d7b74a73461d9.zip
gcc-e20bfbd18e64b8ab9428aa518b5d7b74a73461d9.tar.gz
gcc-e20bfbd18e64b8ab9428aa518b5d7b74a73461d9.tar.bz2
runtime: prevent deadlock when profiling signal arrives in stack scan
Precise stack scan needs to unwind the stack. When it is unwinding the stack, if a profiling signal arrives, which also does a traceback, it may deadlock in dl_iterate_phdr. Prevent this deadlock by setting up runtime_in_callers before traceback. Reviewed-on: https://go-review.googlesource.com/c/155766 From-SVN: r267457
Diffstat (limited to 'libgo/runtime/runtime.h')
-rw-r--r--libgo/runtime/runtime.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libgo/runtime/runtime.h b/libgo/runtime/runtime.h
index 21921ec..9f6e251 100644
--- a/libgo/runtime/runtime.h
+++ b/libgo/runtime/runtime.h
@@ -515,3 +515,9 @@ bool runtime_usestackmaps;
bool probestackmaps(void)
__asm__("runtime.probestackmaps");
+
+// This is set to non-zero when calling backtrace_full. This is used
+// to avoid getting hanging on a recursive lock in dl_iterate_phdr on
+// older versions of glibc when a SIGPROF signal arrives while
+// collecting a backtrace.
+extern uint32 __go_runtime_in_callers;