-d9a30434440469c640a120fe7132057f5644d38c
+0e482bef69d73b9381dbc543e200a1fe57275e81
The first line of this file holds the git revision number of the last
merge done from the gofrontend repository.
older versions of glibc when a SIGPROF signal arrives while
collecting a backtrace. */
-static uint32 runtime_in_callers;
+uint32 __go_runtime_in_callers;
/* Argument passed to callback function. */
bool
alreadyInCallers()
{
- return runtime_atomicload(&runtime_in_callers) > 0;
+ return runtime_atomicload(&__go_runtime_in_callers) > 0;
}
/* Gather caller PC's. */
data.max = m;
data.keep_thunks = keep_thunks;
state = __go_get_backtrace_state ();
- runtime_xadd (&runtime_in_callers, 1);
+ runtime_xadd (&__go_runtime_in_callers, 1);
backtrace_full (state, 0, callback, error_callback, &data);
- runtime_xadd (&runtime_in_callers, -1);
+ runtime_xadd (&__go_runtime_in_callers, -1);
/* For some reason GCC sometimes loses the name of a thunk function
at the top of the stack. If we are skipping thunks, skip that
scanstackwithmap (void *gcw)
{
_Unwind_Reason_Code code;
+ runtime_xadd (&__go_runtime_in_callers, 1);
code = _Unwind_Backtrace (scanstackwithmap_callback, gcw);
+ runtime_xadd (&__go_runtime_in_callers, -1);
return code == _URC_END_OF_STACK;
}
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;