Using minicov with rustc version 1.79.0-nightly and up causes Segmentation fault.
Steps to reproduce
Preconditions
Install rustc 1.79.0-nightly with command rustup install nightly-2024-03-21
Set it as default toolchain: rustup default nightly-2024-03-21
Verify version rustc --version
Reproduction
Clone minicov repo
Run export RUSTFLAGS="-Cinstrument-coverage -Zno-profiler-runtime"
Build with cargo build command
Run minicov-test with cargo run command
Current output:
b
Segmentation fault (core dumped)
Crash occurred. Same behaviour for rustc version 1.80.0-nightly.
Expected output:
b
No crash.
Environment
Tested on Ubuntu 20.04.6 LTS and Ubuntu 23.10 on architecture Amd64.
Analysis
Running rust-gdb tool gives following output:
Program received signal SIGSEGV, Segmentation fault.
0x000055555556130c in initializeValueProfRuntimeRecord (Data=0x5555555b21d0, SiteCountArray=0x7fffffffdad0)
at c/InstrProfilingValue.c:315
315 Nodes ? RTRecord.NodesKind[I][J] : INSTR_PROF_NULLPTR;
Summary
Using
minicov
withrustc
version 1.79.0-nightly and up causesSegmentation fault
.Steps to reproduce
Preconditions
rustc
1.79.0-nightly with commandrustup install nightly-2024-03-21
rustup default nightly-2024-03-21
rustc --version
Reproduction
minicov
repoexport RUSTFLAGS="-Cinstrument-coverage -Zno-profiler-runtime"
cargo build
commandminicov-test
withcargo run
commandCurrent output:
Crash occurred. Same behaviour for
rustc
version 1.80.0-nightly.Expected output:
No crash.
Environment
Tested on Ubuntu 20.04.6 LTS and Ubuntu 23.10 on architecture Amd64.
Analysis
Running
rust-gdb
tool gives following output:Probably this is caused by some changes in latest
llvm 18
version (introduced inrustc
1.79.0-nightly) in area of instr profile: https://github.com/llvm/llvm-project/commit/16e74fd48988ac95551d0f64e1b36f78a82a89a2