Closed
Description
Hello,
When I use RUSTFLAGS="-C target-cpu=native cargo build --release"
flag to build in the release mode, I am getting EXC_BAD_ACCESS
error but if I use without this native flag, cargo build --release
, it works fine.
OS:
uname -a
Darwin xxxxx_ 16.7.0 Darwin Kernel Version 16.7.0: Thu Jan 11 22:59:40 PST 2018; root:xnu-3789.73.8~1/RELEASE_X86_64 x86_64
Rust Version:
rustc --version
rustc 1.25.0-nightly (5313e8728 2018-02-17)
Cargo Version:
cargo --version
cargo 0.24.0
Compiler Flag to reproduce error:
RUSTFLAGS="-C target-cpu=native" cargo build --release
Toml settings:
[profile.release]
lto = true
codegen-units=1
With target-cpu flag: RUSTFLAGS="-C target-cpu=native cargo build --release
RUST_BACKTRACE=1 RUST_LOG=INFO lldb ./target/release/tsp
(lldb) target create "./target/release/tsp"
Current executable set to './target/release/tsp' (x86_64).
(lldb) run
Process 19242 launched: './target/release/tsp' (x86_64)
Process 19242 stopped
* thread #2, stop reason = EXC_BAD_ACCESS (code=EXC_I386_GPFLT)
frame #0: 0x000000010014bfe7 tsp`std::sys_common::thread_info::set::hf6e9259ac1ddb2db + 119
tsp`std::sys_common::thread_info::set::hf6e9259ac1ddb2db:
-> 0x10014bfe7 <+119>: vmovaps (%rax), %ymm0
0x10014bfeb <+123>: vmovaps 0x4b8d4d(%rip), %ymm1
0x10014bff3 <+131>: vmovaps %ymm1, (%rax)
0x10014bff7 <+135>: vmovups %ymm0, 0x10(%rsp)
Target 0: (tsp) stopped.
Without target cpu flag: cargo build --release
RUST_BACKTRACE=1 RUST_LOG=INFO lldb ./target/release/tsp
(lldb) target create "./target/release/tsp"
Current executable set to './target/release/tsp' (x86_64).
(lldb) run
Process 21359 launched: './target/release/tsp' (x86_64)
Feb 28 11:55:21.237 INFO tsp_init...
Feb 28 11:55:21.237 INFO Initializing CacheMgr...