diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
| commit | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (patch) | |
| tree | 3467f3372c1195b1546172d89af2205a50b1866d /lib/tsan/rtl/tsan_sync.cc | |
| parent | 11023dc647fd8f41418da90d59db138400d0f334 (diff) | |
Notes
Diffstat (limited to 'lib/tsan/rtl/tsan_sync.cc')
| -rw-r--r-- | lib/tsan/rtl/tsan_sync.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/tsan/rtl/tsan_sync.cc b/lib/tsan/rtl/tsan_sync.cc index c6ddcdb37426..f8f3c40fab04 100644 --- a/lib/tsan/rtl/tsan_sync.cc +++ b/lib/tsan/rtl/tsan_sync.cc @@ -265,6 +265,11 @@ void StackTrace::ObtainCurrent(ThreadState *thr, uptr toppc) { n_ = c_ - !!toppc; } } else { + // Cap potentially huge stacks. + if (n_ + !!toppc > kTraceStackSize) { + start = n_ - kTraceStackSize + !!toppc; + n_ = kTraceStackSize - !!toppc; + } s_ = (uptr*)internal_alloc(MBlockStackTrace, (n_ + !!toppc) * sizeof(s_[0])); } |
