-
-
Notifications
You must be signed in to change notification settings - Fork 172
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
feat: build-parameter for handler stack size #1049
base: master
Are you sure you want to change the base?
Conversation
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1049 +/- ##
==========================================
+ Coverage 81.80% 81.81% +0.01%
==========================================
Files 53 53
Lines 6363 6363
Branches 1207 1207
==========================================
+ Hits 5205 5206 +1
Misses 1045 1045
+ Partials 113 112 -1 |
Hi @stima, would this be enough for you as an alternative to #1044? I thought about this again and would like to defer adding additional build parameters (beyond the one introduced here). With this approach, you can decrease the stack size without affecting other usage. If it is good enough for your use case, I will include this in the next release. |
@supervacuus I don't think it's feasible to find a one-size-fits-all solution from an SDK perspective. Having the option to configure is better than not having it at all. However, in our specific case, we aren't aware of the stack size requirements for the third-party libraries we use, so we'll completely disable auto-attaching and set a guaranteed stack size for the threads we manage. Probably adding one more compilation flag (autoset: on/off) and some wrapper API around stack-size setting will provide more flexability. |
This allows users to change the currently hard-coded handler stack size during the build.
Summary:
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 aDllMain
that sets the thread stack for each thread starting after our library is loaded.I could imagine providing two more build parameters:
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.