Skip to content

Commit

Permalink
Merge pull request #10143 from philip-stoev/antithesis-disable-backtr…
Browse files Browse the repository at this point in the history
…aces

core,test: Allow stack traces on SIGSEGV/SIGBUS to be disabled
  • Loading branch information
philip-stoev authored Jan 20, 2022
2 parents d269773 + 3313b0e commit 64ede52
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/materialized/src/bin/materialized/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,14 @@ struct Args {
)]
log_filter: String,

/// Prevent dumping of backtraces on SIGSEGV/SIGBUS
///
/// In the case of OOMs and memory corruptions, it may be advantageous to NOT dump backtraces,
/// as the attempt to dump the backtraces will segfault on its own, corrupting the core file
/// further and obfuscating the original bug.
#[clap(long, hide = true, env = "MZ_NO_SIGBUS_SIGSEGV_BACKTRACES")]
no_sigbus_sigsegv_backtraces: bool,

// == Connection options.
/// The address on which to listen for connections.
#[clap(
Expand Down Expand Up @@ -369,7 +377,11 @@ fn main() {

fn run(args: Args) -> Result<(), anyhow::Error> {
panic::set_hook(Box::new(handle_panic));
sys::enable_sigbus_sigsegv_backtraces()?;

if !args.no_sigbus_sigsegv_backtraces {
sys::enable_sigbus_sigsegv_backtraces()?;
}

sys::enable_termination_signal_cleanup()?;

// Initialize fail crate for failpoint support
Expand Down
1 change: 1 addition & 0 deletions test/antithesis/driver/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ services:
--timestamp-frequency 100ms
--disable-telemetry
--retain-prometheus-metrics 1s
--no-sigbus-sigsegv-backtraces
image: antithesis-materialized
volumes:
- mzdata:/share/mzdata:rw
Expand Down

0 comments on commit 64ede52

Please sign in to comment.