From 613222efec9ed068e5a703c5d0c7e382853f9987 Mon Sep 17 00:00:00 2001 From: Luna Nova Date: Sat, 29 Jun 2024 08:32:22 -0700 Subject: [PATCH] Swap linux symbolication's unmaintained memmap dependency for memmap2 Fixes: #84 Fixes: https://rustsec.org/advisories/RUSTSEC-2020-0077 --- Cargo.toml | 2 +- src/linux/symbolication.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a41678e..8695380 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,6 @@ log = "0.4" proc-maps = "0.3.2" read-process-memory = "0.1.6" goblin = "0.7.1" -memmap = "0.7.0" regex = ">=1.8.3" [target.'cfg(target_os="macos")'.dependencies] @@ -29,6 +28,7 @@ nix = {version = "0.26", default-features = false, features = ["ptrace", "sched" object = "0.32" addr2line = "0.21" lazy_static = "1.4.0" +memmap2 = "0.9.4" [target.'cfg(windows)'.dependencies] winapi = {version = "0.3", features = ["winbase", "consoleapi", "wincon", "handleapi", "timeapi", "processenv" ]} diff --git a/src/linux/symbolication.rs b/src/linux/symbolication.rs index d5bdf4a..4a92b73 100644 --- a/src/linux/symbolication.rs +++ b/src/linux/symbolication.rs @@ -4,8 +4,7 @@ use std::fs::File; use std::path::Path; use log::{debug, error, info, trace, warn}; -use memmap; -use memmap::Mmap; +use memmap2::Mmap; use crate::{Error, Pid, Process, StackFrame}; use addr2line::ObjectContext; @@ -224,7 +223,7 @@ impl SymbolData { info!("opening {} for symbols", filename); let file = File::open(filename)?; - let map = unsafe { memmap::Mmap::map(&file)? }; + let map = unsafe { memmap2::Mmap::map(&file)? }; let file = match object::File::parse(&*map) { Ok(f) => f, Err(e) => {