Closed
Description
I'm a user of the rust-zookeeper, and I found it build failed in release mode.
using the command: cargo build --release --verbose
log:https://gist.github.com/kamyuentse/1bf0c8d65fd40a17060f5cca515e720c
It seems an upstream bug related the LLVM? There is any workaround to fix this bug?
Environment:
rustc: rustc 1.22.0-nightly (0e6f4cf51 2017-09-27)
OS: CentOS Linux release 7.4.1708
Kernel: Linux 4.13.3-1.el7.elrepo.x86_64
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
jason-wolfe commentedon Sep 29, 2017
I just encountered the same bug using the same library, using
cargo build --release
.rustc:
rustc 1.22.0-nightly (dd08c3070 2017-09-12)
toolchain:
nightly-x86_64-unknown-linux-musl
andnightly-x86_64-unknown-linux-gnu
both trigger it.OS:
Ubuntu 14.04.5 LTS
Kernel:
Linux 3.19.0-80-generic x86_64
Builds fine in debug mode.
jonas-schievink commentedon Sep 29, 2017
Can repro on Arch with Rust nightlies from rustup, so not a packaging issue. Only one LLVM bug mentions the message: https://bugs.llvm.org/show_bug.cgi?id=24241
jason-wolfe commentedon Oct 20, 2017
I don't know if this is entirely relevant and don't know how to debug
rustc
, but I tried running withRUSTFLAGS="-Zverbose" cargo build --release --verbose
, which ended up resulting inI was surprised to see something entirely different than the error I see without the debug flag, the surprising part to me being
error: /home/jwolfe/Rust/rust-zookeeper/target/release/deps/libzookeeper_derive-3d948e35b92c7695.so: undefined symbol: _ZN116_$LT$alloc..string..String$u20$as$u20$core..convert..From$LT$$RF$ReEarlyBound$LP$0$C$$u20$$u27$a$RP$$u20$str$GT$$GT$4from17h3156f71d21fd9c11E
fulmicoton commentedon Oct 25, 2017
Here is a minimum code to reproduce.
https://github.com/fulmicoton/bug_known_bits/blob/master/src/lib.rs
To reproduce you can clone the repo and run
cargo build --release
.fulmicoton commentedon Oct 26, 2017
Here is the last pass that makes LLVM unhappy.
LLVM's value checker is correct to infer that some of the bits in the second branch are supposed to be both 0 and 1... The conclusion is however wrong : the branch is simply unreachable.
fulmicoton commentedon Oct 30, 2017
Same error without any panics! nor any enum.
arielb1 commentedon Nov 7, 2017
This crashes our LLVM with
-early-cse
set, but doesn't crash any of the debian llvmsarielb1 commentedon Nov 7, 2017
Minified:
arielb1 commentedon Nov 7, 2017
Looks like https://bugs.llvm.org/show_bug.cgi?id=31809 - there's a fix in upstream LLVM, which we can backport.
4 remaining items