Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
**Features**:

- Add `SENTRY_SDK_VERSION_MAJOR`, `SENTRY_SDK_VERSION_MINOR`, `SENTRY_SDK_VERSION_PATCH`, and `SENTRY_SDK_VERSION_AT_LEAST` for compile-time version checks. ([#2136](https://github.com/getsentry/sentry-native/pull/2136))
- Add an option to limit non-crashing thread stack capture size in `crashpad` on Linux. ([#2137](https://github.com/getsentry/sentry-native/pull/2137), [crashpad#172](https://github.com/getsentry/crashpad/pull/172))

## 0.17.1

Expand Down
9 changes: 9 additions & 0 deletions include/sentry.h
Original file line number Diff line number Diff line change
Expand Up @@ -2377,6 +2377,15 @@ SENTRY_API void sentry_options_set_crashpad_wait_for_upload(
SENTRY_API void sentry_options_set_crashpad_limit_stack_capture_to_sp(
sentry_options_t *opts, int enabled);

/**
* Sets the maximum stack capture size for non-crashing threads.
* A value of `0` disables the limit. This is disabled by default.
*
* This setting only has an effect when using the `crashpad` backend on Linux.
*/
SENTRY_API void sentry_options_set_crashpad_max_stack_capture_size(
sentry_options_t *opts, uint32_t max_stack_capture_size);

/**
* Sets the maximum time (in milliseconds) to wait for the asynchronous
* tasks to end on shutdown before attempting a forced termination.
Expand Down
5 changes: 5 additions & 0 deletions src/backends/sentry_backend_crashpad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1192,6 +1192,11 @@ crashpad_backend_startup(
crashpad::TriState::kEnabled);
}

if (options->crashpad_max_stack_capture_size) {
crashpad_info->set_max_stack_capture_size(
options->crashpad_max_stack_capture_size);
}

#if defined(SENTRY_PLATFORM_WINDOWS) || defined(SENTRY_PLATFORM_LINUX) \
|| defined(SENTRY_PLATFORM_MACOS)
sentry_scope_observer_t *observer = sentry__scope_observer_new();
Expand Down
8 changes: 8 additions & 0 deletions src/sentry_options.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ sentry_options_new(void)
opts->propagate_traceparent = false;
opts->strict_trace_continuation = false;
opts->crashpad_limit_stack_capture_to_sp = false;
opts->crashpad_max_stack_capture_size = 0;
opts->cache_keep = SENTRY_CACHE_KEEP_NONE;
opts->cache_max_age = 0;
opts->cache_max_size = 0;
Expand Down Expand Up @@ -755,6 +756,13 @@ sentry_options_set_crashpad_limit_stack_capture_to_sp(
opts->crashpad_limit_stack_capture_to_sp = !!enabled;
}

void
sentry_options_set_crashpad_max_stack_capture_size(
sentry_options_t *opts, uint32_t max_stack_capture_size)
{
opts->crashpad_max_stack_capture_size = max_stack_capture_size;
}

void
sentry_options_set_shutdown_timeout(
sentry_options_t *opts, uint64_t shutdown_timeout)
Expand Down
1 change: 1 addition & 0 deletions src/sentry_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ struct sentry_options_s {
bool propagate_traceparent;
bool strict_trace_continuation;
bool crashpad_limit_stack_capture_to_sp;
uint32_t crashpad_max_stack_capture_size;
sentry_cache_keep_t cache_keep;

time_t cache_max_age;
Expand Down
Loading