Skip to content
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

infinite loop when compiling syntax at stage1 ? #61162

Closed
ghost opened this issue May 25, 2019 · 7 comments
Closed

infinite loop when compiling syntax at stage1 ? #61162

ghost opened this issue May 25, 2019 · 7 comments

Comments

@ghost
Copy link

ghost commented May 25, 2019

After about 13minutes rust compilation reaches compiling syntax at stage 1, and it uses 100% CPU aka one full core, on i7-8700K, and after about 4 hours(of me sleeping) I decided to stop it. I did this twice(the first time I had all kinds of debugging on but turning all of it off in a subsequent test still made it stall in the same syntax place) and I'm unsure if it's something I did (like "-C" "target-cpu=native") or this is an actual rust bug.

Here's full console output from this last 4 hours of wasted electricity(looks like a constant 96W), and below is just a bit of it:

user@i87k 2019/05/25 04:47:14 -bash5.0.7 t:3 j:0 d:3 pp:1025 p:5493 ut23175
!18259 41 1  5.1.3-g7cb9c5d341b9 #18 SMP Fri May 24 22:14:42 CEST 2019
/home/user/build/2nonpkgs/rust.stuff/rust 
$ ./clean all
cd rust && ./x.py clean
./clean:4+ cd rust
./clean:4+ ./x.py clean
Updating only changed submodules
Submodules updated in 0.01 seconds
    Finished dev [unoptimized] target(s) in 0.20s
Build completed successfully in 0:00:01
#cd rust && ./x.py clean --all
#--all removes the whole rust/build/ dir !!!!!
-----------
user@i87k 2019/05/25 04:47:19 -bash5.0.7 t:3 j:0 d:3 pp:1025 p:5493 ut23181
!18260 42 0  5.1.3-g7cb9c5d341b9 #18 SMP Fri May 24 22:14:42 CEST 2019
/home/user/build/2nonpkgs/rust.stuff/rust 
$ ./go
~/build/2nonpkgs/rust.stuff/rust/rust ~/build/2nonpkgs/rust.stuff/rust
Updating only changed submodules
Submodules updated in 0.02 seconds
extracting /home/user/build/2nonpkgs/rust.stuff/rust/rust/build/cache/2019-04-11/rust-std-beta-x86_64-unknown-linux-gnu.tar.gz
  extracting rust-std-beta-x86_64-unknown-linux-gnu/rust-std-x86_64-unknown-linux-gnu
...
[RUSTC-TIMING] syntax_pos test:false 2.200
   Compiling rustc_errors v0.0.0 (/home/user/build/2nonpkgs/rust.stuff/rust/rust/src/librustc_errors)
     Running `/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/bootstrap/debug/rustc --edition=2018 --crate-name rustc_errors src/librustc_errors/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=b2423498d0a86bea -C extra-filename=-b2423498d0a86bea --out-dir /home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -C incremental=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental -L dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern atty=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libatty-b5220b15e31c7f35.rlib --extern log=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-45a64545b2fe4cd1.rlib --extern rustc_cratesio_shim=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_cratesio_shim-46828274869a11e2.so --extern rustc_data_structures=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1710c1044dd4b081.so --extern serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.so --extern serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.rlib --extern syntax_pos=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-8806d661e412a95e.so --extern termcolor=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtermcolor-d573334bdbdacde6.rlib --extern unicode_width=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libunicode_width-8c1560a44adbda85.rlib -C target-cpu=native`
rustc command: "LD_LIBRARY_PATH"="/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--edition=2018" "--crate-name" "rustc_errors" "src/librustc_errors/lib.rs" "--color" "always" "--crate-type" "dylib" "--emit=dep-info,link" "-C" "prefer-dynamic" "-C" "opt-level=2" "-C" "metadata=b2423498d0a86bea-rustc" "-C" "extra-filename=-b2423498d0a86bea" "--out-dir" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "--target" "x86_64-unknown-linux-gnu" "-C" "incremental=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "--extern" "atty=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libatty-b5220b15e31c7f35.rlib" "--extern" "log=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-45a64545b2fe4cd1.rlib" "--extern" "rustc_cratesio_shim=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_cratesio_shim-46828274869a11e2.so" "--extern" "rustc_data_structures=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1710c1044dd4b081.so" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.so" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.rlib" "--extern" "syntax_pos=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-8806d661e412a95e.so" "--extern" "termcolor=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libtermcolor-d573334bdbdacde6.rlib" "--extern" "unicode_width=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libunicode_width-8c1560a44adbda85.rlib" "-C" "target-cpu=native" "--cfg" "stage1" "-Cdebuginfo=2" "--sysroot" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1" "-Zexternal-macro-backtrace" "-Cprefer-dynamic" "-C" "debug-assertions=n" "-C" "codegen-units=1" "-C" "link-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Z" "force-unstable-if-unmarked" "--cfg" "parallel_compiler"
sysroot: "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1"
libdir: "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib"
[RUSTC-TIMING] rustc_errors test:false 3.258
     Running `/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/bootstrap/debug/rustc --edition=2018 --crate-name syntax src/libsyntax/lib.rs --color always --error-format json --crate-type dylib --emit=dep-info,link -C prefer-dynamic -C opt-level=2 -C metadata=e38666c6b340b494 -C extra-filename=-e38666c6b340b494 --out-dir /home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps --target x86_64-unknown-linux-gnu -C incremental=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental -L dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps -L dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps --extern bitflags=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-d7f411c0ea4e1897.rlib --extern lazy_static=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblazy_static-ebc2a07502cc8d92.rlib --extern log=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-45a64545b2fe4cd1.rlib --extern rustc_data_structures=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1710c1044dd4b081.so --extern errors=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-b2423498d0a86bea.so --extern rustc_macros=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_macros-404c57fd31b8fb37.so --extern rustc_target=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-acc3480e171ccf29.so --extern scoped_tls=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-9f965694d05d76ea.rlib --extern serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.so --extern serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.rlib --extern smallvec=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-22d70a467d9b4cf6.rlib --extern syntax_pos=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-8806d661e412a95e.so -C target-cpu=native`
rustc command: "LD_LIBRARY_PATH"="/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--edition=2018" "--crate-name" "syntax" "src/libsyntax/lib.rs" "--color" "always" "--crate-type" "dylib" "--emit=dep-info,link" "-C" "prefer-dynamic" "-C" "opt-level=2" "-C" "metadata=e38666c6b340b494-rustc" "-C" "extra-filename=-e38666c6b340b494" "--out-dir" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "--target" "x86_64-unknown-linux-gnu" "-C" "incremental=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "--extern" "bitflags=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-d7f411c0ea4e1897.rlib" "--extern" "lazy_static=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblazy_static-ebc2a07502cc8d92.rlib" "--extern" "log=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-45a64545b2fe4cd1.rlib" "--extern" "rustc_data_structures=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-1710c1044dd4b081.so" "--extern" "errors=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-b2423498d0a86bea.so" "--extern" "rustc_macros=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_macros-404c57fd31b8fb37.so" "--extern" "rustc_target=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-acc3480e171ccf29.so" "--extern" "scoped_tls=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-9f965694d05d76ea.rlib" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.so" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-f0e386b811b9a48c.rlib" "--extern" "smallvec=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-22d70a467d9b4cf6.rlib" "--extern" "syntax_pos=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-8806d661e412a95e.so" "-C" "target-cpu=native" "--cfg" "stage1" "-Cdebuginfo=2" "--sysroot" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1" "-Zexternal-macro-backtrace" "-Cprefer-dynamic" "-C" "debug-assertions=n" "-C" "codegen-units=1" "-C" "link-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Z" "force-unstable-if-unmarked" "--cfg" "parallel_compiler"
sysroot: "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1"
libdir: "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib"
^C
Build completed unsuccessfully in 4:21:23

Compile(failed?:1) took 15684 secs aka 4 hours 21 minutes 24 seconds. date='Sat 25 May 2019 09:08:44 AM CEST'
Cleaning up

^ nproc='6' /proc/loadavg='1.13 1.08 1.02 1/296 24383' /proc/cmdline='BOOT_IMAGE=/boot/vmlinuz-linux-stable root=UUID=2b8b9ab8-7ac5-4586-aa42-d7ffb12de92a rw root_trim=yes rd.luks.allow-discards rd.luks.options=discard ipv6.disable=1 ipv6.disable_ipv6=1 ipv6.autoconf=0 loglevel=15 log_buf_len=16M ignore_loglevel printk.always_kmsg_dump=y printk.time=y printk.devkmsg=on mminit_loglevel=4 memory_corruption_check=1 fbcon=scrollback:4096k fbcon=font:ProFont6x11 net.ifnames=0 nolvm dobtrfs console=tty1 earlyprintk=vga audit=0 systemd.log_target=kmsg systemd.journald.forward_to_console=1 enforcing=0 udev.children-max=1256 rd.udev.children-max=1256 nohz=on oops=panic crashkernel=128M panic=0 psi=1 sysrq_always_enabled random.trust_cpu=off logo.nologo lpj=0 mce=bootlog reboot=force,cold noexec=on nohibernate scsi_mod.use_blk_mq=1 consoleblank=120 mitigations=auto,nosmt l1tf=full,force spec_store_bypass_disable=auto spectre_v2=auto spectre_v2_user=auto mds=full,nosmt rd.log=all noefi cpuidle.governor=teo zram.num_devices=3 zswap.enabled=0 zswap.same_filled_pages_enabled=1 zswap.compressor=zstd zswap.max_pool_percent=40 zswap.zpool=z3fold i915.alpha_support=1 i915.fastboot=1'
-----

real	261m25.027s
user	32m1.487s
sys	0m31.008s

Here's config.toml used (minus the comments):

/home/user/build/2nonpkgs/rust.stuff/rust 
$ cat rust/config.toml|grep -v '^#'|sed -e '/^$/d'
[llvm]
optimize = true
release-debuginfo = false #faster
assertions = false #faster
ccache = "/usr/bin/ccache" #faster
static-libstdcpp = false
ninja = true
targets = "X86"
experimental-targets = ""
link-jobs = 0
[build]
build = "x86_64-unknown-linux-gnu"
host = ["x86_64-unknown-linux-gnu"]
target = ["x86_64-unknown-linux-gnu"] # defaults to just the build triple
docs = true
compiler-docs = false #faster ./x.py install XXX: undo
submodules = true #this and/or fast-submodules=true below, will overwrite changes presumably made by eg. git checkout d6525ef539 in the root rustc/ dir and thus I cannot properly roll back to that working rustc commit because submodules are in fact brought up to date automatically, so still hitting this issue: https://github.com/rust-lang/rust/issues/57596
fast-submodules = true
locked-deps = false
full-bootstrap = false
extended = false
tools = [ "src", "rls"]
verbose = 0
sanitizers = false
profiler = false
low-priority = true
local-rebuild = false
print-step-timings = true
[install]
prefix = "/home/user/build/2nonpkgs/rust.stuff/rust/rust.installed.dir"
bindir = "bin"
[rust]
optimize = true
debug = false #faster
codegen-units = 1 #We currently have the capability to do multiple codegen units in parallel. Unfortunately, one drawback of using this functionality is that using multiple codegen units loses optimization opportunities, like inlining, between the units. src: https://internals.rust-lang.org/t/towards-a-second-edition-of-the-compiler/5582
codegen-units-std = 1
debug-assertions = false #WAY(?) faster
debuginfo-level = 2
debuginfo-level-rustc = 2
debuginfo-level-std = 2
debuginfo-level-tools = 2
backtrace = true
incremental = true #faster but hitting this issue after each update which makes it useless: https://github.com/rust-lang/rust/issues/58633
parallel-compiler = true
channel = "dev"
rpath = true
verbose-tests = false
optimize-tests = true
codegen-tests = false #for no good reason; just to be sure
ignore-git = false #i don't get it! what git information and why will it cause rebuilds?
lld = false
deny-warnings = false #workaround for above
backtrace-on-ice = true
llvm-libunwind = false #default
[target.x86_64-unknown-linux-gnu]
[dist]
src-tarball = false
missing-tools = false

I'm on Arch Linux, with these packages installed.

$ rustv
!! master-installed (default)
!! Executing '/home/user/.cargo/bin/rustc' in pwd='/home/user/build/2nonpkgs/rust.stuff/rust' with args(1): '-vV'
rustc 1.36.0-dev (a784a8022 2019-05-09)
binary: rustc
commit-hash: a784a80228c9eac3aa0fd86fc90887d5fa20c82e
commit-date: 2019-05-09
host: x86_64-unknown-linux-gnu
release: 1.36.0-dev
LLVM version: 8.0
!! master-installed (default)
!! Executing '/home/user/build/2nonpkgs/rust.stuff/cargo/cargo//target/release//cargo' in pwd='/home/user/build/2nonpkgs/rust.stuff/rust' with args(1): '-vV'
cargo 1.36.0-dev (4034d1d3 2019-05-09)
release: 1.36.0
commit-hash: 4034d1d3245b73ed662ceb67c2c0b32c23a66504
commit-date: 2019-05-09

$ rustup show
Default host: x86_64-unknown-linux-gnu

installed toolchains
--------------------

nightly-x86_64-unknown-linux-gnu
master-installed (default)
master-stage1
master-stage2

active toolchain
----------------

master-installed (default)
rustc 1.36.0-dev (a784a8022 2019-05-09)

Rust source code tested was at commit:

commit dec4c5201f88efbc3020b04ba96a5ee2c3b6cfcd (HEAD -> master, origin/master, origin/HEAD)
Merge: fc45382c12 2244ca3973
Author: bors <[email protected]>
Date:   Fri May 24 19:22:13 2019 +0000

Intentionally segfaulting the rustc process that's using 1 core at 100% for 4 hours, but in a subsequent compilation run (ie. re-ran ./go), results in the following huge(20k lines) stacktrace which can be seen here: https://gist.github.com/howaboutsynergy/19fa6c9cb11ed6f02f4d5a7f7f88db93

One of the threads has over 3000 frames! But hey, maybe that's normal...

@ghost
Copy link
Author

ghost commented May 25, 2019

Looks like ~/.cargo/config affected rust compilation and it contained:

[target.'cfg(any(windows, unix))']
rustflags = ["-C", "target-cpu=native"]                                                                                         
# src: https://users.rust-lang.org/t/auto-vectorization-in-rust/24379/4

commenting out the rustflags line triggered recompilation of stage0 stuff...

Note: (If this native stuff is even the cause) It used to work ok before, since I've had this compiled and working fine: rustc 1.36.0-dev (a784a8022 2019-05-09)

OK: Commenting out that rustflags seems to have no effect!

@ghost
Copy link
Author

ghost commented May 25, 2019

Not sure how relevant this is, but the 100% CPU usage happens when I just run this, but shouldn't it instead just return to prompt?

/home/user/build/2nonpkgs/rust.stuff/rust/rust 
$ LD_LIBRARY_PATH=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps:/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/lib "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1/bin/rustc" "--edition=2018" "--crate-name" "syntax" "src/libsyntax/lib.rs" "--color" "always" "--crate-type" "dylib" "--emit=dep-info,link" "-C" "prefer-dynamic" "-C" "opt-level=2" "-C" "metadata=0e88317807925013-rustc" "-C" "extra-filename=-0e88317807925013" "--out-dir" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "--target" "x86_64-unknown-linux-gnu" "-C" "incremental=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/incremental" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps" "-L" "dependency=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps" "--extern" "bitflags=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libbitflags-a6dd98a01da8574a.rlib" "--extern" "lazy_static=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblazy_static-24d970a229a43e5c.rlib" "--extern" "log=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/liblog-21e5819d6ecf04ad.rlib" "--extern" "rustc_data_structures=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_data_structures-bb956889ba65f14a.so" "--extern" "errors=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_errors-8cffc7187debc5c8.so" "--extern" "rustc_macros=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/release/deps/librustc_macros-404c57fd31b8fb37.so" "--extern" "rustc_target=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/librustc_target-63febfa890e724ff.so" "--extern" "scoped_tls=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libscoped_tls-6902b7fe172ac5b9.rlib" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-b82b1feca37a5978.so" "--extern" "serialize=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libserialize-b82b1feca37a5978.rlib" "--extern" "smallvec=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsmallvec-eb92b7e80dcdbe3e.rlib" "--extern" "syntax_pos=/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1-rustc/x86_64-unknown-linux-gnu/release/deps/libsyntax_pos-bd7b4f8baeadf0c0.so" "--cfg" "stage1" "-Cdebuginfo=2" "--sysroot" "/home/user/build/2nonpkgs/rust.stuff/rust/rust/build/x86_64-unknown-linux-gnu/stage1" "-Zexternal-macro-backtrace" "-Cprefer-dynamic" "-C" "debug-assertions=n" "-C" "codegen-units=1" "-C" "link-args=-Wl,-rpath,$ORIGIN/../lib" "-Zunstable-options" "-Z" "force-unstable-if-unmarked" "--cfg" "parallel_compiler"
error: failed to write metadata for crate `libsyntax` because $CFG_COMPILER_HOST_TRIPLE is not set
   --> src/libsyntax/lib.rs:188:1
    |
188 | __build_diagnostic_array! { libsyntax, DIAGNOSTICS }
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^



@mati865
Copy link
Contributor

mati865 commented May 25, 2019

Parallel compiler builds are broken currently, you should disable it or cherry pick #60967

@ghost
Copy link
Author

ghost commented May 25, 2019

Thank you mati865!
Confirmed it goes past syntax with parallel-compiler = false in about 30 seconds or so!!

also works with that patch and parallel-compiler = true

Build completed successfully in 0:20:53

real	20m53.921s
user	81m22.949s
sys	1m1.119s

So, any chance that this infinite loop(or what) can be avoided in the future? Maybe fail-fast instead? Otherwise, it will likely happen again in some other case, I'd wager. The above patch, although it works, seems more like a workaround for an undelaying cause!

@jonas-schievink
Copy link
Contributor

@howaboutsynergy This specific issue will be fixed (via a workaround) when #60967 is merged, but this is also a rustc regression tracked in #60846, so I'll close this as a duplicate of #60846

@ghost
Copy link
Author

ghost commented May 25, 2019

Cool!

This specific issue will be fixed (via a workaround) when #60967 is merged, but this is also a rustc regression tracked in #60846, so I'll close this as a duplicate of #60846

ok, but that issue(#60846) says that it still compiled successfully eventually, whilst in my case it was still stuck at compiling syntax for 4 hours! If it were a 16 times increase in compilation it would've taken at worst 16 minutes to compile syntax, but since it didn't move even after 240 minutes, that means it's a 240x increase(at least)... and it actually took less than 1 minute(like 30 seconds) to compile syntax with workaround in #60967, but I used 1 minute to be safe.

that being said, since you're Member, I trust your judgment and thus believe that this is indeed a dupe of that one :)

Cheers!

If I understand this correctly, by using a rustc compiler compiled with the workaround in #60967 should(??) also workaround the long compile time for conch-runtime in #60846 but it doesn't, I C-c-ed it after 17mins, it seems stuck at 97/98:

^C  Building [=======================================================> ] 97/98: conch-runtime                                 

real	17m15.600s
user	1m47.618s
sys	0m4.019s

But I'm probably wrong about this and this workaround is only for the compiler itself! A similar workaround would probably be necessary for conch-runtime ! Or, I shall just wait for the actual fix:)

@mati865
Copy link
Contributor

mati865 commented May 25, 2019

If I understand correctly underlying issue is the same, proving bounds has became really slow. Crate mentioned in the other issue is simpler than libsyntax so it's build became "only" 16 times higher.

cc @Zoxc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants