rust-lang / rust

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

ERROR : rustc interrupted by SIGSEGV #125480

Open fti-ravhad opened 3 months ago

fti-ravhad commented 3 months ago

Title: Error encountered while installing Rust 1.76.0 on Ubuntu 22.04

Description:

I encountered an issue while trying to install Rust version 1.76.0 on my system. Below are the details of the error and my environment: Error Message:

[](   Compiling libz-sys v1.1.16
   Compiling serde v1.0.202
error: rustc interrupted by SIGSEGV, printing backtrace

/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(+0x2c31aa6)[0x7f50a2a31aa6]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x7f509fc19520]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x60b1ffe)[0x7f509e2b1ffe]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm18BlockFrequencyInfo9calculateERKNS_8FunctionERKNS_21BranchProbabilityInfoERKNS_8LoopInfoE+0x161)[0x7f509e2bf46f]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x5e135d2)[0x7f509e0135d2]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm15AnalysisManagerINS_8FunctionEJEE13getResultImplEPNS_11AnalysisKeyERS1_+0x356)[0x7f509e013b16]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x62d62bc)[0x7f509e4d62bc]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x62df430)[0x7f509e4df430]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm12shouldInlineERNS_8CallBaseENS_12function_refIFNS_10InlineCostES1_EEERNS_25OptimizationRemarkEmitterEb+0x30d)[0x7f509e1c76cd]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm20DefaultInlineAdvisor13getAdviceImplERNS_8CallBaseE+0x1c8)[0x7f509e1c71da]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm11InlinerPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x878)[0x7f509e29d838]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x609cfb3)[0x7f509e29cfb3]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm11PassManagerINS_13LazyCallGraph3SCCENS_15AnalysisManagerIS2_JRS1_EEEJS4_RNS_17CGSCCUpdateResultEEE3runERS2_RS5_S4_S7_+0x995)[0x7f509e3b7f55]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x61b75a9)[0x7f509e3b75a9]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm21DevirtSCCRepeatedPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x15e)[0x7f509e3b67f4]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x673)[0x7f509e29a433]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x6099da9)[0x7f509e299da9]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xb9)[0x7f509e3ba1f9]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm24ModuleInlinerWrapperPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x1ab)[0x7f509e7972bd]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(+0x659710d)[0x7f509e79710d]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.76.0-stable.so(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xb9)[0x7f509e3ba1f9]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(LLVMRustOptimize+0x887)[0x7f50a48e6107]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(+0x4937622)[0x7f50a4737622]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(_RNvXs1_Cs59QrpCZBv10_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCschqvOleydkH_17rustc_codegen_ssa6traits5write19WriteBackendMethods8optimize+0xe6)[0x7f50a48156be]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(+0x4aabb0f)[0x7f50a48abb0f]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/librustc_driver-ef0b2e016afc8182.so(+0x4aab6c2)[0x7f50a48ab6c2]
/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/lib/libstd-66d8041607d2929b.so(rust_metadata_std_79729d9c385e1623+0xbe8e5)[0x7f50a5ad58e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3)[0x7f509fc6bac3]
/lib/x86_64-linux-gnu/libc.so.6(clone+0x44)[0x7f509fcfca04]

note: we would appreciate a report at https://github.com/rust-lang/rust
note: backtrace dumped due to SIGSEGV! resuming signal
error: could not compile `regex-syntax` (lib)

Caused by:
  process didn't exit successfully: `/opt/scorer/toolchains/1.76.0-x86_64-unknown-linux-gnu/bin/rustc --crate-name regex_syntax --edition=2021 /opt/scorer/registry/src/index.crates.io-6f17d22bba15001f/regex-syntax-0.8.3/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=204 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C embed-bitcode=no --cfg 'feature="default"' --cfg 'feature="std"' --cfg 'feature="unicode"' --cfg 'feature="unicode-age"' --cfg 'feature="unicode-bool"' --cfg 'feature="unicode-case"' --cfg 'feature="unicode-gencat"' --cfg 'feature="unicode-perl"' --cfg 'feature="unicode-script"' --cfg 'feature="unicode-segment"' -C metadata=72c1ed96a96c17f6 -C extra-filename=-72c1ed96a96c17f6 --out-dir /tmp/cargo-installQbu2oE/release/deps -L dependency=/tmp/cargo-installQbu2oE/release/deps --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `cargo-c v0.9.32+cargo-0.79.0`, intermediate artifacts can be found at `/tmp/cargo-installQbu2oE`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.

@@@@ PKG: { elapsed: 121.425, user: 82.573, system: 16.251, percent: 81.38 } @@@@
)

Steps to Reproduce:

Expected Behavior:

Rust should install successfully without any errors, and cargo-c should be installed without issues.

Actual Behavior:

The installation process fails with the error mentioned above.

Environment:

Operating System: Ubuntu 22.04
Linux Kernel: 6.5.0-0.deb12.4
Python Version: Python 3.11.9
Processor: Intel Processor N100
Rust Version Attempted: 1.76.0
Installation Method: rustup
Installation Path: {$INSTALLATION_PATH}
workingjubilee commented 3 months ago

Please retry with rust 1.78? We only support the current stable compiler.

fti-ravhad commented 3 months ago

By default rust is installing 1.78 . above error occured, so i tried to install 1.76 version . I am using intel N100 cpu machine . are there any limitations for this environment ?

workingjubilee commented 3 months ago

The issue is in LLVM.

nikic commented 3 months ago

Could you please share how to reproduce this issue?

fti-ravhad commented 3 months ago

System details : OS: Ubuntu 22.04 linux kernel : 6.5.0-0.deb12.4 python version : Python 3.11.9 Processor : Intel Processor N100

I have followed the steps mentioned below to install rust in my system which reproduces the above issue.

    export CARGO_HOME={$INSTALLATION_PATH}
    export RUSTUP_HOME={$INSTALLATION_PATH}
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path
    cargo install cargo-c
nikic commented 3 months ago

Thanks! Unfortunately I'm not able to reproduce the crash (on f40 and 3950x).

tbillington commented 2 months ago

I hit the same on rustc 1.79.0, (signal: 11, SIGSEGV: invalid memory reference), but past that I'm not 100% sure if it's the same error.

I attempted to re-build multiple times immediately after and they've all succeeded, so it seemed like a one off.

rustc 1.79.0 (129f3b996 2024-06-10)
binary: rustc
commit-hash: 129f3b9964af4d4a709d1383930ade12dfe7c081
commit-date: 2024-06-10
host: x86_64-unknown-linux-gnu
release: 1.79.0
LLVM version: 18.1.7
error: rustc interrupted by SIGSEGV, printing backtrace

/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(+0x2ea5963)[0x728c442a5963]
/lib/x86_64-linux-gnu/libc.so.6(+0x42520)[0x728c41042520]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM.so.18.1-rust-1.79.0-stable(+0x5c1d921)[0x728c3f21d921]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(+0x4d915bd)[0x728c461915bd]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(LLVMRustOptimize+0x910)[0x728c461912dc]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(+0x4d8efb1)[0x728c4618efb1]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(_RNvXs1_Cs8mItqGRKxZU_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCsbWynUs4HV5U_17rustc_codegen_ssa6traits5write19WriteBackendMethods8optimize+0xe3)[0x728c461651e3]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(+0x4d63a7f)[0x728c46163a7f]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-1ccb730c51a3970e.so(+0x4d63667)[0x728c46163667]
/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libstd-d5189b81a4fa4d36.so(rust_metadata_std_3c8ba8ebcf555201+0xc3cab)[0x728c476a0cab]
/lib/x86_64-linux-gnu/libc.so.6(+0x94ac3)[0x728c41094ac3]
/lib/x86_64-linux-gnu/libc.so.6(+0x126850)[0x728c41126850]

note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
warning: `kingdom-sim` (bin "kingdom-sim") generated 20 warnings (run `cargo fix --bin "kingdom-sim"` to apply 2 suggestions)
error: could not compile `kingdom-sim` (bin "kingdom-sim"); 20 warnings emitted

Caused by:
  process didn't exit successfully: `/home/choc/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name kingdom_sim --edition=2021 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=247 --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=line-tables-only --cfg 'feature="dev"' -C metadata=af64460cd1765ceb -C extra-filename=-af64460cd1765ceb --out-dir /home/choc/code/kingdom-sim/target/debug/deps -C linker=clang -C incremental=/home/choc/code/kingdom-sim/target/debug/incremental -L dependency=/home/choc/code/kingdom-sim/target/debug/deps --extern bevy=/home/choc/code/kingdom-sim/target/debug/deps/libbevy-a3da6fcd3d8042f7.rlib --extern bevy_inspector_egui=/home/choc/code/kingdom-sim/target/debug/deps/libbevy_inspector_egui-48b3637e97822e16.rlib --extern bevy_egui=/home/choc/code/kingdom-sim/target/debug/deps/libbevy_egui-5050f82ad0bf1448.rlib --extern bevy_mod_picking=/home/choc/code/kingdom-sim/target/debug/deps/libbevy_mod_picking-5f465fe19a8542db.rlib --extern bevy_svg_processor=/home/choc/code/kingdom-sim/target/debug/deps/libbevy_svg_processor-87dcad85e0c469c3.rlib --extern big_brain=/home/choc/code/kingdom-sim/target/debug/deps/libbig_brain-d4ce73af1c42bf1e.rlib --extern fastrand=/home/choc/code/kingdom-sim/target/debug/deps/libfastrand-481db22f778fb985.rlib --extern map_gen=/home/choc/code/kingdom-sim/target/debug/deps/libmap_gen-2f4aacdd6590b3b0.rlib --extern pathfinding=/home/choc/code/kingdom-sim/target/debug/deps/libpathfinding-60cbdefb24f0d9a4.rlib --extern strum=/home/choc/code/kingdom-sim/target/debug/deps/libstrum-a26753af3d55738d.rlib --extern wtf=/home/choc/code/kingdom-sim/target/debug/deps/libwtf-064670aef7d7c6ed.rlib -Clink-args=--ld-path=wild -L native=/home/choc/code/kingdom-sim/target/debug/build/blake3-0252643881d775b1/out -L native=/home/choc/code/kingdom-sim/target/debug/build/blake3-0252643881d775b1/out -L native=/usr/lib/x86_64-linux-gnu` (signal: 11, SIGSEGV: invalid memory reference)
error: Recipe `run` failed on line 5 with exit code 101
workingjubilee commented 2 months ago

@tbillington What CPU do you have?

tbillington commented 2 months ago

@workingjubilee Intel(R) Core(TM) i5-4590 CPU @ 3.30GHz

workingjubilee commented 2 months ago

huh, weird.

Smart-SangGe commented 1 month ago

I encountered the same problem while installing ripgrep, specifically when compiling regex-syntax. I found a similar issue and was advised to set --jobs=1, which worked for me. For context, I'm using a Rockchip3399 with 4GB of RAM.