Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Collect at most as many frames as requested. #67

Merged
merged 5 commits into from
Oct 30, 2018

Conversation

JanEisenhauer
Copy link
Contributor

Regardless of any user provided maximum stack depth boost::stacktrace::basic_stacktrace<>::init will try to obtain 128 stack frames.

For older Microsoft platforms like Windows Server 2003 and Windows XP this is problematic as RtlCaptureStackBacktrace has a stricter limit on the stack depth.

@@ -72,7 +73,7 @@ class basic_stacktrace {
try {
{ // Fast path without additional allocations
native_frame_ptr_t buffer[buffer_size];
const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect(buffer, buffer_size, frames_to_skip + 1);
const std::size_t frames_count = boost::stacktrace::detail::this_thread_frames::collect(buffer, std::min(buffer_size, max_depth), frames_to_skip + 1);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enables users on older Windows platforms to use small enough maximum stack depth.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.044% when pulling 5e85e74 on JanEisenhauer:develop into 4123beb on boostorg:develop.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage remained the same at 90.044% when pulling 5e85e74 on JanEisenhauer:develop into 4123beb on boostorg:develop.

@coveralls
Copy link

coveralls commented Oct 29, 2018

Coverage Status

Coverage decreased (-0.04%) to 90.0% when pulling cbd625b on JanEisenhauer:develop into 4123beb on boostorg:develop.

@apolukhin apolukhin merged commit 3948626 into boostorg:develop Oct 30, 2018
@apolukhin
Copy link
Member

Awesome! Many thanks for the patch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants