diff --git a/libdd-crashtracker/src/collector/crash_handler.rs b/libdd-crashtracker/src/collector/crash_handler.rs index 78604b6060..d9fb0f6fe8 100644 --- a/libdd-crashtracker/src/collector/crash_handler.rs +++ b/libdd-crashtracker/src/collector/crash_handler.rs @@ -247,12 +247,6 @@ fn handle_posix_signal_impl( return Ok(()); } - // Mark this process as a collector for the preload logger - #[cfg(target_os = "linux")] - { - super::api::mark_preload_logger_collector(); - } - // If this code hits a stack overflow, then it will result in a segfault. That situation is // protected by the one-time guard. @@ -264,6 +258,11 @@ fn handle_posix_signal_impl( return Ok(()); } + #[cfg(target_os = "linux")] + { + super::api::mark_preload_logger_collector(); + } + // Suppress SIGPIPE and defer SIGCHLD during crash handling. // SIGCHLD is block-only because SIG_IGN changes child reaping semantics (waitpid/ECHILD), // which can interfere with receiver/collector process cleanup.