Skip to content

Commit

Permalink
Swap linux symbolication's unmaintained memmap dependency for memmap2 (
Browse files Browse the repository at this point in the history
…#85)

Fixes: #84
Fixes: https://rustsec.org/advisories/RUSTSEC-2020-0077

Co-authored-by: Ben Frederickson <[email protected]>
  • Loading branch information
LunNova and benfred authored Oct 25, 2024
1 parent b416894 commit b098861
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
cfg-if = "1.0.0"

Expand All @@ -30,6 +29,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", "errhandlingapi" ]}
Expand Down
5 changes: 2 additions & 3 deletions src/linux/symbolication.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 { Mmap::map(&file)? };
let file = match object::File::parse(&*map) {
Ok(f) => f,
Err(e) => {
Expand Down

0 comments on commit b098861

Please sign in to comment.