fiber: use alternative signal stack
We install a signal handler that prints the stack trace on SIGSEGV, SIGBUS, SIGILL, SIGFPE. The signal handler uses the current stack. This works fine for most issues, but not for stack overflow, because the latter makes the current stack unusable, leading to a crash in the signal handler. Let's install an alternative signal stack in each thread so that we can print the stack trace on stack overflow. Note that we skip this for ASAN because it installs its own signal stack. (Installing a custom stack would result in a crash.) Closes #9222 NO_DOC=bug fix
Showing
- changelogs/unreleased/gh-9222-sigaltstack.md 4 additions, 0 deletionschangelogs/unreleased/gh-9222-sigaltstack.md
- src/lib/core/crash.c 4 additions, 1 deletionsrc/lib/core/crash.c
- src/lib/core/fiber.c 45 additions, 0 deletionssrc/lib/core/fiber.c
- test/unit/guard.cc 0 additions, 16 deletionstest/unit/guard.cc
Loading
Please register or sign in to comment