rust-lang / rust

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

Build failure with messagethe compiler unexpectedly panicked. this is a bug. #90433

Closed jitendraky closed 1 year ago

jitendraky commented 2 years ago

Code

<code>

Meta

rustc --version --verbose:

<version>

Error output

Downloading crates ... Downloaded unicode-width v0.1.9 Downloaded zero v0.1.2 Downloaded autocfg v1.0.1 Downloaded aho-corasick v0.7.18 Downloaded clang-sys v1.2.2 Downloaded anyhow v1.0.44 Downloaded uuid v0.8.2 Downloaded byteorder v1.4.3 Downloaded cc v1.0.71 Downloaded quote v1.0.10 Downloaded bytes v1.1.0 Downloaded bitflags v1.3.2 Downloaded ansi_term v0.12.1 Downloaded chrono v0.4.19 Downloaded num-traits v0.2.14 Downloaded pest v2.1.3 Downloaded pin-project-lite v0.2.7 Downloaded pin-utils v0.1.0 Downloaded num-integer v0.1.44 Downloaded proc-macro-hack v0.5.19 Downloaded proc-macro-nested v0.1.7 Downloaded plain v0.2.3 Downloaded rand_chacha v0.3.1 Downloaded regex v1.5.4 Downloaded remove_dir_all v0.5.3 Downloaded ryu v1.0.5 Downloaded semver-parser v0.10.2 Downloaded rustc_version v0.3.3 Downloaded semver v0.11.0 Downloaded scroll_derive v0.10.5 Downloaded regex-automata v0.1.10 Downloaded rustversion v1.0.5 Downloaded syn v1.0.81 Downloaded shlex v1.1.0 Downloaded tempfile v3.2.0 Downloaded signal-hook-registry v1.4.0 Downloaded time v0.1.43 Downloaded serde v1.0.130 Downloaded thread_local v1.1.3 Downloaded sharded-slab v0.1.4 Downloaded tokio-macros v1.5.1 Downloaded tracing-attributes v0.1.18 Downloaded tracing-log v0.1.2 Downloaded slab v0.4.5 Downloaded ucd-trie v0.1.3 Downloaded serde_json v1.0.68 Downloaded tracing-subscriber v0.2.25 Downloaded tracing-core v0.1.21 Downloaded tracing v0.1.29 Downloaded toml_edit v0.2.1 Downloaded smallvec v1.7.0 Downloaded tracing-serde v0.1.2 Downloaded futures-core v0.3.17 Downloaded cty v0.2.2 Downloaded futures-executor v0.3.17 Downloaded futures-io v0.3.17 Downloaded futures v0.3.17 Downloaded futures-macro v0.3.17 Downloaded futures-channel v0.3.17 Downloaded getrandom v0.2.3 Downloaded futures-task v0.3.17 Downloaded futures-sink v0.3.17 Downloaded linked-hash-map v0.5.4 Downloaded futures-util v0.3.17 Downloaded memchr v2.4.1 Downloaded matchers v0.0.1 Downloaded goblin v0.4.3 Downloaded itoa v0.4.8 Downloaded libloading v0.7.1 Downloaded once_cell v1.8.0 Downloaded memoffset v0.6.4 Downloaded ppv-lite86 v0.2.15 Downloaded proc-macro2 v1.0.32 Downloaded ufmt v0.1.0 Downloaded rand_core v0.6.3 Downloaded scroll v0.10.2 Downloaded ufmt-write v0.1.0 Downloaded ufmt-macros v0.1.1 Downloaded mio v0.7.14 Downloaded combine v4.6.2 Downloaded nom v6.1.2 Downloaded rand v0.8.4 Downloaded llvm-sys v110.0.2 Downloaded getopts v0.2.21 Downloaded tokio v1.13.0 Downloaded libc v0.2.106 Compiling proc-macro2 v1.0.32 Compiling autocfg v1.0.1 Compiling libc v0.2.106 Compiling unicode-xid v0.2.2 Compiling memchr v2.4.1 Compiling cfg-if v1.0.0 Compiling syn v1.0.81 Compiling lazy_static v1.4.0 Compiling regex-syntax v0.6.25 Compiling ucd-trie v0.1.3 Compiling radium v0.5.3 Compiling glob v0.3.0 Compiling version_check v0.9.3 Compiling tap v1.0.1 Compiling wyz v0.2.0 Compiling funty v1.1.0 Compiling cc v1.0.71 Compiling bindgen v0.59.1 Compiling peeking_take_while v0.1.2 Compiling log v0.4.14 Compiling lazycell v1.3.0 Compiling bitflags v1.3.2 Compiling rustc-hash v1.1.0 Compiling shlex v1.1.0 Compiling bytes v1.1.0 Compiling pin-project-lite v0.2.7 Compiling ppv-lite86 v0.2.15 Compiling anyhow v1.0.44 Compiling zero v0.1.2 Compiling rustversion v1.0.5 Compiling serde v1.0.130 Compiling once_cell v1.8.0 Compiling remove_dir_all v0.5.3 Compiling linked-hash-map v0.5.4 Compiling ryu v1.0.5 Compiling serde_json v1.0.68 Compiling proc-macro-hack v0.5.19 Compiling itoa v0.4.8 Compiling smallvec v1.7.0 Compiling ansi_term v0.12.1 Compiling futures-core v0.3.17 Compiling futures-task v0.3.17 Compiling futures-channel v0.3.17 Compiling proc-macro-nested v0.1.7 Compiling futures-sink v0.3.17 Compiling futures-io v0.3.17 Compiling slab v0.4.5 Compiling pin-utils v0.1.0 Compiling ufmt-write v0.1.0 Compiling cty v0.2.2 Compiling plain v0.2.3 Compiling byteorder v1.4.3 Compiling unicode-width v0.1.9 Compiling libloading v0.7.1 Compiling getopts v0.2.21 Compiling tracing-core v0.1.21 Compiling sharded-slab v0.1.4 Compiling pest v2.1.3 Compiling thread_local v1.1.3 Compiling bitvec v0.19.5 Compiling num-traits v0.2.14 Compiling num-integer v0.1.44 Compiling futures-macro v0.3.17 Compiling futures-util v0.3.17 Compiling tokio v1.13.0 Compiling memoffset v0.6.4 Compiling nom v6.1.2 Compiling aho-corasick v0.7.18 Compiling combine v4.6.2 Compiling clang-sys v1.2.2 Compiling tracing-log v0.1.2 Compiling quote v1.0.10 Compiling semver-parser v0.10.2 Compiling getrandom v0.2.3 Compiling time v0.1.43 Compiling mio v0.7.14 Compiling signal-hook-registry v1.4.0 Compiling rand_core v0.6.3 Compiling uuid v0.8.2 Compiling rand_chacha v0.3.1 Compiling semver v0.11.0 Compiling rand v0.8.4 Compiling regex v1.5.4 Compiling regex-automata v0.1.10 Compiling rustc_version v0.3.3 Compiling chrono v0.4.19 Compiling redbpf-macros v2.1.0 (/build/redbpf-macros) Compiling tempfile v3.2.0 Compiling matchers v0.0.1 Compiling tracing-serde v0.1.2 Compiling cexpr v0.5.0 Compiling llvm-sys v110.0.2 thread '' panicked at 'failed to set up alternative stack guard page', library/std/src/sys/unix/stack_overflow.rs:156:13 note: run with RUST_BACKTRACE=1 environment variable to display a backtrace

error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.51.0 (2fd73fabe 2021-03-23) running on x86_64-unknown-linux-musl

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C target-feature=-crt-static --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic: end of query stack Compiling toml_edit v0.2.1 fatal runtime error: failed to initiate panic, error 5 error: could not compile clang-sys

Caused by: process didn't exit successfully: rustc --crate-name clang_sys /usr/local/cargo/registry/src/github.com-1ecc6299db9ec823/clang-sys-1.2.2/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="clang_3_5"' --cfg 'feature="clang_3_6"' --cfg 'feature="clang_3_7"' --cfg 'feature="clang_3_8"' --cfg 'feature="clang_3_9"' --cfg 'feature="clang_4_0"' --cfg 'feature="clang_5_0"' --cfg 'feature="clang_6_0"' --cfg 'feature="libloading"' --cfg 'feature="runtime"' -C metadata=5eeb6780e1101a65 -C extra-filename=-5eeb6780e1101a65 --out-dir /build/target/debug/deps -L dependency=/build/target/debug/deps --extern glob=/build/target/debug/deps/libglob-00a2ca4bed38fdc2.rmeta --extern libc=/build/target/debug/deps/liblibc-d834edbbf7df7370.rmeta --extern libloading=/build/target/debug/deps/liblibloading-5b3213a2f4827819.rmeta --cap-lints allow -Ctarget-feature=-crt-static (signal: 6, SIGABRT: process abort signal) warning: build failed, waiting for other jobs to finish... error: build failed took 22m19s

<output>
Backtrace

``` ```

jhpratt commented 2 years ago

Does this occur on stable (1.56)?

jitendraky commented 2 years ago

Yes, I have tried this on stable as well. Also tried this under different OS including Ubuntu 18.04, Ubuntu 20.04, Ubuntu 21.10, centos. This failure was observed on bare metal installation as well as on docker containers.

ehuss commented 2 years ago

Can you run with RUST_BACKTRACE=1 to get the backtrace?

Which OS is your bare metal one?

IIRC, clang-sys is very resource intensive, so it may simply be running out of memory. How much memory do you have? Can you provide some details such as sysctl vm? And maybe the output of ulimit -a.

Enselic commented 1 year ago

Triage: Closing since the questions has remained unanswered for almost 2 years and there is not much else to go on. Of course feel free to reopen if this still reproduces and with the questions answered.