Skip to content

Commit 33b75f5

Browse files
authored
Bump minidump-writer to 0.11 (#103)
1 parent 0744245 commit 33b75f5

File tree

9 files changed

+72
-50
lines changed

9 files changed

+72
-50
lines changed

.cargo/config.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ rustflags = [
4343
"-Wclippy::map_err_ignore",
4444
"-Wclippy::map_flatten",
4545
"-Wclippy::map_unwrap_or",
46-
"-Wclippy::match_on_vec_items",
4746
"-Wclippy::match_same_arms",
4847
"-Wclippy::match_wild_err_arm",
4948
"-Wclippy::match_wildcard_for_single_variants",

Cargo.lock

Lines changed: 48 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crash-handler/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ pub fn write_stderr(s: &'static str) {
3636

3737
cfg_if::cfg_if! {
3838
if #[cfg(all(unix, not(target_os = "macos")))] {
39-
/// The sole purpose of the unix module is to hook pthread_create to ensure
39+
/// The sole purpose of the unix module is to hook `pthread_create` to ensure
4040
/// an alternate stack is installed for every native thread in case of a
41-
/// stack overflow. This doesn't apply to MacOS as it uses exception ports,
41+
/// stack overflow. This doesn't apply to `MacOS` as it uses exception ports,
4242
/// which are always delivered to a specific thread owned by the exception
4343
/// handler
4444
pub mod unix;

minidumper-test/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ anyhow = "1.0"
1717
clap = { version = "4.0", features = ["derive"] }
1818
cfg-if = "1.0"
1919
crash-handler = { path = "../crash-handler" }
20-
minidump = "0.25"
21-
minidump-common = "0.25"
20+
minidump = "0.26"
21+
minidump-common = "0.26"
2222
minidumper = { path = "../minidumper" }
2323
# This has some crazy dependencies, can enable manually if needed
2424
#notify-rust = "4.5"

minidumper-test/src/lib.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -101,14 +101,14 @@ fn make_dump_path(id: &str) -> PathBuf {
101101
pub fn spinup_server(id: &str, dump_path: Option<PathBuf>) -> Server {
102102
let dump_path = dump_path.unwrap_or_else(|| make_dump_path(id));
103103

104-
if dump_path.exists() {
105-
if let Err(e) = std::fs::remove_file(&dump_path) {
106-
panic!(
107-
"failed to remove existing dump file {}: {}",
108-
dump_path.display(),
109-
e
110-
);
111-
}
104+
if dump_path.exists()
105+
&& let Err(e) = std::fs::remove_file(&dump_path)
106+
{
107+
panic!(
108+
"failed to remove existing dump file {}: {}",
109+
dump_path.display(),
110+
e
111+
);
112112
}
113113

114114
let mut server = minidumper::Server::with_name(id).expect("failed to start server");

minidumper/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libc.workspace = true
2424
# Basic log emitting
2525
log = "0.4"
2626
# Minidump writing
27-
minidump-writer = "0.10"
27+
minidump-writer = "0.11"
2828
# Event loop
2929
polling = "3.2"
3030
# Nicer locking primitives

minidumper/examples/diskwrite.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@ fn main() {
2121

2222
let dump_path = std::path::PathBuf::from(format!("dumps/{uuid}.dmp"));
2323

24-
if let Some(dir) = dump_path.parent() {
25-
if !dir.try_exists()? {
26-
std::fs::create_dir_all(dir)?;
27-
}
24+
if let Some(dir) = dump_path.parent()
25+
&& !dir.try_exists()?
26+
{
27+
std::fs::create_dir_all(dir)?;
2828
}
2929
let file = std::fs::File::create(&dump_path)?;
3030
Ok((file, dump_path))

minidumper/src/errors.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub enum Error {
2323
/// An error occurred during minidump generation
2424
#[cfg(any(target_os = "linux", target_os = "android"))]
2525
#[error(transparent)]
26-
Writer(Box<minidump_writer::errors::WriterError>),
26+
Writer(Box<minidump_writer::minidump_writer::errors::WriterError>),
2727
/// An error occurred during minidump generation
2828
#[cfg(target_os = "windows")]
2929
#[error(transparent)]
@@ -41,8 +41,8 @@ pub enum Error {
4141
}
4242

4343
#[cfg(any(target_os = "linux", target_os = "android"))]
44-
impl From<minidump_writer::errors::WriterError> for Error {
45-
fn from(we: minidump_writer::errors::WriterError) -> Self {
44+
impl From<minidump_writer::minidump_writer::errors::WriterError> for Error {
45+
fn from(we: minidump_writer::minidump_writer::errors::WriterError) -> Self {
4646
Self::Writer(Box::new(we))
4747
}
4848
}

minidumper/src/ipc/server.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -461,25 +461,24 @@ impl Server {
461461
};
462462

463463
let mut writer =
464-
minidump_writer::minidump_writer::MinidumpWriter::new(crash_context.inner.pid, crash_context.inner.tid);
464+
minidump_writer::minidump_writer::MinidumpWriterConfig::new(crash_context.inner.pid, crash_context.inner.tid);
465465

466466
writer.set_crash_context(crash_context);
467+
let result = writer.write(&mut minidump_file);
467468
} else if #[cfg(target_os = "windows")] {
468469
// SAFETY: Unfortunately this is a bit dangerous since we are relying on the crashing process
469470
// to still be alive and still have the interior pointers in the crash context still at the
470471
// same location in memory, unfortunately it's a bit hard to communicate this through so
471472
// many layers, so really, we are falling back on Windows to actually correctly handle
472473
// if the interior pointers have become invalid which it should? do ok with
473474
let result =
474-
minidump_writer::minidump_writer::MinidumpWriter::dump_crash_context(crash_context, None, &mut minidump_file);
475+
minidump_writer::minidump_writer::MinidumpWriter::dump_crash_context(&crash_context, None, &mut minidump_file);
475476
} else if #[cfg(target_os = "macos")] {
476477
let mut writer = minidump_writer::minidump_writer::MinidumpWriter::with_crash_context(crash_context);
478+
let result = writer.dump(&mut minidump_file);
477479
}
478480
}
479481

480-
#[cfg(not(target_os = "windows"))]
481-
let result = writer.dump(&mut minidump_file);
482-
483482
// Notify the user handler about the minidump, even if we failed to write it
484483
Ok(handler.on_minidump_created(
485484
result

0 commit comments

Comments
 (0)