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

serde_codegen fails to compile on recent nightly with -Z orbit #34119

Closed
alexbool opened this issue Jun 6, 2016 · 47 comments
Closed

serde_codegen fails to compile on recent nightly with -Z orbit #34119

alexbool opened this issue Jun 6, 2016 · 47 comments
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html

Comments

@alexbool
Copy link
Contributor

alexbool commented Jun 6, 2016

When I compile serde_codegen 0.7.8 with -Z orbit on Windows 32-bit, I get this error:

Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\llvm\include\llvm/Support/Casting.h, line 223
Build failed, waiting for other jobs to finish...
error: Could not compile `serde_codegen`.

Meta:

Alexander@VAIO-FZ13 MINGW64 ~
$ rustc -vV
rustc 1.11.0-nightly (1c975eafa 2016-06-05)
binary: rustc
commit-hash: 1c975eafa934e291e4f94b7252faae767de17313
commit-date: 2016-06-05
host: i686-pc-windows-msvc
release: 1.11.0-nightly

The build succeeds at least on OS X.

@retep998
Copy link
Member

retep998 commented Jun 6, 2016

The biggest codegen difference between -msvc and other targets is the SEH exception stuff, which may be causing this, possibly.

@steveklabnik steveklabnik added the A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html label Jun 6, 2016
@eddyb
Copy link
Member

eddyb commented Jun 7, 2016

Hang on, that includes the changes which broke syntex_syntax and which I fixed in #34128.

@alexbool What version did you try on OSX?

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

@eddyb version on OS X is:

alexbool@alexbool-osx ~/D/I/serde-codegen-failure> rustc -vV
rustc 1.11.0-nightly (1c975eafa 2016-06-05)
binary: rustc
commit-hash: 1c975eafa934e291e4f94b7252faae767de17313
commit-date: 2016-06-05
host: x86_64-apple-darwin
release: 1.11.0-nightly

@eddyb
Copy link
Member

eddyb commented Jun 7, 2016

@alexbool Hmm, that's the same version, it shouldn't be able to compile syntex_syntax with RUSTFLAGS=-Zorbit.
Unless version 0.7 is old enough that it doesn't sport struct Name(u32); (that definition used to be type Name = u32; which would explain why it works).

@retep998 started a windows build of #34128, so we might find out soon, one way or another.

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

@eddyb I am trying to make a minimal example now, seems that it isn't so easy

@eddyb
Copy link
Member

eddyb commented Jun 7, 2016

@alexbool A backtrace or the last hundred or so lines from RUST_LOG=rustc_trans::mir could reveal the problem but I doubt either is possible on the MSVC nightly.

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

@eddyb UPD only happens on release builds. Minimal example on the way

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

Cargo.toml

[package]
name = "serde-codegen-failure"
version = "0.1.0"
authors = ["Alexander Bulaev <[email protected]>"]

[dependencies]
serde = "*"
serde_macros = "*"

src/lib.rs

#![feature(custom_derive, plugin)]
#![plugin(serde_macros)]

extern crate serde;

~/.cargo/config

[build]
rustflags = ["-Ctarget-cpu=native", "-Zorbit"]

(removing -Ctarget-cpu=native doesn't help)

Alexander@VAIO-FZ13 MINGW64 ~/serde-codegen-failure (master)
$ cargo build --verbose --release
   Compiling aster v0.17.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\aster-0.17.0\\src\\lib.rs --crate-name aster --crate-type lib -C opt-level=3 -C metadata=8cc5f970a844ae51 -C extra-filename=-8cc5f970a844ae51 --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
   Compiling quasi v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi-0.11.0\\src\\lib.rs --crate-name quasi --crate-type lib -C opt-level=3 -C metadata=f0f90e4a9a9f69ab -C extra-filename=-f0f90e4a9a9f69ab --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
   Compiling serde v0.7.8
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde-0.7.8\\src\\lib.rs --crate-name serde --crate-type lib -C opt-level=3 --cfg feature=\"std\" --cfg feature=\"default\" -C metadata=90f0afafc2b6e513 -C extra-filename=-90f0afafc2b6e513 --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
   Compiling serde_codegen v0.7.8
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\build.rs --crate-name build_script_build --crate-type bin -C opt-level=3 --cfg feature=\"quasi_macros\" --cfg feature=\"nightly\" --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\build\\serde_codegen-9f41a709c17aa9aa --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
     Running `C:\Users\Alexander\serde-codegen-failure\target\release\build\serde_codegen-9f41a709c17aa9aa\build-script-build`
   Compiling quasi_codegen v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi_codegen-0.11.0\\src\\lib.rs --crate-name quasi_codegen --crate-type lib -C opt-level=3 -C metadata=d15a779fc360468f -C extra-filename=-d15a779fc360468f --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --extern aster=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps\\libaster-8cc5f970a844ae51.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
   Compiling quasi_macros v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi_macros-0.11.0\\src\\lib.rs --crate-name quasi_macros --crate-type dylib -C prefer-dynamic -C opt-level=3 -C metadata=30f11f7edf6a7bdc -C extra-filename=-30f11f7edf6a7bdc --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --extern quasi_codegen=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps\\libquasi_codegen-d15a779fc360468f.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\src\\lib.rs --crate-name serde_codegen --crate-type lib -C opt-level=3 --cfg feature=\"quasi_macros\" --cfg feature=\"nightly\" -C metadata=17040f1a2091a93f -C extra-filename=-17040f1a2091a93f --out-dir C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps --extern quasi=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps\\libquasi-f0f90e4a9a9f69ab.rlib --extern quasi_macros=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps\\quasi_macros-30f11f7edf6a7bdc.dll --extern aster=C:\\Users\\Alexander\\serde-codegen-failure\\target\\release\\deps\\libaster-8cc5f970a844ae51.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit`
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\llvm\include\llvm/Support/Casting.h, line 223
error: Could not compile `serde_codegen`.

Caused by:
  Process didn't exit successfully: `rustc C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\src\lib.rs --crate-name serde_codegen --crate-type lib -C opt-level=3 --cfg feature="quasi_macros" --cfg feature="nightly" -C metadata=17040f1a2091a93f -C extra-filename=-17040f1a2091a93f --out-dir C:\Users\Alexander\serde-codegen-failure\target\release\deps --emit=dep-info,link -L dependency=C:\Users\Alexander\serde-codegen-failure\target\release\deps -L dependency=C:\Users\Alexander\serde-codegen-failure\target\release\deps --extern quasi=C:\Users\Alexander\serde-codegen-failure\target\release\deps\libquasi-f0f90e4a9a9f69ab.rlib --extern quasi_macros=C:\Users\Alexander\serde-codegen-failure\target\release\deps\quasi_macros-30f11f7edf6a7bdc.dll --extern aster=C:\Users\Alexander\serde-codegen-failure\target\release\deps\libaster-8cc5f970a844ae51.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit` (exit code: 3221226505)

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

Also build options (-Ctarget-cpu=native -Zorbit -Ctarget-cpu=native -Zorbit) are somehow passed twice, seems like there's also a cargo bug

@eddyb
Copy link
Member

eddyb commented Jun 7, 2016

@alexbool Isn't it easier to just run RUSTFLAGS=-Zorbit cargo build in serde_codegen's source dir?

@alexbool
Copy link
Contributor Author

alexbool commented Jun 7, 2016

@eddyb Yep, something like this works:

Alexander@VAIO-FZ13 MINGW64 ~/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/serde_codegen-0.7.8
$ cargo build --release --verbose --no-default-features --features "nightly"
   Compiling aster v0.17.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\aster-0.17.0\\src\\lib.rs --crate-name aster --crate-type lib -C opt-level=3 -C metadata=8cc5f970a844ae51 -C extra-filename=-8cc5f970a844ae51 --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit`
   Compiling serde_codegen v0.7.8 (file:///C:/Users/Alexander/.cargo/registry/src/github.aaakk.us.kg-1ecc6299db9ec823/serde_codegen-0.7.8)
     Running `rustc build.rs --crate-name build_script_build --crate-type bin -C opt-level=3 --cfg feature=\"nightly\" --cfg feature=\"quasi_macros\" --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\build\\serde_codegen-da094a7fbaf20dd5 --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps -Ctarget-cpu=native -Zorbit`
   Compiling quasi v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi-0.11.0\\src\\lib.rs --crate-name quasi --crate-type lib -C opt-level=3 -C metadata=f0f90e4a9a9f69ab -C extra-filename=-f0f90e4a9a9f69ab --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --cap-lints allow -Ctarget-cpu=native -Zorbit`
     Running `C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release\build\serde_codegen-da094a7fbaf20dd5\build-script-build`
   Compiling quasi_codegen v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi_codegen-0.11.0\\src\\lib.rs --crate-name quasi_codegen --crate-type lib -C opt-level=3 -C metadata=d15a779fc360468f -C extra-filename=-d15a779fc360468f --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --extern aster=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps\\libaster-8cc5f970a844ae51.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit`
   Compiling quasi_macros v0.11.0
     Running `rustc C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\quasi_macros-0.11.0\\src\\lib.rs --crate-name quasi_macros --crate-type dylib -C prefer-dynamic -C opt-level=3 -C metadata=30f11f7edf6a7bdc -C extra-filename=-30f11f7edf6a7bdc --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --extern quasi_codegen=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps\\libquasi_codegen-d15a779fc360468f.rlib --cap-lints allow -Ctarget-cpu=native -Zorbit`
     Running `rustc src\\lib.rs --crate-name serde_codegen --crate-type lib -C opt-level=3 --cfg feature=\"nightly\" --cfg feature=\"quasi_macros\" --out-dir C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release --emit=dep-info,link -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release -L dependency=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps --extern quasi_macros=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps\\quasi_macros-30f11f7edf6a7bdc.dll --extern aster=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps\\libaster-8cc5f970a844ae51.rlib --extern quasi=C:\\Users\\Alexander\\.cargo\\registry\\src\\github.aaakk.us.kg-1ecc6299db9ec823\\serde_codegen-0.7.8\\target\\release\\deps\\libquasi-f0f90e4a9a9f69ab.rlib -Ctarget-cpu=native -Zorbit`
Assertion failed: isa<X>(Val) && "cast<Ty>() argument of incompatible type!", file C:\bot\slave\nightly-dist-rustc-win-msvc-32\build\src\llvm\include\llvm/Support/Casting.h, line 223
error: Could not compile `serde_codegen`.

Caused by:
  Process didn't exit successfully: `rustc src\lib.rs --crate-name serde_codegen --crate-type lib -C opt-level=3 --cfg feature="nightly" --cfg feature="quasi_macros" --out-dir C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release --emit=dep-info,link -L dependency=C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release -L dependency=C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release\deps --extern quasi_macros=C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release\deps\quasi_macros-30f11f7edf6a7bdc.dll --extern aster=C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release\deps\libaster-8cc5f970a844ae51.rlib --extern quasi=C:\Users\Alexander\.cargo\registry\src\github.aaakk.us.kg-1ecc6299db9ec823\serde_codegen-0.7.8\target\release\deps\libquasi-f0f90e4a9a9f69ab.rlib -Ctarget-cpu=native -Zorbit` (exit code: 3221226505)

@eddyb
Copy link
Member

eddyb commented Jun 11, 2016

@alexbool Does this still happen on the latest nightly?

@alexbool
Copy link
Contributor Author

@eddyb latest nightly broke aster, so nope. I will recheck when it's fixed

@alexbool
Copy link
Contributor Author

Still reproduces on latest nightly and serde-codegen 0.7.10

@eddyb
Copy link
Member

eddyb commented Jun 12, 2016

@alexbool Is a debugger's backtrace in this case useless?

@alexbool
Copy link
Contributor Author

@eddyb What do yo mean with debugger's backtrace?
Also RUST_LOG=rustc_trans::mir seems to do nothing.

@eddyb
Copy link
Member

eddyb commented Jun 12, 2016

@alexbool I mean gdb or Visual Studio. RUST_BACKTRACE won't do no good because this is not a panic, it's an abort from LLVM.
RUST_LOG doesn't work because debug assertions are not enabled on nightly (cc @alexcrichton 😢).

@retep998
Copy link
Member

gdb won't work because it is -msvc. Visual Studio is the best option for getting a backtrace.

@alexbool
Copy link
Contributor Author

So what should I precisely do? Launch rustc under Visual Studio and then put a breakpoint? Where? Is nightly compiler shipped with debug symbols?

@eddyb
Copy link
Member

eddyb commented Jun 12, 2016

@alexbool It's not about breakpoints, the debugger will automatically catch the abort. The lack of debug symbols is why I asked whether it's useless.

@alexbool
Copy link
Contributor Author

OK, I try this later today

@retep998
Copy link
Member

retep998 commented Jun 12, 2016

Well, since rustc links to dylib versions of the standard library and friends, it actually means that those symbols which are exported from the dylibs can be sometimes found by the debugger when generating a backtrace. Granted proper debug symbols via PDB files are always better but nobody's decided on how to provide a debuginfo package for Rust yet.

@alexbool
Copy link
Contributor Author

default
So the backtrace looks like this...

@eddyb
Copy link
Member

eddyb commented Jun 12, 2016

@alexbool Yeah, that's what I was afraid of :(. Thanks anyway, although I don't have a windows setup to figure this out on.
cc @nikomatsakis

@alexcrichton
Copy link
Member

Ok, built a custom compiler with debuginfo and got a stack trace:

https://i.imgur.com/b4LUvWH.png

I wonder if this is fixed in upstream LLVM...

@alexcrichton
Copy link
Member

Oh also oddly enough, for me this was faulting in syntex_syntax rather than serde_codegen, but this was also 64-bit rather than 32-bit which may have changed something.

@eddyb
Copy link
Member

eddyb commented Jun 14, 2016

@alexcrichton That's really useful, thanks!
Judging from that stack trace, it's likely this cast called from inside SimplifyCFG.
LLVM's Verifier actually checks that the cast would succeed, so either SimplifyCFG is running before the Verifier (in which case trans could be generating bad IR that's not checked on creation) or SimplifyCFG is replacing uses of cleanuppad with something else.

@alexbool @alexcrichton The next step would be to get the last function from the (very verbose!) log produced by compiling with RUSTFLAGS="-Zorbit -Cllvm-args=-print-before-all" (do not set this for any other crate than the failing one, it would probably slow everything down).

@alexbool
Copy link
Contributor Author

@eddyb It's already compiling for 20 minutes and doesn't want to end. I see you are doing quite a lot of work in the compiler 😄
I'll post the results as soon they are ready

@eddyb
Copy link
Member

eddyb commented Jun 14, 2016

@alexbool Most of it is just all of the passes that are being ran on all of the LLVM functions, so there's a lot of stuff, and it slows down LLVM, too, sadly. @alexcrichton mentioned on IRC a few hours ago that he started the same thing, but I haven't heard back since.

@alexcrichton
Copy link
Member

@eddyb I may miss you on IRC, but I ran with -C llvm-args=-print-before-all yesterday and after running for ~24 hours now it's produced nearly 5GB of output and is still going. I think you can customize which passes you print before, right? Perhaps I should just try printing before the verifier pass if you think that's the one crashing?

@eddyb
Copy link
Member

eddyb commented Jun 15, 2016

@alexcrichton That's terrible, I'm sorry 😞.
RUSTFLAGS="-Zorbit -Cllvm-args=-print-before=simplifycfg" seems to print what I'm after (judging by the stack trace containing SimplifyCFG in it).

@alexbool
Copy link
Contributor Author

I'll try it either.

@alexbool
Copy link
Contributor Author

This is my log compile.log.gz

@eddyb
Copy link
Member

eddyb commented Jun 15, 2016

@eddyb
Copy link
Member

eddyb commented Jun 15, 2016

So it doesn't look like that function is invalid, which means that the function might have significantly changed due to the (possibly incorrect) SimplifyCFG pass.

@eddyb
Copy link
Member

eddyb commented Jun 15, 2016

@alexbool @alexcrichton Think I found the fix upstream: llvm-mirror/llvm@47bc554.

@alexcrichton
Copy link
Member

Ok, @brson and I will work on #34055, and once that's landed we can try to land an LLVM update, and hopefully that'll just magically fix this!

@alexcrichton
Copy link
Member

I've added this to the "Launch MIR into Orbit" milestone, but feel free to correct me if that was in error!

@eddyb
Copy link
Member

eddyb commented Jun 27, 2016

@alexbool Sounds good. What's the status of the LLVM update?

@alexcrichton
Copy link
Member

I'm not personally actively working on it, but @brson has posted about it here and here. We may want a little bit of extra coordinate to support both emscripten and AVR, but may just want to coordinate in this thread

@nikomatsakis
Copy link
Contributor

@alexcrichton seems like it qualifies for milestone to me.

@alexbool alexbool mentioned this issue Jul 11, 2016
3 tasks
@nikomatsakis
Copy link
Contributor

Do we believe that this is platform specific? The original comment mentions that it fails on Windows 32-bit, but not Mac -- what about linux? Other versions of Windows?

@alexbool
Copy link
Contributor Author

I cannot repriduce this on Linux. Did not try Windows 64 bit

@eddyb
Copy link
Member

eddyb commented Aug 1, 2016

@alexbool Next nightly (~20h from now) should be fixed. Will close when we have confirmation.

@alexbool
Copy link
Contributor Author

alexbool commented Aug 1, 2016

OK, I'll try

@eddyb
Copy link
Member

eddyb commented Aug 1, 2016

@alexbool FWIW both @alexcrichton and me and have tried and can't reproduce on beta or nightly.
I also can't reproduce on a local build that includes the LLVM upgrade, so this is most likely fixed now.

@alexbool
Copy link
Contributor Author

alexbool commented Aug 2, 2016

@eddyb I can confirm that with the latest nightly it doesn't reproduce

@eddyb eddyb closed this as completed Aug 2, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-MIR Area: Mid-level IR (MIR) - https://blog.rust-lang.org/2016/04/19/MIR.html
Projects
None yet
Development

No branches or pull requests

6 participants