From 4fc38782e5ff9af1e11ea7597104d599b0d4a569 Mon Sep 17 00:00:00 2001 From: Gabriele Svelto Date: Fri, 4 Nov 2022 14:47:14 +0100 Subject: [PATCH 1/3] Remove the redundant MDExceptionCodeLinux enum and use the values from minidump-common instead --- src/linux/sections/exception_stream.rs | 43 ++------------------------ 1 file changed, 2 insertions(+), 41 deletions(-) diff --git a/src/linux/sections/exception_stream.rs b/src/linux/sections/exception_stream.rs index 832d6734..ad929014 100644 --- a/src/linux/sections/exception_stream.rs +++ b/src/linux/sections/exception_stream.rs @@ -1,45 +1,6 @@ use super::minidump_writer::CrashingThreadContext; use super::*; - -#[allow(non_camel_case_types, unused)] -#[repr(u32)] -enum MDExceptionCodeLinux { - MD_EXCEPTION_CODE_LIN_SIGHUP = 1, /* Hangup (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGINT = 2, /* Interrupt (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGQUIT = 3, /* Quit (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGILL = 4, /* Illegal instruction (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGTRAP = 5, /* Trace trap (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGABRT = 6, /* Abort (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGBUS = 7, /* BUS error (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGFPE = 8, /* Floating-point exception (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGKILL = 9, /* Kill, unblockable (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGUSR1 = 10, /* User-defined signal 1 (POSIX). */ - MD_EXCEPTION_CODE_LIN_SIGSEGV = 11, /* Segmentation violation (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGUSR2 = 12, /* User-defined signal 2 (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGPIPE = 13, /* Broken pipe (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGALRM = 14, /* Alarm clock (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTERM = 15, /* Termination (ANSI) */ - MD_EXCEPTION_CODE_LIN_SIGSTKFLT = 16, /* Stack faultd */ - MD_EXCEPTION_CODE_LIN_SIGCHLD = 17, /* Child status has changed (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGCONT = 18, /* Continue (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGSTOP = 19, /* Stop, unblockable (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTSTP = 20, /* Keyboard stop (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTTIN = 21, /* Background read from tty (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGTTOU = 22, /* Background write to tty (POSIX) */ - MD_EXCEPTION_CODE_LIN_SIGURG = 23, - /* Urgent condition on socket (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGXCPU = 24, /* CPU limit exceeded (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGXFSZ = 25, - /* File size limit exceeded (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGVTALRM = 26, /* Virtual alarm clock (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGPROF = 27, /* Profiling alarm clock (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGWINCH = 28, /* Window size change (4.3 BSD, Sun) */ - MD_EXCEPTION_CODE_LIN_SIGIO = 29, /* I/O now possible (4.2 BSD) */ - MD_EXCEPTION_CODE_LIN_SIGPWR = 30, /* Power failure restart (System V) */ - MD_EXCEPTION_CODE_LIN_SIGSYS = 31, /* Bad system call */ - MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED = 0xFFFFFFFF, /* No exception, - dump requested. */ -} +use minidump_common::errors::ExceptionCodeLinux; pub fn write( config: &mut MinidumpWriter, @@ -58,7 +19,7 @@ pub fn write( _ => 0, }; MDException { - exception_code: MDExceptionCodeLinux::MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED as u32, + exception_code: ExceptionCodeLinux::DUMP_REQUESTED as u32, exception_address: addr as u64, ..Default::default() } From f37214ec8435df4ecd46938ca4025befa3e3e4ed Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Fri, 4 Nov 2022 15:11:43 +0100 Subject: [PATCH 2/3] Ignore new clippy lint in 1.65.0 --- src/linux.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/linux.rs b/src/linux.rs index ced835e5..b4c5b211 100644 --- a/src/linux.rs +++ b/src/linux.rs @@ -1,3 +1,6 @@ +// `WriterError` is large and clippy doesn't like that, but not a huge deal atm +#![allow(clippy::result_large_err)] + #[cfg(target_os = "android")] mod android; pub mod app_memory; From 49b7786bc3e67e871efea9cf91bede58fa8344e8 Mon Sep 17 00:00:00 2001 From: Jake Shadle Date: Fri, 4 Nov 2022 16:05:27 +0100 Subject: [PATCH 3/3] Build and run tests in release --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b007bd23..2ef37c00 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -46,9 +46,9 @@ jobs: - name: Fetch run: cargo fetch --target ${{ matrix.job.target }} - name: Build - run: cargo test --target ${{ matrix.job.target }} --no-run + run: cargo test --target ${{ matrix.job.target }} --release --no-run - name: Test - run: cargo test --target ${{ matrix.job.target }} + run: cargo test --target ${{ matrix.job.target }} --release # This job builds non-tier1 targets that aren't already tested build_lower_tier: