ref: make SENTRY_HANDLER_STACK_SIZE overridable via env var#1636
Conversation
|
Just a quick heads-up: the reason this is a build-time variable is its use inside If we truly want to improve the test build cache usage, let's not parametrize the build-time parameter in the test; instead, supply the stack size as a CLI parameter in the example and set everything there at runtime. This eliminates multiple configs that miss the cache without destabilizing auto-init by introducing dependencies beyond |
Allow overriding the compile-time SENTRY_HANDLER_STACK_SIZE default at runtime via environment variable. The stack-overflow integration tests previously parametrized SENTRY_HANDLER_STACK_SIZE as a CMake option, forcing 5 extra configure+build cycles on Windows (crashpad x2, inproc x1, breakpad x2). Switching to a runtime env var lets every parametrization reuse the cached build, saving a minute or two on Windows. The env var is read via `GetEnvironmentVariableA` (a kernel32 export) rather than the CRT `getenv`/`strtod`, because the lookup happens in `sentry__set_default_thread_stack_guarantee`, which is called from `DllMain` on `DLL_PROCESS_ATTACH` / `DLL_THREAD_ATTACH`. CRT calls under the loader lock are a latent source of instability and must be avoided. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0bfee15 to
4845d5a
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 4845d5a. Configure here.
…y#1636) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

Allow overriding the compile-time
SENTRY_HANDLER_STACK_SIZEdefault at runtime via environment variable. The stack-overflow integration tests previously parametrizedSENTRY_HANDLER_STACK_SIZEas a CMake option, forcing 5 extra configure+build cycles on Windows (crashpad x2, inproc x1, breakpad x2). Switching to a runtime env var lets every parametrization reuse the cached build, saving a minute or two on Windows.test_crashpad_dumping_stack_overflow(default/16/32)test_inproc_stack_overflow_stdout(default/32)test_breakpad_stack_overflow_stdout(default/16/32)#skip-changelog