-
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
rustc 1.32 using system LLVM crashes while building the resvg crate #57762
Comments
Arch uses this build config for packaging fwiw: [llvm]
link-shared = true
[build]
cargo = "/usr/bin/cargo"
rustc = "/usr/bin/rustc"
python = "python2.7"
extended = true
sanitizers = false
[install]
prefix = "/usr"
[rust]
# 0 or the new default of 16 is faster, but can result in worse performance
# /~https://github.com/rust-lang/rust/issues/47745
codegen-units = 1
debuginfo = true
debuginfo-lines = true
channel = "stable"
rpath = false
[target.x86_64-unknown-linux-gnu]
llvm-config = "/usr/bin/llvm-config" |
Arch's build uses the system LLVM, while rustup's uses a bundled one, so the problem is probably due to an LLVM bug that's only present in Arch's version. |
Tentatively labeling as I-unsound due to "invalid memory reference". |
That's how LLVM asserts look when built without debug check enabled. |
Could you please provide a backtrace for the segfault? |
@nikic How can I do this? |
set |
@hellow554 It doesn't make any difference. I've also tried |
I'm not sure what the canonical way to do this, but I'd just take the rustc command cargo printed out and run it under gdb via |
|
Doesn't look familiar to me, maybe @tromey has seen this trace before? |
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org>
Seems to be fixed by backporting: |
I'm investigating this for Fedora too: https://bugzilla.redhat.com/show_bug.cgi?id=1668033 @foutrelis Thanks for identifying those patches -- I will definitely try that next! |
I confirmed that the discriminator patch fixes it, thanks again! That's already in rust/src/llvm, of course. The remaining question here is whether rustc should disable the new enum DWARF for external LLVM7, as I had bisected this to 71ce4c3. Or we can just let this issue serve as notice that this LLVM patch is needed for those that use external LLVM. |
If that's going to be a requirement, it feels really disingenuous for LLVM 6 be the claimed minimum supported LLVM version. The earliest actually supported upstream release should be what |
The code in rustc has a fallback for earlier versions of LLVM. The problem here, instead, is that the fallback is not used by LLVM 7, but unfortunately LLVM 7 was released without a necessary bug fix. Changing the fallback to check for "LLVM >= 8 or Rust LLVM" would be fine. See /~https://github.com/rust-lang/rust/blob/master/src/librustc_codegen_llvm/debuginfo/metadata.rs#L1163-L1168 |
I have a patch for this, will submit shortly. |
The main issue with the patch is that if your system LLVM has the fix, then you'll have to patch rustc to back out this workaround; or else have worse debuginfo for enums. |
Yeah, it's not obvious what the right answer should be. But since this causes a hard SIGSEGV, it probably is better to take the conservative stance, assuming LLVM7 is unpatched. I will plan on patching Fedora rustc to re-enable this, having patched LLVM already. |
Fix issue 57762 against a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes rust-lang#57762
Issue 57762 points out a compiler crash when the compiler was built using a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes rust-lang#57762
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org>
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org>
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
* Add support for all ppc64 targets. * Use bundled LLVM instead of system wide LLVM. Rust statically links against LLVM anyway and we can avoid some bugs this way (such as Rust failing to compile Firefox, see rust-lang/rust#57762 Co-authored-by: q66 <daniel@octaforge.org> [ci skip]
- llvm-mirror/llvm@da1fb72 - llvm-mirror/llvm@cc1f2a5 it should unbreak firefox: firefox uses rustc with `-C lto' option for some part of its build, and this code path expose the llvm bug. llvm review: https://reviews.llvm.org/D52340 rust issue: rust-lang/rust#57762 bump lang/rust to ensure updated statically linked libraries are taken on update. ok jca@
Issue 57762 points out a compiler crash when the compiler was built using a stock LLVM 7. LLVM 7 was released without a necessary fix for a bug in the DWARF discriminant code. This patch changes rustc to use the fallback mode on (non-Rust) LLVM 7. Closes rust-lang#57762
See: rust-lang/rust#57762 (cherry picked from commit c340704)
Initial issue: linebender/resvg#110
Steps to reproduce:
The master branch can be built without rustc crashing on Gentoo and on Travis (Ubuntu 14.04.5 LTS).
UPD: I've tried to build it too and I have the same error. Looks like something wrong with the Arch's rustc. Because if we use the one installed via
rustup
- everything is ok.UPD: it can be fixed by disabling the LTO, which is enabled by default for
resvg
.The text was updated successfully, but these errors were encountered: