crash-handling
crash-handling copied to clipboard
crash-handler crashes with SEGV on aarch64 system
Describe the bug
We're currently integrating crash handling via the minidumper-child crate and the implementation works as expected on x86-64. However on aarch64 we see a SEGV in crash_handler::linux::state::HandlerInner::handle_signal which can be easily reproduced by running the abort test case, e.g. cargo test --test abort.
Relevant part of the stack trace is as follows:
Thread 2 "handles_abort" received signal SIGSEGV, Segmentation fault.
0x0000aaaaaaaf9854 in core::mem::maybe_uninit::MaybeUninit<crash_context::linux::CrashContext>::zeroed<crash_context::linux::CrashContext> () at /build/rustc-f
gzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/mem/maybe_uninit.rs:402
402 /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/mem/maybe_uninit.rs: No such file or directory.
(gdb) bt #0 0x0000aaaaaaaf9854 in core::mem::maybe_uninit::MaybeUninit<crash_context::linux::CrashContext>::zeroed<crash_context::linux::CrashContext> ()
at /build/rustc-fgzh1o/rustc-1.75.0+dfsg0ubuntu1~bpo0/library/core/src/mem/maybe_uninit.rs:402
#1 0x0000aaaaaaaf8ee4 in crash_handler::linux::state::HandlerInner::handle_signal (self=0xaaaaaaba7058 <crash_handler::linux::state::HANDLER+8>, info=0xfffff7ff0da0, uc=0xfffff7ff0e20) at crash-handler/src/linux/state.rs:425
#2 0x0000aaaaaaaf8c84 in crash_handler::linux::state::signal_handler (sig=crash_handler::linux::Signal::Abort, info=0xfffff7ff0da0, uc=0xfffff7ff0e20) at crash-handler/src/linux/state.rs:340
#3 <signal handler called> #4 __pthread_kill_implementation (threadid=281474840260640, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#5 0x0000fffff7e5f254 in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#6 0x0000fffff7e1a67c in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#7 0x0000fffff7e07130 in __GI_abort () at ./stdlib/abort.c:79
#8 0x0000aaaaaaaf346c in sadness_generator::raise_abort () at sadness-generator/src/lib.rs:116
#9 0x0000aaaaaaaf33f8 in sadness_generator::SadnessFlavor::make_sad (self=...) at sadness-generator/src/lib.rs:73
#10 0x0000aaaaaaab8b00 in abort::shared::handles_crash::indirect (flavor=...) at crash-handler/tests/shared.rs:103
#11 0x0000aaaaaaab8aa0 in abort::shared::handles_crash (flavor=...) at crash-handler/tests/shared.rs:106
#12 0x0000aaaaaaab78e8 in abort::handles_abort () at crash-handler/tests/abort.rs:5
#13 0x0000aaaaaaab7c68 in abort::handles_abort::{closure#0} () at crash-handler/tests/abort.rs:4
...
I've checked with a the recent rust version 1.80, but the same crash occurs.
To Reproduce Steps to reproduce the behavior:
- Checkout
crash-handlingrepository at git rev e1f1241580d5204880fa47802b867b6bcb975f98 - Switch to
crash-handlersubdirectory - Run
cargo test --test abort
Expected behavior No SEGV and successful executed test case.
Device:
- OS: Ubuntu 22.04 (running the
5.15.0-121-generic #131-Ubuntukernel) - Arch:
aarch64, an Ampere Altra CPU in this specific case