You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I expected the program to panic with an assertion failed message and exit normally:
% cargo +1.64.0 run
Finished dev [unoptimized + debuginfo] target(s) in 0.00s
Running `target/debug/test-segv`
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"foo"`,
right: `"bar"`', src/main.rs:7:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Instead, the program crashes with a segfault:
% cargo +1.65.0 run
Finished dev [unoptimized + debuginfo] target(s) in 0.15s
Running `target/debug/test-segv`
thread 'main' panicked at 'assertion failed: `(left == right)`
left: `"foo"`,
right: `"bar"`', src/main.rs:7:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
zsh: segmentation fault cargo +1.65.0 run
This is particularly a problem with tests since the test harness doesn't print the failed assert:
running 1 test
error: test failed, to rerun pass `--bin test-segv`
Caused by:
process didn't exit successfully: `.../target/debug/deps/test_segv-1bd8c9f311fdbb76` (signal: 11, SIGSEGV: invalid memory reference)
This crash occurs on aarch64-apple-darwin, it does not occur on aarch64-unknown-linux-gnu
Oops sorry this is a duplicate of #104388 caused by using -C link-arg=--ld-path=/opt/homebrew/opt/llvm/bin/ld64.lld from LLVM 14.0.6_1. The crash does not occur without that link arg flag, and also doesn't occur after upgrading to LLVM 15.0.4.
I believe this is caused by using ld from LLVM 14 to link artifacts produced by LLVM 15. Seems to dup w/ #104388 but it seems that you have a smaller reproducible code. Could you please share your MCVE?
I tried this code:
I expected the program to panic with an assertion failed message and exit normally:
Instead, the program crashes with a segfault:
This is particularly a problem with tests since the test harness doesn't print the failed assert:
This crash occurs on
aarch64-apple-darwin
, it does not occur onaarch64-unknown-linux-gnu
Meta
Backtrace
Backtrace from lldb:The text was updated successfully, but these errors were encountered: