rust-lang / rust

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

SIGSEGV in rustc while compiling the `image-0.24.9` dependency of `oculante-0.8.16` #122890

Closed Fairglow closed 5 months ago

Fairglow commented 6 months ago

Code

<code>

Meta

rustc --version --verbose:

rustc 1.77.0 (aedd173a2 2024-03-17)
binary: rustc
commit-hash: aedd173a2c086e558c2b66d3743b344f977621a7
commit-date: 2024-03-17
host: x86_64-unknown-linux-gnu
release: 1.77.0
LLVM version: 17.0.6

Error output

error: rustc interrupted by SIGSEGV, printing backtrace

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 `image` (lib)

Caused by:
  process didn't exit successfully: `/home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/bin/rustc --crate-name image --edition=2021 /home/stefan/.cargo/registry/src/index.crates.io-6f17d22bba15001f/image-0.24.9/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --diagnostic-width=174 --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C panic=abort -C linker-plugin-lto -C codegen-units=1 --cfg 'feature="bmp"' --cfg 'feature="dds"' --cfg 'feature="default"' --cfg 'feature="dxt"' --cfg 'feature="exr"' --cfg 'feature="farbfeld"' --cfg 'feature="gif"' --cfg 'feature="hdr"' --cfg 'feature="ico"' --cfg 'feature="jpeg"' --cfg 'feature="jpeg_rayon"' --cfg 'feature="openexr"' --cfg 'feature="png"' --cfg 'feature="pnm"' --cfg 'feature="qoi"' --cfg 'feature="tga"' --cfg 'feature="tiff"' --cfg 'feature="webp"' -C metadata=b05c7860cc35ee1c -C extra-filename=-b05c7860cc35ee1c --out-dir /tmp/cargo-installmw7NRG/release/deps -C strip=symbols -L dependency=/tmp/cargo-installmw7NRG/release/deps --extern bytemuck=/tmp/cargo-installmw7NRG/release/deps/libbytemuck-20c8b7e0e694fa17.rmeta --extern byteorder=/tmp/cargo-installmw7NRG/release/deps/libbyteorder-d0a14eb3c82b069c.rmeta --extern color_quant=/tmp/cargo-installmw7NRG/release/deps/libcolor_quant-ca0b4a52c357356f.rmeta --extern exr=/tmp/cargo-installmw7NRG/release/deps/libexr-fd4e8e29553ce4aa.rmeta --extern gif=/tmp/cargo-installmw7NRG/release/deps/libgif-886597c96e43a079.rmeta --extern jpeg=/tmp/cargo-installmw7NRG/release/deps/libjpeg_decoder-dc566d372d971200.rmeta --extern num_traits=/tmp/cargo-installmw7NRG/release/deps/libnum_traits-b99a5095aa940397.rmeta --extern png=/tmp/cargo-installmw7NRG/release/deps/libpng-3bc9f1136bde46e4.rmeta --extern qoi=/tmp/cargo-installmw7NRG/release/deps/libqoi-d1473458a460ced2.rmeta --extern tiff=/tmp/cargo-installmw7NRG/release/deps/libtiff-afdb8c4c31729266.rmeta --cap-lints allow` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: failed to compile `oculante v0.8.16`, intermediate artifacts can be found at `/tmp/cargo-installmw7NRG`.
To reuse those artifacts with a future compilation, set the environment variable `CARGO_TARGET_DIR` to that path.
Backtrace

``` /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(+0x2bcd196)[0x77fa1adcd196] /usr/lib/libc.so.6(+0x3c770)[0x77fa1805a770] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm13LazyValueInfoD1Ev+0x117)[0x77fa1625df57] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(+0x5e5de31)[0x77fa1625de31] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm11PassManagerINS_8FunctionENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xa31)[0x77fa16434389] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm26CGSCCToFunctionPassAdaptor3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x356)[0x77fa16542516] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(+0x614219d)[0x77fa1654219d] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm11PassManagerINS_13LazyCallGraph3SCCENS_15AnalysisManagerIS2_JRS1_EEEJS4_RNS_17CGSCCUpdateResultEEE3runERS2_RS5_S4_S7_+0x995)[0x77fa165413a7] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(+0x6140a0d)[0x77fa16540a0d] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm21DevirtSCCRepeatedPass3runERNS_13LazyCallGraph3SCCERNS_15AnalysisManagerIS2_JRS1_EEES5_RNS_17CGSCCUpdateResultE+0x15e)[0x77fa1653fc5e] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm33ModuleToPostOrderCGSCCPassAdaptor3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x673)[0x77fa16545233] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(+0x6144ba9)[0x77fa16544ba9] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xb9)[0x77fa16543679] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm24ModuleInlinerWrapperPass3runERNS_6ModuleERNS_15AnalysisManagerIS1_JEEE+0x1ab)[0x77fa16933bbd] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(+0x6533a0d)[0x77fa16933a0d] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libLLVM-17-rust-1.77.0-stable.so(_ZN4llvm11PassManagerINS_6ModuleENS_15AnalysisManagerIS1_JEEEJEE3runERS1_RS3_+0xb9)[0x77fa16543679] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(LLVMRustOptimize+0x881)[0x77fa1ccb4e41] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(+0x494f89c)[0x77fa1cb4f89c] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(_RNvXs1_CsQKDkUddcVv_18rustc_codegen_llvmNtB5_18LlvmCodegenBackendNtNtNtCshSEPIwB4Rbm_17rustc_codegen_ssa6traits5write19WriteBackendMethods8optimize+0xe9)[0x77fa1cbe6a41] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(+0x4a30b4b)[0x77fa1cc30b4b] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/librustc_driver-37c42b3bb693526e.so(+0x4a30724)[0x77fa1cc30724] /home/stefan/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libstd-320ebc7037fb8f95.so(rust_metadata_std_c78d3cd131ec7074+0xbf675)[0x77fa1dfdc675] /usr/lib/libc.so.6(+0x8b55a)[0x77fa180a955a] /usr/lib/libc.so.6(+0x108a3c)[0x77fa18126a3c] ```

GrigorenkoPV commented 6 months ago

I cannot reproduce this issue (same compiler version, same host triple, same crate version). Judging by the path in arguments to rustc, you were using cargo install. I tried the same. No SIGSEGV. Same goes for #122889.

workingjubilee commented 5 months ago

I suspect relevant information has been omitted from this report. Possibly the program was running inside an emulated context, for instance. I'm not sure, but that's a strong impression I'm getting. It's also possible this was simply resource exhaustion of some kind, which would vary between machines to an unfortunate degree.

Without a repro case, with the error fundamentally lying inside LLVM, and without anything further to narrow this down, I don't think we can pursue this. Closing. We can reopen this if we obtain further details.

Fairglow commented 5 months ago

Thank you for you time and effort.

I'm sorry, but I cannot reproduce it either. The system is not emulated, nor containerized, and has 32GB of RAM with no significant other applications running at the time. However it is an Arch Linux system that is updated daily, and yes there are usually updates available each time. It is also running KDE6, which may not be entirely stable yet.

I only reported this because the rustc message asked me to. My hope was that you might be able to identify calls that may not handle errors optimally and that you may be able to improve those cases.

If this is not useful to you, I don't mind you closing this at all. It is not any problem for me, or likely anyone else.