rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
99.19k stars 12.81k forks source link

segmentation fault #118174

Open jgardona opened 1 year ago

jgardona commented 1 year ago

Got the following segmentation fault just few minutes ago in rust-analyzer, parsing a project below:

https://github.com/jgardona/mhv

rust-analyzer 1.74.0 (79e9716 2023-11-13) rustc 1.74.0 (79e9716c9 2023-11-13)

I will edit here as I got it in github

ERROR rust_analyzer::main_loop] FetchBuildDataError:
error: rustc interrupted by SIGSEGV, printing backtrace

/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x3104966)[0x7fd6a9304966]
/lib64/libc.so.6(+0x3e9a0)[0x7fd6a60389a0]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(_RNvXNtCs9XcPCU59mvy_19rustc_mir_transform21cleanup_post_borrowckNtB2_19CleanupPostBorrowckNtNtCs1774E4a9nNr_12rustc_middle3mir7MirPass8run_pass+0xe0)[0x7fd6a7d58c10]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x15737d9)[0x7fd6a77737d9]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x1572f5e)[0x7fd6a7772f5e]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x1572f2e)[0x7fd6a7772f2e]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x13419e8)[0x7fd6a75419e8]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x2a425e1)[0x7fd6a8c425e1]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x261055c)[0x7fd6a881055c]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(_RNvNtCsiMrTZ1j22BH_15rustc_interface6passes8analysis+0x8b)[0x7fd6a880d9ab]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x25df3ea)[0x7fd6a87df3ea]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x25df3d9)[0x7fd6a87df3d9]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x27d4984)[0x7fd6a89d4984]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x27d46f9)[0x7fd6a89d46f9]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x228f632)[0x7fd6a848f632]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x228e0b1)[0x7fd6a848e0b1]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x2288c90)[0x7fd6a8488c90]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-fd05879751a9d790.so(+0x29509ee)[0x7fd6a8b509ee]
/home/jgardona/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libstd-fcf70ff533b679b2.so(rust_metadata_std_75110f2ce3cbb2c9+0x10a395)[0x7fd6aa495395]
/lib64/libc.so.6(+0x8e897)[0x7fd6a6088897]
/lib64/libc.so.6(+0x1156bc)[0x7fd6a610f6bc]
Noratrieb commented 1 year ago

do you have any way to reproduce the issue? I poked around in your repo but didn't get anything.

jgardona commented 1 year ago

do you have any way to reproduce the issue? I poked around in your repo but didn't get anything. Cant reproduce it anymore, but if I got again will post here.

bchalios commented 1 year ago

We see, what I believe is, the same issue when building Firecracker with:

rustc 1.74.0 (https://github.com/rust-lang/rust/commit/79e9716c980570bfd1f666e3b16ac583f0168962 2023-11-13).

In our case we see it happening almost consistently when we try to gather code coverage by running our unittests. The command we run is:

RUSTFLAGS="-Cinstrument-coverage" LLVM_PROFILE_FILE="coverage-%p-%m.profraw" cargo test --all --target aarch64-unknown-linux-gnu -- --test-threads=1

Example runs:

But sometimes we see the same behaviour just by running the unittests (without gathering code coverage):

We haven't seen this for x86_64 builds, so far.

Unfortunately I don't have a MCVE, but the branch of Firecracker that triggers this is: https://github.com/bchalios/firecracker/tree/rust_upgrade

kpreid commented 11 months ago

Relabeling issues which don't have a runnable reproduction (as opposed to not having a minimized one) to the new label S-needs-repro. @rustbot label +S-needs-repro -E-needs-mcve