Skip to content

Conversation

@fcostaoliveira
Copy link
Collaborator

@fcostaoliveira fcostaoliveira commented Dec 16, 2025

This PR introduces a full crash-handling subsystem for memtier_benchmark (like redis has), significantly improving debuggability, observability, and issue-reporting capabilities.
It also adds automatic version metadata generation and updates documentation to reflect new debugging workflows.

Testing the Crash Handler

You can test the crash handler functionality by sending a signal to a running memtier_benchmark process:

# Start memtier_benchmark in one terminal
$ ./memtier_benchmark --server localhost --port 6379 --test-time 60

# In another terminal, send SEGV signal to trigger crash handler
$ kill -SEGV `pgrep memtier`

This will trigger the crash handler and display the bug report. This is useful for:

  • Verifying crash handling works on your system
  • Testing in CI/CD pipelines
  • Ensuring core dumps are properly configured

Test scripts are also available:
The integration tests include 2 types of crashs (main thread and worker thread).

# Integration tests with active connections - using RLTest framework
$ TEST=test_crash_handler_integration.py ./tests/run_tests.sh

Further docs on core dump analysis

We have expanded the docs to have a core-dump analysis section to include clear, step-by-step instructions for verifying that core dumps are generated, locating them depending on the system's crash handler (direct core files, systemd-coredump, or Apport), and loading them into gdb or coredumpctl.

The macos-13 runner images have been retired as of December 2024.
Update the workflow to use macos-14 for building with older OpenSSL versions (1.1 and 1.0.2).
Also simplified the workflow by removing unnecessary matrix strategy.
After building on macOS, verify that:
- memtier_benchmark --version works correctly
- The binary is linked against the expected libevent library
Update --version to display comprehensive build details in Redis-like format:
- Version number (v=)
- Git SHA and dirty status (sha=)
- Architecture bits (bits=)
- libevent version (libevent=)
- OpenSSL version if TLS enabled (openssl=)

Example output:
v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024
Change --version output format to show all build information on the first line:
memtier_benchmark v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024

This makes it easier to parse and matches the Redis version output style.
@fcostaoliveira fcostaoliveira merged commit 4a8ac10 into master Dec 17, 2025
39 of 40 checks passed
@fcostaoliveira fcostaoliveira deleted the core.dump branch December 17, 2025 10:03
fcostaoliveira added a commit that referenced this pull request Jan 5, 2026
…#328)

* Add crash handling/debugging support, and version metadata generation

* fixed macos build errors due to crash handler code.

* Include a link in the main README to the detailed Crash Handling and Debugging section in DEVELOPMENT.md

* Include strings.h for strcasecmp() on POSIX systems

* Update GitHub Actions to use macos-14 instead of retired macos-13

The macos-13 runner images have been retired as of December 2024.
Update the workflow to use macos-14 for building with older OpenSSL versions (1.1 and 1.0.2).
Also simplified the workflow by removing unnecessary matrix strategy.

* Update GitHub Actions to use macos-14 instead of retired macos-13

* Add version and libevent verification step to macOS builds

After building on macOS, verify that:
- memtier_benchmark --version works correctly
- The binary is linked against the expected libevent library

* Enhance --version output to include detailed build information

Update --version to display comprehensive build details in Redis-like format:
- Version number (v=)
- Git SHA and dirty status (sha=)
- Architecture bits (bits=)
- libevent version (libevent=)
- OpenSSL version if TLS enabled (openssl=)

Example output:
v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024

* Move detailed version info to first line of --version output

Change --version output format to show all build information on the first line:
memtier_benchmark v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024

This makes it easier to parse and matches the Redis version output style.

* Extra sanity check on CI by printing version and linked libs

* Fixed ldd grep

* only checking for ssl lib when built with tls
fcostaoliveira added a commit that referenced this pull request Jan 5, 2026
…#328)

* Add crash handling/debugging support, and version metadata generation

* fixed macos build errors due to crash handler code.

* Include a link in the main README to the detailed Crash Handling and Debugging section in DEVELOPMENT.md

* Include strings.h for strcasecmp() on POSIX systems

* Update GitHub Actions to use macos-14 instead of retired macos-13

The macos-13 runner images have been retired as of December 2024.
Update the workflow to use macos-14 for building with older OpenSSL versions (1.1 and 1.0.2).
Also simplified the workflow by removing unnecessary matrix strategy.

* Update GitHub Actions to use macos-14 instead of retired macos-13

* Add version and libevent verification step to macOS builds

After building on macOS, verify that:
- memtier_benchmark --version works correctly
- The binary is linked against the expected libevent library

* Enhance --version output to include detailed build information

Update --version to display comprehensive build details in Redis-like format:
- Version number (v=)
- Git SHA and dirty status (sha=)
- Architecture bits (bits=)
- libevent version (libevent=)
- OpenSSL version if TLS enabled (openssl=)

Example output:
v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024

* Move detailed version info to first line of --version output

Change --version output format to show all build information on the first line:
memtier_benchmark v=255.255.255 sha=8985eb5a:1 bits=64 libevent=2.1.12-stable openssl=OpenSSL 3.0.13 30 Jan 2024

This makes it easier to parse and matches the Redis version output style.

* Extra sanity check on CI by printing version and linked libs

* Fixed ldd grep

* only checking for ssl lib when built with tls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants