-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
log/diag: Support diagnostic stacktraces on unexpected signals #6309
Conversation
This commit adds support for enabling libunwind -- a library that can be used to display stack information. Use --enable-libunwind to check for availability. A diagnostic message is displayed if libunwind cannot be found as requested.
This commit adds an error code for the diagnostic code used for diagnostic messages following unexpected termination due to signals..
This commit adds a configuration setting to enable a stack trace message if Suricata receives a signal that terminates execution, such as SIGSEGV, SIGABRT.
This commit adds a signal handler for SIGSEGV when configured. The signal handler emits a one line stack trace using SCLogError. The intent is to provide diagnostic information in deployments where core files are not possible. The diagnostic message is from the offending thread and includes the stack trace; each frame includes the symbol + offset.
Codecov Report
@@ Coverage Diff @@
## master #6309 +/- ##
==========================================
- Coverage 76.97% 76.93% -0.05%
==========================================
Files 611 611
Lines 185941 185957 +16
==========================================
- Hits 143130 143066 -64
- Misses 42811 42891 +80
Flags with carried forward coverage won't be shown. Click here to find out more. |
Information: QA ran without warnings. Pipeline 3920 |
Would it make sense to enable this by default if |
I think it would make sense to always have it since the overhead is quite low. |
Continued in #6338 |
Continuation of #6243
This PR supports configuring Suricata to emit a one-line diagnostic message containing a stacktrace when a signal that terminates Suricata execution (e.g., SIGABRT or SIGSEGV) occurs.
Requires:
--enable-libunwind
to configure supportlibunwind
must be available for when building Suricatalogging.stacktrace-on-signal
)Example output:
Link to redmine ticket: 4526
Describe changes:
on
when configured with--enable-libunwind
.#suricata-verify-pr:
#suricata-verify-repo:
#suricata-verify-branch:
#suricata-update-pr:
#suricata-update-repo:
#suricata-update-branch:
#libhtp-pr:
#libhtp-repo:
#libhtp-branch: