-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segfault while compiling bootstrap on a fresh git clone #81221
Comments
This is super weird because bootstrap hasn't actually run yet. This is just the latest beta trying and failing to compile syn, which should have been caught weeks ago because everyone uses syn. The only thing I can think of is a corrupted download in the compiler, maybe? @Michael-F-Bryan if you run |
@Michael-F-Bryan by the way you ran gdb on the wrong process: syn's build script segfaulted, but you ran gdb on proc-macro2's build script. |
@Michael-F-Bryan found that this worked after uninstalling and reinstalling their toolchain. I think the issue might be that the download was corrupted. @Mark-Simulacrum doesn't x.py use a checksum for checking the download? |
This may not even be a Interestingly, I could build another Rust project (who's dependencies had build scripts) and everything worked as expected. I also had a copy of The nightly I was using: $ cargo --version --verbose
cargo 1.51.0-nightly (a73e5b7d5 2021-01-12)
release: 1.51.0
commit-hash: a73e5b7d567c3036b296fc6b33ed52c5edcd882e
commit-date: 2021-01-12
$ rustc --version --verbose
rustc 1.51.0-nightly (c5a96fb79 2021-01-19)
binary: rustc
commit-hash: c5a96fb7973649807a7943e7395456db158dcab6
commit-date: 2021-01-19
host: x86_64-unknown-linux-gnu
release: 1.51.0-nightly
LLVM version: 11.0.1 Verbose build logs$ cd src/bootstrap/
$ cargo build --verbose
Compiling proc-macro2 v1.0.19
Compiling unicode-xid v0.2.1
Compiling syn v1.0.38
Compiling autocfg v1.0.0
Compiling version_check v0.9.1
Compiling memchr v2.3.3
Compiling lazy_static v1.4.0
Compiling libc v0.2.79
Running `rustc --crate-name build_script_build --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/proc-macro2-1.0.19/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="proc-macro"' -C metadata=24f77336c7065965 -C extra-filename=-24f77336c7065965 --out-dir /home/michael/Documents/forks/rust/target/debug/build/proc-macro2-24f77336c7065965 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name build_script_build --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/syn-1.0.38/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="clone-impls"' --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="full"' --cfg 'feature="parsing"' --cfg 'feature="printing"' --cfg 'feature="proc-macro"' --cfg 'feature="quote"' --cfg 'feature="visit"' -C metadata=1d3e0f000d1aea61 -C extra-filename=-1d3e0f000d1aea61 --out-dir /home/michael/Documents/forks/rust/target/debug/build/syn-1d3e0f000d1aea61 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name unicode_xid /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-xid-0.2.1/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="default"' -C metadata=083414e3434d8e82 -C extra-filename=-083414e3434d8e82 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name autocfg /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/autocfg-1.0.0/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=96b2b2f3ecfdaa70 -C extra-filename=-96b2b2f3ecfdaa70 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name version_check /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/version_check-0.9.1/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=3832ed092abf33b7 -C extra-filename=-3832ed092abf33b7 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name build_script_build /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/memchr-2.3.3/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' --cfg 'feature="use_std"' -C metadata=51bf4da481d2d8ea -C extra-filename=-51bf4da481d2d8ea --out-dir /home/michael/Documents/forks/rust/target/debug/build/memchr-51bf4da481d2d8ea -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name lazy_static /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/lazy_static-1.4.0/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 -C metadata=cd2401a06b1676f6 -C extra-filename=-cd2401a06b1676f6 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name build_script_build /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/libc-0.2.79/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=95d99096bf4eaa1e -C extra-filename=-95d99096bf4eaa1e --out-dir /home/michael/Documents/forks/rust/target/debug/build/libc-95d99096bf4eaa1e -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling cfg-if v0.1.10
Running `rustc --crate-name cfg_if --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/cfg-if-0.1.10/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 -C metadata=4c6be1962c556cf0 -C extra-filename=-4c6be1962c556cf0 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling serde_derive v1.0.118
Running `rustc --crate-name build_script_build /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_derive-1.0.118/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=8606bbfd35cc2834 -C extra-filename=-8606bbfd35cc2834 --out-dir /home/michael/Documents/forks/rust/target/debug/build/serde_derive-8606bbfd35cc2834 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling serde v1.0.118
Running `rustc --crate-name build_script_build /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.118/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="derive"' --cfg 'feature="serde_derive"' --cfg 'feature="std"' -C metadata=448b8d4a09397093 -C extra-filename=-448b8d4a09397093 --out-dir /home/michael/Documents/forks/rust/target/debug/build/serde-448b8d4a09397093 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling log v0.4.11
Running `rustc --crate-name build_script_build /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/log-0.4.11/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=3a9ea83eb03ac521 -C extra-filename=-3a9ea83eb03ac521 --out-dir /home/michael/Documents/forks/rust/target/debug/build/log-3a9ea83eb03ac521 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling regex-syntax v0.6.22
Running `rustc --crate-name regex_syntax /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/regex-syntax-0.6.22/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="default"' --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=4bf7f6e470e0e87e -C extra-filename=-4bf7f6e470e0e87e --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling ryu v1.0.5
Compiling fnv v1.0.7
Running `rustc --crate-name build_script_build --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/ryu-1.0.5/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=7e22e379072766a7 -C extra-filename=-7e22e379072766a7 --out-dir /home/michael/Documents/forks/rust/target/debug/build/ryu-7e22e379072766a7 -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name fnv /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/fnv-1.0.7/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="default"' --cfg 'feature="std"' -C metadata=eef866999c50c67e -C extra-filename=-eef866999c50c67e --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling same-file v1.0.6
Running `rustc --crate-name same_file --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/same-file-1.0.6/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 -C metadata=8bd8ac94a4a06b38 -C extra-filename=-8bd8ac94a4a06b38 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling serde_json v1.0.59
Running `rustc --crate-name build_script_build --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/serde_json-1.0.59/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="std"' -C metadata=0dd4d131535a197c -C extra-filename=-0dd4d131535a197c --out-dir /home/michael/Documents/forks/rust/target/debug/build/serde_json-0dd4d131535a197c -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling cc v1.0.60
Compiling itoa v0.4.6
Running `rustc --crate-name itoa /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/itoa-0.4.6/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 -C metadata=a6b26c0a10370aa4 -C extra-filename=-a6b26c0a10370aa4 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Running `rustc --crate-name cc --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.60/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 -C metadata=c0c008fc9b8684cf -C extra-filename=-c0c008fc9b8684cf --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling unicode-width v0.1.8
Running `rustc --crate-name unicode_width /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-width-0.1.8/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="default"' -C metadata=85f6c02835e49e35 -C extra-filename=-85f6c02835e49e35 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling bootstrap v0.0.0 (/home/michael/Documents/forks/rust/src/bootstrap)
Running `rustc --crate-name build_script_build --edition=2018 src/bootstrap/build.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type bin --emit=dep-info,link -C embed-bitcode=no -C debuginfo=2 -C metadata=10118bf5840f696d -C extra-filename=-10118bf5840f696d --out-dir /home/michael/Documents/forks/rust/target/debug/build/bootstrap-10118bf5840f696d -C linker=/usr/bin/clang -C incremental=/home/michael/Documents/forks/rust/target/debug/incremental -L dependency=/home/michael/Documents/forks/rust/target/debug/deps -C link-arg=-nostartfiles`
Compiling opener v0.4.1
Running `rustc --crate-name opener --edition=2018 /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/opener-0.4.1/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 -C metadata=db0827d86dd0db60 -C extra-filename=-db0827d86dd0db60 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --cap-lints allow -C link-arg=-nostartfiles`
Compiling build_helper v0.1.0 (/home/michael/Documents/forks/rust/src/build_helper)
Running `rustc --crate-name build_helper --edition=2018 src/build_helper/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 -C metadata=42cf7bea14769a8a -C extra-filename=-42cf7bea14769a8a --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -C incremental=/home/michael/Documents/forks/rust/target/debug/incremental -L dependency=/home/michael/Documents/forks/rust/target/debug/deps -C link-arg=-nostartfiles`
Compiling thread_local v1.0.1
Running `rustc --crate-name thread_local /home/michael/.cargo/registry/src/github.com-1ecc6299db9ec823/thread_local-1.0.1/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 -C metadata=b1b857567b38aff1 -C extra-filename=-b1b857567b38aff1 --out-dir /home/michael/Documents/forks/rust/target/debug/deps -C linker=/usr/bin/clang -L dependency=/home/michael/Documents/forks/rust/target/debug/deps --extern lazy_static=/home/michael/Documents/forks/rust/target/debug/deps/liblazy_static-cd2401a06b1676f6.rmeta --cap-lints allow -C link-arg=-nostartfiles`
Running `/home/michael/Documents/forks/rust/target/debug/build/memchr-51bf4da481d2d8ea/build-script-build`
error: failed to run custom build command for `memchr v2.3.3`
Caused by:
process didn't exit successfully: `/home/michael/Documents/forks/rust/target/debug/build/memchr-51bf4da481d2d8ea/build-script-build` (signal: 11, SIGSEGV: invalid memory reference)
warning: build failed, waiting for other jobs to finish...
error: build failed
cargo build --verbose 18.60s user 1.52s system 450% cpu 4.467 total |
After reinstalling the
|
The problem turned out to be between seat and keyboard, here. The terminal I was trying to build bootstrap on had This isn't an issue with Rust. |
While trying to reproduce #78778 with a brand new
git clone
(a4cbb44) I ran into a segfault while trying to build the bootstrapper.More precisely, it seems to be the first build script that is run while compiling bootstrap's dependencies. I don't think it's related to the build scripts themselves because I tried running multiple times and different build scripts crashed each time.
I tried this code:
Stepping through the build script with a debugger wasn't overly helpful because it doesn't look like it was compiled with debug symbols. I did notice that we try to invoke a null function pointer though:
It may be because I've just read through @jyn514's "What does this compile error mean?" Zulip thread, but feels like there may be something wrong with which
libstd
build scripts are linked to.Something else that may have contributed is me usingdownload-ci-llvm = true
inconfig.toml
to try and avoid downloading LLVM over slow Australian internet.Edit: Turns out
download-ci-llvm = true
had nothing to do with it. I removed that line and letx.py
download LLVM and still got the segfault.The text was updated successfully, but these errors were encountered: