From 3791189e02d91904aa2b79708c423178a7fe2c72 Mon Sep 17 00:00:00 2001 From: Chris Martin Date: Thu, 17 Jul 2025 10:58:23 -0400 Subject: [PATCH] linux: Enumerate mappings *after* suspending threads At this stage, the main effect of suspend_threads is to attach ptrace, which we'll need when we start reading the target's memory to build the module list. Co-Authored-By: Simon Chopin --- src/linux/minidump_writer/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/linux/minidump_writer/mod.rs b/src/linux/minidump_writer/mod.rs index 8863ed81..3c77aad8 100644 --- a/src/linux/minidump_writer/mod.rs +++ b/src/linux/minidump_writer/mod.rs @@ -298,11 +298,6 @@ impl MinidumpWriter { soft_errors.push(InitError::EnumerateThreadsFailed(Box::new(e))); } - // Same with mappings -- Some information is still better than no information! - if let Err(e) = self.enumerate_mappings() { - soft_errors.push(InitError::EnumerateMappingsFailed(Box::new(e))); - } - self.page_size = unsafe { libc::sysconf(libc::_SC_PAGESIZE).try_into().unwrap() }; assert!( self.page_size > 0, @@ -317,6 +312,11 @@ impl MinidumpWriter { soft_errors.push(InitError::SuspendNoThreadsLeft(threads_count)); } + // Same with mappings -- Some information is still better than no information! + if let Err(e) = self.enumerate_mappings() { + soft_errors.push(InitError::EnumerateMappingsFailed(Box::new(e))); + } + // The module list is derived from mappings. if let Err(e) = self.enumerate_modules(&mut soft_errors) { soft_errors.push(InitError::EnumerateModulesFailed(Box::new(e)));