Commit 44a4cec2 authored by Mason Freed's avatar Mason Freed Committed by Commit Bot

Increase stack trace depth on non-Windows architectures

There is a Windows-only limit on stack trace depth of 62. It seems to only
apply to Server 2003 and XP, though it might exist for later OSes. See
https://msdn.microsoft.com/en-us/library/bb204633.aspx for reference. I've
left the limit at 62 for all of Windows in this CL.

This limit does not (seem to) apply to other operating systems, so I've
relaxed the limit to 250. The prior 62 limit does impede some real debugging
efforts, as our stack depth can grow significantly past 62 in some cases,
for example when performing layout on a deeply nested page. For example,
see crbug.com/877093, which quotes the 62/63 limit.

In addition, testing seems to show that Android has a problem with larger
limits also, so I've left the Android limit at 62.

Bug: 877093
Change-Id: Ie6521aa5da5e577cf28a312791fba873df6930cc
Reviewed-on: https://chromium-review.googlesource.com/1252002
Commit-Queue: Mason Freed <masonfreed@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#595860}
parent 36cd7b46
......@@ -108,11 +108,18 @@ class BASE_EXPORT StackTrace {
void InitTrace(const _CONTEXT* context_record);
#endif
#if defined(OS_WIN) || defined(OS_ANDROID)
// From http://msdn.microsoft.com/en-us/library/bb204633.aspx,
// the sum of FramesToSkip and FramesToCapture must be less than 63,
// so set it to 62. Even if on POSIX it could be a larger value, it usually
// doesn't give much more information.
static const int kMaxTraces = 62;
// so set it to 62.
// Testing indicates that Android has issues with a larger value
// here, so leave Android at 62 also.
static constexpr int kMaxTraces = 62;
#else
// For other architectures, use 250. This seems reasonable without
// being huge.
static constexpr int kMaxTraces = 250;
#endif
void* trace_[kMaxTraces];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment