Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ license = "MIT"
bitflags = "2.0"
byteorder = "1.3.2"
cfg-if = "1.0"
crash-context = "0.6"
memoffset = "0.8"
minidump-common = "0.16.0"
crash-context = "0.6.1"
memoffset = "0.9"
minidump-common = "0.17.0"
scroll = "0.11"
tempfile = "3.1.0"
thiserror = "1.0.21"

[target.'cfg(unix)'.dependencies]
libc = "0.2.74"
goblin = "0.6"
goblin = "0.7"
memmap2 = "0.5"

[target.'cfg(any(target_os = "linux", target_os = "android"))'.dependencies]
Expand All @@ -32,7 +32,7 @@ nix = { version = "0.26", default-features = false, features = [
"user",
] }
# Used for parsing procfs info.
procfs-core = { git = "https://github.com/eminence/procfs", rev = "591016286d195f523628eccf5cac9c923ae6ea45" }
procfs-core = "0.16.0-RC1"

[target.'cfg(target_os = "windows")'.dependencies]
bitflags = "2.0"
Expand All @@ -44,13 +44,14 @@ mach2 = "0.4"
[dev-dependencies]
# Minidump-processor is async so we need an executor
futures = { version = "0.3", features = ["executor"] }
minidump = "0.16.0"
minidump = "0.17.0"
memmap2 = "0.5"

[target.'cfg(target_os = "macos")'.dev-dependencies]
# We dump symbols for the `test` executable so that we can validate that minidumps
# created by this crate can be processed by minidump-processor
dump_syms = { version = "2.0.0", default-features = false }
minidump-processor = { version = "0.16.0", default-features = false }
minidump-processor = { version = "0.17.0", default-features = false }
Comment thread
Jake-Shadle marked this conversation as resolved.
minidump-unwind = { version = "0.17", features = ["debuginfo"] }
similar-asserts = "1.2"
uuid = "1.0"
6 changes: 5 additions & 1 deletion src/bin/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ mod linux {
let dumper = PtraceDumper::new(getppid().as_raw())?;
let mut mapping_count = 0;
for map in &dumper.mappings {
if map.name == Some(path.clone().into()) {
if map
.name
.as_ref()
.map_or(false, |name| name.to_string_lossy().starts_with(&path))
{
mapping_count += 1;
// This mapping should encompass the entire original mapped
// range.
Expand Down
2 changes: 1 addition & 1 deletion src/linux/maps_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ impl MappingInfo {
#[cfg(target_pointer_width = "64")] // All addresses are 64 bit and I'm currently too lazy to adjust it to work for both
mod tests {
use super::*;
use procfs_core::prelude::*;
use procfs_core::FromRead;

fn get_mappings_for(map: &str, linux_gate_loc: u64) -> Vec<MappingInfo> {
MappingInfo::aggregate(
Expand Down
2 changes: 1 addition & 1 deletion src/linux/ptrace_dumper.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ impl PtraceDumper {
let maps_path = path::PathBuf::from(&filename);
let maps_file = std::fs::File::open(maps_path).map_err(errmap)?;

use procfs_core::prelude::*;
use procfs_core::FromRead;
self.mappings = procfs_core::process::MemoryMaps::from_read(maps_file)
.ok()
.and_then(|maps| MappingInfo::aggregate(maps, linux_gate_loc).ok())
Expand Down
7 changes: 2 additions & 5 deletions src/linux/sections/memory_info_list_stream.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,13 @@
use super::*;
use minidump_common::format::{MemoryProtection, MemoryState, MemoryType};
use procfs_core::{
prelude::*,
process::{MMPermissions, MemoryMaps},
};
use procfs_core::{process::MMPermissions, FromRead};

/// Write a MemoryInfoListStream using information from procfs.
pub fn write(
config: &mut MinidumpWriter,
buffer: &mut DumpBuf,
) -> Result<MDRawDirectory, errors::SectionMemInfoListError> {
let maps = MemoryMaps::from_file(std::path::PathBuf::from(format!(
let maps = procfs_core::process::MemoryMaps::from_file(std::path::PathBuf::from(format!(
"/proc/{}/maps",
config.blamed_thread
)))?;
Expand Down
7 changes: 3 additions & 4 deletions tests/mac_minidump_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,10 +182,9 @@ fn stackwalks() {
)
.expect("failed to dump symbols");

let provider =
minidump_processor::Symbolizer::new(minidump_processor::simple_symbol_supplier(vec![
".test-symbols".into(),
]));
let provider = minidump_unwind::Symbolizer::new(minidump_unwind::simple_symbol_supplier(vec![
".test-symbols".into(),
]));

let state = futures::executor::block_on(async {
minidump_processor::process_minidump(&md.minidump, &provider).await
Expand Down