Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash-handler crashes with SEGV on aarch64 system #92

Open
morphis opened this issue Sep 17, 2024 · 0 comments
Open

crash-handler crashes with SEGV on aarch64 system #92

morphis opened this issue Sep 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@morphis
Copy link

morphis commented Sep 17, 2024

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:

  1. Checkout crash-handling repository at git rev e1f1241
  2. Switch to crash-handler subdirectory
  3. 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-Ubuntu kernel)
  • Arch: aarch64, an Ampere Altra CPU in this specific case
@morphis morphis added the bug Something isn't working label Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant