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

[#inc-517] Document caveats of signalhandlers and sigaltstack

Open kahest opened this issue 1 year ago • 3 comments

Document various aspects around signaldhandlers, memory usage, custom sigaltstacks, etc.

  • how we use sigaltstacks
  • what to consider when writing onCrash hooks
  • etc.

kahest avatar Mar 06 '24 16:03 kahest

This document already covers a lot of ground: https://develop.sentry.dev/sdk/signal-handlers/

Everything in that document applies to on_crash/before_send hooks executed on any Linux system (including Android).

I wouldn't add sigaltstack usage before we have a very clear idea of what is safe in the context of Android. So, the question is whether this should be added to that document or whether we should reference the signal-handler description to Android-specific docs.

supervacuus avatar Mar 06 '24 17:03 supervacuus

IMO we should have a place on the user-facing Native and Android docs where we call out (on a high level) that signal handlers require special considerations - and then linking to the develop docs should be fine. As for sigaltstack, I wouldn't give any suggestions or advice - rather, I'd include sigaltstack in the callout above, if at all. Once/if we have more clear guidance, we can think about where to put this.

kahest avatar Mar 07 '24 09:03 kahest

Great, I think this fits well within the bounds of the discussed "Advanced Usage" section of the user docs because most of the planned information is about the OS-specific mechanism or exceptional behavior. sentry-android docs can link there.

supervacuus avatar Mar 07 '24 10:03 supervacuus