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

segfault in self test on NetBSD #644

Closed
0-wiz-0 opened this issue Jul 24, 2024 · 5 comments · Fixed by #645
Closed

segfault in self test on NetBSD #644

0-wiz-0 opened this issue Jul 24, 2024 · 5 comments · Fixed by #645

Comments

@0-wiz-0
Copy link

0-wiz-0 commented Jul 24, 2024

As found when testing rust-lang/rust#96914, in 0.3.73 and git head (dcd0aaa), cargo test on NetBSD dies with a segfault.

backtrace-rs> RUST_BACKTRACE=1 cargo test
   Compiling backtrace v0.3.73 (/disk/storage-202004/archive/foreign/backtrace-rs)
    Finished `test` profile [unoptimized + debuginfo] target(s) in 6.45s
     Running unittests src/lib.rs (target/debug/deps/backtrace-ed5435a466558a04)

running 3 tests
test symbolize::gimli::parse_running_mmaps::check_maps_entry_parsing_64bit ... ok
test symbolize::gimli::parse_running_mmaps::check_maps_entry_parsing_32bit ... ok
test capture::tests::test_frame_conversion ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.03s

     Running tests/accuracy/main.rs (target/debug/deps/accuracy-b042c1723a62a800)

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s

     Running tests/concurrent-panics.rs (target/debug/deps/concurrent_panics-2be74b7ee972732b)
test result: ok
     Running tests/current-exe-mismatch.rs (target/debug/deps/current_exe_mismatch-e7ad37dd6f4cbaa7)
stdout:

stderr:

code: signal: 11 (SIGSEGV) (core dumped)
thread 'main' panicked at tests/current-exe-mismatch.rs:72:5:
explicit panic
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::panicking::panic_display
   3: core::panicking::panic_explicit
   4: current_exe_mismatch::parent::panic_cold_explicit
             at /scratch/lang/rust/work/rustc-1.79.0-src/library/core/src/panic.rs:87:13
   5: current_exe_mismatch::parent
             at ./tests/current-exe-mismatch.rs:72:5
   6: current_exe_mismatch::main
             at ./tests/current-exe-mismatch.rs:15:15
   7: core::ops::function::FnOnce::call_once
             at /scratch/lang/rust/work/rustc-1.79.0-src/library/core/src/ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
error: test failed, to rerun pass `--test current-exe-mismatch`

Environment:

# rustc --version
rustc 1.79.0 (129f3b996 2024-06-10) (built from a source tarball)

on NetBSD 10.99.11/amd64

Let me know what more information you need. Thanks!

@workingjubilee
Copy link
Member

any chance you could pop the core into gdb and tell me what the backtrace was (according to the core dump, as opposed to the panic)?

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jul 27, 2024

The core dump is not in the test program, but ld.elf_so dumps core when it's run.
Running ld.elf_so directly is not supported on NetBSD.
(I got this input from another NetBSD developer in the thread: https://mail-index.netbsd.org/tech-toolchain/2024/07/27/msg004465.html)
What do you want to achieve here?

@workingjubilee
Copy link
Member

Ah, I see.

I guess the test is only meant to be for platforms that support doing this.

@workingjubilee
Copy link
Member

workingjubilee commented Jul 28, 2024

Will be addressed by #645 (I could make the cfg instead be a negative one of "if not freebsd or linux, bail", but I would prefer to have more reports about this segfaulting on other systems, so I can get a better picture of which support this silliness).

@0-wiz-0
Copy link
Author

0-wiz-0 commented Jul 28, 2024

Just to confirm: with #645 applied, cargo test finishes successfully. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants