From b732480fab0a069e50979572608f8663b2e6bbe0 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 21 Mar 2024 16:04:35 +0100 Subject: [PATCH 1/4] Send SIGCONT unconditionally --- src/linux/ptrace_dumper.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/linux/ptrace_dumper.rs b/src/linux/ptrace_dumper.rs index 9de95a65..0dd0fa27 100644 --- a/src/linux/ptrace_dumper.rs +++ b/src/linux/ptrace_dumper.rs @@ -39,7 +39,6 @@ pub struct Thread { #[derive(Debug)] pub struct PtraceDumper { pub pid: Pid, - process_stopped: bool, threads_suspended: bool, pub threads: Vec, pub auxv: HashMap, @@ -99,7 +98,6 @@ impl PtraceDumper { pub fn new(pid: Pid, stop_timeout: Duration) -> Result { let mut dumper = PtraceDumper { pid, - process_stopped: false, threads_suspended: false, threads: Vec::new(), auxv: HashMap::new(), @@ -255,7 +253,6 @@ impl PtraceDumper { loop { if let Ok(ProcState::Stopped) = Stat::from_file(&proc_file)?.state() { - self.process_stopped = true; return Ok(()); } @@ -270,10 +267,7 @@ impl PtraceDumper { /// /// Unlike `stop_process`, this function does not wait for the process to continue. fn continue_process(&mut self) -> Result<(), ContinueProcessError> { - if self.process_stopped { - signal::kill(nix::unistd::Pid::from_raw(self.pid), Some(signal::SIGCONT))?; - } - self.process_stopped = false; + signal::kill(nix::unistd::Pid::from_raw(self.pid), Some(signal::SIGCONT))?; Ok(()) } From c531ebba3e31a84124daa64d500d7a1c260e795c Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 21 Mar 2024 16:13:42 +0100 Subject: [PATCH 2/4] Fix clippy 1.77 lints --- src/linux/maps_reader.rs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/linux/maps_reader.rs b/src/linux/maps_reader.rs index bfc32123..b5b7fb23 100644 --- a/src/linux/maps_reader.rs +++ b/src/linux/maps_reader.rs @@ -304,11 +304,7 @@ impl MappingInfo { #[inline] fn so_version(&self) -> Option { - let Some(name) = self.name.as_deref() else { - return None; - }; - - SoVersion::parse(name) + SoVersion::parse(self.name.as_deref()?) } pub fn get_mapping_effective_path_name_and_version( @@ -422,16 +418,12 @@ pub struct SoVersion { impl SoVersion { /// Attempts to retrieve the .so version of the elf path via its filename fn parse(so_path: &OsStr) -> Option { - let Some(filename) = std::path::Path::new(so_path).file_name() else { - return None; - }; + let filename = std::path::Path::new(so_path).file_name()?; // Avoid an allocation unless the string contains non-utf8 let filename = filename.to_string_lossy(); - let Some((_, version)) = filename.split_once(".so.") else { - return None; - }; + let (_, version) = filename.split_once(".so.")?; let mut sov = Self { major: 0, From ae1a3fb109bce21c0b91892e260653b70021aebf Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 21 Mar 2024 16:15:03 +0100 Subject: [PATCH 3/4] Add Gabriel to CODEOWNERS --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 0baeae36..963b7bcc 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Jake-Shadle +* @Jake-Shadle, @gabrielesvelto From dee80e1e59d1d417d347317c1262f1992665afc2 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Thu, 21 Mar 2024 16:16:07 +0100 Subject: [PATCH 4/4] Oops --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 963b7bcc..f4fd57b2 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1 +1 @@ -* @Jake-Shadle, @gabrielesvelto +* @Jake-Shadle @gabrielesvelto