| 23 | namespace __asan { |
| 24 | |
| 25 | static void OnStackUnwind(const SignalContext &sig, |
| 26 | const void *callback_context, |
| 27 | BufferedStackTrace *stack) { |
| 28 | bool fast = common_flags()->fast_unwind_on_fatal; |
| 29 | #if SANITIZER_FREEBSD || SANITIZER_NETBSD |
| 30 | // On FreeBSD the slow unwinding that leverages _Unwind_Backtrace() |
| 31 | // yields the call stack of the signal's handler and not of the code |
| 32 | // that raised the signal (as it does on Linux). |
| 33 | fast = true; |
| 34 | #endif |
| 35 | // Tests and maybe some users expect that scariness is going to be printed |
| 36 | // just before the stack. As only asan has scariness score we have no |
| 37 | // corresponding code in the sanitizer_common and we use this callback to |
| 38 | // print it. |
| 39 | static_cast<const ScarinessScoreBase *>(callback_context)->Print(); |
| 40 | stack->Unwind(StackTrace::GetNextInstructionPc(sig.pc), sig.bp, sig.context, |
| 41 | fast); |
| 42 | } |
| 43 | |
| 44 | void ErrorDeadlySignal::Print() { |
| 45 | ReportDeadlySignal(signal, tid, &OnStackUnwind, &scariness); |
nothing calls this directly
no test coverage detected