Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions libdd-crashtracker/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ libdd-libunwind-sys = { version = "0.1.0", path = "../libdd-libunwind-sys" }
anyhow = "1.0"
chrono = {version = "0.4", default-features = false, features = ["std", "clock", "serde"]}
cxx = { version = "1.0", optional = true }
errno = "0.3"
libdd-common = { version = "3.0.0", path = "../libdd-common" }
libdd-telemetry = { version = "3.0.0", path = "../libdd-telemetry" }
http = "1.1"
Expand Down
8 changes: 8 additions & 0 deletions libdd-crashtracker/src/collector/crash_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use super::signal_handler_manager::chain_signal_handler;
use crate::crash_info::Metadata;
use crate::shared::configuration::CrashtrackerConfiguration;
use crate::StackTrace;
use errno::{errno, set_errno};
use libc::{c_void, siginfo_t, ucontext_t};
use libdd_common::timeout::TimeoutManager;
use std::os::fd::OwnedFd;
Expand Down Expand Up @@ -193,10 +194,17 @@ pub(crate) extern "C" fn handle_posix_sigaction(
sig_info: *mut siginfo_t,
ucontext: *mut c_void,
) {
// Save errno
let errno = errno();

// Handle the signal. Note this has a guard to ensure that we only generate
// one crash report per process.
let _ = handle_posix_signal_impl(sig_info, ucontext as *mut ucontext_t);

// Restore errno
set_errno(errno);
// SAFETY: No preconditions.

unsafe { chain_signal_handler(signum, sig_info, ucontext) };
}

Expand Down
Loading