sentry-native icon indicating copy to clipboard operation
sentry-native copied to clipboard

feat: build-parameter for handler stack size

Open supervacuus opened this issue 4 months ago • 4 comments

This allows users to change the currently hard-coded handler stack size during the build.

Summary:

  • The default value is 64 KiB, equivalent to our current hard-coded value. This means for most users, everything stays the same.
  • For Windows, the following additional changes were introduced:
    • similar to the sigaltstack setup on the signal-handler side, we only configure the thread stack if no one else has done that before us.
    • sentry__reserve_thread_stack() is only called from the backend initialization for a static build. Dynamic libraries install a DllMain that sets the thread stack for each thread starting after our library is loaded.

I could imagine providing two more build parameters:

  • a CMake option to turn on/off the check for a previous stack configuration.
  • a CMake option to turn on/off the automatic configuration of each thread's crash stack (i.e., the DllMain).

For the sake of simplicity, I would like to defer this decision until we have a case where someone needs to configure the stack size and can not use these mechanisms.

Beyond the configurable stack size, most users prefer not to configure any of these subtle configurations themselves. Introducing any of these build parameters later can be done non-breakingly.

supervacuus avatar Oct 08 '24 17:10 supervacuus