diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:55 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-05-02 18:30:55 +0000 |
| commit | 8d8e909cdc9f4e78e1e1600497d827e1acde6cea (patch) | |
| tree | c8c6047827589e56f2ed1f77f23b1f7d1a10e793 /lib/ubsan/ubsan_diag.cc | |
| parent | 2953104c9a262728031dc518429d15b969dd6028 (diff) | |
Notes
Diffstat (limited to 'lib/ubsan/ubsan_diag.cc')
| -rw-r--r-- | lib/ubsan/ubsan_diag.cc | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/ubsan/ubsan_diag.cc b/lib/ubsan/ubsan_diag.cc index bbe1e07390ad..742802b8f341 100644 --- a/lib/ubsan/ubsan_diag.cc +++ b/lib/ubsan/ubsan_diag.cc @@ -31,15 +31,16 @@ static void MaybePrintStackTrace(uptr pc, uptr bp) { // will definitely be called when we print the first diagnostics message. if (!flags()->print_stacktrace) return; - // We can only use slow unwind, as we don't have any information about stack - // top/bottom. - // FIXME: It's better to respect "fast_unwind_on_fatal" runtime flag and - // fetch stack top/bottom information if we have it (e.g. if we're running - // under ASan). - if (StackTrace::WillUseFastUnwind(false)) - return; + + uptr top = 0; + uptr bottom = 0; + bool request_fast_unwind = common_flags()->fast_unwind_on_fatal; + if (request_fast_unwind) + __sanitizer::GetThreadStackTopAndBottom(false, &top, &bottom); + BufferedStackTrace stack; - stack.Unwind(kStackTraceMax, pc, bp, 0, 0, 0, false); + stack.Unwind(kStackTraceMax, pc, bp, nullptr, top, bottom, + request_fast_unwind); stack.Print(); } |
