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

Already completed forward declaration re-encountered in glfw-rs #14385

Closed
Manishearth opened this issue May 23, 2014 · 30 comments
Closed

Already completed forward declaration re-encountered in glfw-rs #14385

Manishearth opened this issue May 23, 2014 · 30 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Manishearth
Copy link
Member

servo/src/support/glfw/glfw-rs/src/lib/lib.rs:1:1: 1:1 error: internal compiler error: debuginfo::set_members_of_composite_type() - Already completed forward declaration re-encountered.
...
task 'rustc' failed at 'Box<Any>', /home/travis/build/Manishearth/rust/src/libsyntax/diagnostic.rs:99

This seems similar to the already-fixed issue #11083

Note: I'm using a Rust snapshot that I generated on a different system (with the same DEFAULT_TARGET as mine)

cc @michaelwoerister

@Manishearth Manishearth changed the title Already completed forwar Already completed forward declaration re-encountered in glfw-rs May 23, 2014
@Manishearth
Copy link
Member Author

Here's a Travis build with the same error: https://travis-ci.org/Manishearth/servo/builds/25913272#L1935

@michaelwoerister
Copy link
Member

Thanks for the report, @Manishearth! This seems to be a regression, possibly related to the internal representation of enums having slightly changed. I'll look into it next week.

pczarn referenced this issue in pczarn/rustboot May 28, 2014
bors added a commit that referenced this issue May 29, 2014
So far the DWARF information for enums was different for regular enums, univariant enums, Option-like enums, etc. Regular enums were encoded as unions of structs, while the other variants were encoded as bare structs. With the changes in this PR all enums are encoded as unions so that debuggers can reconstruct if something originally was a struct, a univariant enum, or an Option-like enum.  For the latter case, information about the *Null* variant is encoded into the union field name. This information can then be used by the debugger to print a `None` value actually as `None` instead of `Some(0x0)`.

The changes in this PR should also fix the regression reported in #14385 and #14411, but I want to close these only after I have confirmation from the original reporters that the issues are actually fixed for them.
@michaelwoerister
Copy link
Member

@Manishearth Can you take another look at this with a recent rustc version? Pull request #14486 should have improved the situation here.

@Manishearth
Copy link
Member Author

On it, pushed a new configuration to Travis here.

It certainly won't compile completely since Servo is not yet updated to that version of Rust, but we can see if we're getting the same error. I'll investigate it more locally once Travis finishes.

@Manishearth
Copy link
Member Author

It seems to be trying to compile now. Compiler errors mean that it's working :)

Mind if I leave this bug open for a while till we upgrade to that commit? I'll try to upgrade glfw beforehand and get atleast that crate compiling.

Thanks.

@michaelwoerister
Copy link
Member

Sure, let's leave it open until we have a more thorough confirmation that the issue is actually gone.

@Manishearth
Copy link
Member Author

@michaelwoerister Still getting it: https://travis-ci.org/Manishearth/servo#L1945

(Tried it locally too, same error)

@pczarn
Copy link
Contributor

pczarn commented Jun 9, 2014

Confirmed. It happens on a freshly compiled rustc.

../../common/lib.rs:1:1: 1:1 error: internal compiler error: debuginfo::set_members_of_composite_type() - Already completed forward declaration re-encountered.
...
task 'rustc' failed at 'Box<Any>', /home/piotr/Desktop/src/rust/src/libsyntax/diagnostic.rs:106

@Manishearth
Copy link
Member Author

Might this be because we normally use stage2 in Servo and make dist does stage3?

@jdm
Copy link
Contributor

jdm commented Jun 10, 2014

Could someone paste a gdb backtrace from a rust_fail breakpoint?

@pczarn
Copy link
Contributor

pczarn commented Jun 10, 2014

@jdm,

../../common/lib.rs:1:1: 1:1 error: internal compiler error: debuginfo::set_members_of_composite_type() - Already completed forward declaration re-encountered.
../../common/lib.rs:1 #![crate_id = "main#0.2.2"]
                      ^
[Switching to Thread 0x7ffff0bff480 (LWP 2173)]

Breakpoint 1, 0x00007ffff537f700 in rust_fail () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
(gdb) bt
#0  0x00007ffff537f700 in rust_fail () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#1  0x00007ffff5380037 in unwind::begin_unwind_inner::hfd37841716213d96x2c::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#2  0x00007ffff43dd4a7 in unwind::begin_unwind::h12950421085911345052::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/./libsyntax-555559ea-0.11.0-pre.so
#3  0x00007ffff43dd428 in diagnostic::SpanHandler::span_bug::h48fc76835081112a0Xb::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/./libsyntax-555559ea-0.11.0-pre.so
#4  0x00007ffff5c959e7 in driver::session::Session::span_bug::hb8d7c368d1d97a6doKo::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#5  0x00007ffff5d9c7f3 in middle::trans::debuginfo::set_members_of_composite_type::h3805a45387885655QWC::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#6  0x00007ffff5d9ade8 in middle::trans::debuginfo::RecursiveTypeDescription::finalize::h8a31e02455da0737xqC::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#7  0x00007ffff5d90fe6 in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#8  0x00007ffff5d9080b in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#9  0x00007ffff5da50aa in middle::trans::debuginfo::vec_slice_metadata::h101cbd830e2c51c10dD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#10 0x00007ffff5d911d5 in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#11 0x00007ffff5d98765 in middle::trans::debuginfo::MemberDescriptionFactory::create_member_descriptions::ha28510fe76d9a672qpC::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#12 0x00007ffff5d9adb3 in middle::trans::debuginfo::RecursiveTypeDescription::finalize::h8a31e02455da0737xqC::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#13 0x00007ffff5d90fe6 in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#14 0x00007ffff5d9080b in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#15 0x00007ffff5da5827 in middle::trans::debuginfo::subroutine_type_metadata::h6349c46bd350d435XkD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#16 0x00007ffff5d90019 in middle::trans::debuginfo::type_metadata::h3eb6bdcf2d1a89187oD::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#17 0x00007ffff5d28c51 in middle::trans::debuginfo::create_function_debug_context::h2420aabfb75dcf1ceJB::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#18 0x00007ffff5c90433 in middle::trans::base::new_fn_ctxt::hdc1078f52281090fo7p::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#19 0x00007ffff5d2d3b5 in middle::trans::base::trans_closure::h0dcff8693fb366e0tlq::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#20 0x00007ffff5c3f793 in middle::trans::base::trans_fn::h92a1c2c07b68000awtq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#21 0x00007ffff5d30e71 in middle::trans::foreign::trans_rust_fn_with_foreign_abi::h602b9f0d0017ed68S0y::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#22 0x00007ffff5c394e1 in middle::trans::base::trans_item::h8bd0be1e1511fc4dWJq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#23 0x00007ffff5c38e2a in middle::trans::base::trans_item::h8bd0be1e1511fc4dWJq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#24 0x00007ffff5c38e2a in middle::trans::base::trans_item::h8bd0be1e1511fc4dWJq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#25 0x00007ffff5c38e2a in middle::trans::base::trans_item::h8bd0be1e1511fc4dWJq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#26 0x00007ffff5c38e2a in middle::trans::base::trans_item::h8bd0be1e1511fc4dWJq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#27 0x00007ffff5d3d9d1 in middle::trans::base::trans_crate::h2f77fbab9c1e59223Cr::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#28 0x00007ffff64fca10 in driver::driver::phase_4_translate_to_llvm::h743c10cb074825937Un::v0.11.0.pre ()
   from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#29 0x00007ffff64f3062 in driver::driver::compile_input::h6483688c4f0613baICn::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#30 0x00007ffff65bc658 in driver::run_compiler::h8ac7207d0ef3107aphq::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#31 0x00007ffff65b9986 in driver::main_args::closure.94747 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#32 0x00007ffff65d425b in driver::monitor::closure.95809 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#33 0x00007ffff65cf478 in task::TaskBuilder::try::closure.95572 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustc-d252d482-0.11.0-pre.so
#34 0x00007ffff56d5868 in task::spawn_opts::closure.7118 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libnative-1fb5e2c0-0.11.0-pre.so
#35 0x00007ffff537d4b3 in task::Task::run::closure.5032 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#36 0x00007ffff53f074c in rust_try () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#37 0x00007ffff537f506 in unwind::try::h271ce1a7188be5b4TQc::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#38 0x00007ffff537d365 in task::Task::run::h4c021c9979341529qxc::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/librustrt-d8560cb2-0.11.0-pre.so
#39 0x00007ffff56d56db in task::spawn_opts::closure.7091 () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/libnative-1fb5e2c0-0.11.0-pre.so
#40 0x00007ffff2fdd024 in rt::thread::thread_start::h5953ff68110adc88jAs::v0.11.0.pre () from /home/piotr/Desktop/src/rust/x86_64-unknown-linux-gnu/stage1/bin/../lib/./libstd-59beb4f7-0.11.0-pre.so
#41 0x00007ffff2d13124 in start_thread () from /usr/lib/libpthread.so.0
#42 0x00007ffff50564bd in clone () from /usr/lib/libc.so.6

@larsbergstrom
Copy link
Contributor

Could this be because instead of using the in-tree LLVM to build rustc (which takes too long for TravisCI to complete), we are using a system LLVM? Below paste contains details on which LLVM we are using:

$ export LLVM_VERSION=3.4
$ export CC=gcc
git.1
$ git clone --depth=50 --branch=travis git://github.com/larsbergstrom/rust.git larsbergstrom/rust
Cloning into 'larsbergstrom/rust'...
remote: Counting objects: 23542, done.
remote: Compressing objects: 100% (11970/11970), done.
remote: Total 23542 (delta 18674), reused 14852 (delta 11194)
Receiving objects: 100% (23542/23542), 10.50 MiB | 12.19 MiB/s, done.
Resolving deltas: 100% (18674/18674), done.
Checking connectivity... done.
$ cd larsbergstrom/rust
git.3
$ git checkout -qf 5effe33de4daae07115c485fd61dc22f0df48d3e
$ gcc --version
gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

install.1
$ sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise-3.4 main' >> /etc/apt/sources.list"
install.2
$ sudo sh -c "echo 'deb http://llvm.org/apt/precise/ llvm-toolchain-precise main' >> /etc/apt/sources.list"
install.3
$ sudo sh -c "echo 'deb http://ppa.launchpad.net/ubuntu-toolchain-r/test/ubuntu precise main' >> /etc/apt/sources.list"
install.4
$ wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key | sudo apt-key add -
--2014-06-09 15:42:41--  http://llvm.org/apt/llvm-snapshot.gpg.key
Resolving llvm.org (llvm.org)... 128.174.246.134
Connecting to llvm.org (llvm.org)|128.174.246.134|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3145 (3.1K) [application/pgp-keys]
Saving to: `STDOUT'

100%[======================================>] 3,145       --.-K/s   in 0s      

2014-06-09 15:42:42 (308 MB/s) - written to stdout [3145/3145]

OK
install.5
$ sudo apt-get update -qq
W: GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 1E9377A2BA9EF27F
install.6
$ sudo apt-get install -qq --force-yes -y llvm-$LLVM_VERSION llvm-${LLVM_VERSION}-dev clang-$LLVM_VERSION lldb-$LLVM_VERSION
WARNING: The following packages cannot be authenticated!
  gcc-4.8-base libgcc1 libstdc++6 libasan0 libatomic1 libgomp1 libitm1
  libtsan0 libquadmath0 libgcc-4.8-dev libstdc++-4.8-dev libobjc4
  libobjc-4.8-dev
Selecting previously unselected package gcc-4.8-base.
(Reading database ... 70182 files and directories currently installed.)
Unpacking gcc-4.8-base (from .../gcc-4.8-base_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Setting up gcc-4.8-base (4.8.1-2ubuntu1~12.04) ...
(Reading database ... 70189 files and directories currently installed.)
Preparing to replace libgcc1 1:4.6.3-1ubuntu5 (using .../libgcc1_1%3a4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libgcc1 ...
Setting up libgcc1 (1:4.8.1-2ubuntu1~12.04) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
(Reading database ... 70189 files and directories currently installed.)
Preparing to replace libstdc++6 4.6.3-1ubuntu5 (using .../libstdc++6_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libstdc++6 ...
Setting up libstdc++6 (4.8.1-2ubuntu1~12.04) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Selecting previously unselected package libasan0.
(Reading database ... 70189 files and directories currently installed.)
Unpacking libasan0 (from .../libasan0_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libatomic1.
Unpacking libatomic1 (from .../libatomic1_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libllvm3.4.
Unpacking libllvm3.4 (from .../libllvm3.4_1%3a3.4+206783-1~exp1_amd64.deb) ...
Preparing to replace libgomp1 4.6.3-1ubuntu5 (using .../libgomp1_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libgomp1 ...
Selecting previously unselected package libitm1.
Unpacking libitm1 (from .../libitm1_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libtsan0.
Unpacking libtsan0 (from .../libtsan0_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Preparing to replace libquadmath0 4.6.3-1ubuntu5 (using .../libquadmath0_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Unpacking replacement libquadmath0 ...
Selecting previously unselected package libgcc-4.8-dev.
Unpacking libgcc-4.8-dev (from .../libgcc-4.8-dev_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libstdc++-4.8-dev.
Unpacking libstdc++-4.8-dev (from .../libstdc++-4.8-dev_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libobjc4.
Unpacking libobjc4 (from .../libobjc4_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libobjc-4.8-dev.
Unpacking libobjc-4.8-dev (from .../libobjc-4.8-dev_4.8.1-2ubuntu1~12.04_amd64.deb) ...
Selecting previously unselected package libclang1-3.4.
Unpacking libclang1-3.4 (from .../libclang1-3.4_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package binfmt-support.
Unpacking binfmt-support (from .../binfmt-support_2.0.8_amd64.deb) ...
Selecting previously unselected package llvm-3.4-runtime.
Unpacking llvm-3.4-runtime (from .../llvm-3.4-runtime_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package llvm-3.4.
Unpacking llvm-3.4 (from .../llvm-3.4_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package llvm-3.4-dev.
Unpacking llvm-3.4-dev (from .../llvm-3.4-dev_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package lldb-3.4.
Unpacking lldb-3.4 (from .../lldb-3.4_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package libclang-common-3.4-dev.
Unpacking libclang-common-3.4-dev (from .../libclang-common-3.4-dev_1%3a3.4+206783-1~exp1_amd64.deb) ...
Selecting previously unselected package clang-3.4.
Unpacking clang-3.4 (from .../clang-3.4_1%3a3.4+206783-1~exp1_amd64.deb) ...
Processing triggers for man-db ...
Processing triggers for ureadahead ...
Setting up libasan0 (4.8.1-2ubuntu1~12.04) ...
Setting up libatomic1 (4.8.1-2ubuntu1~12.04) ...
Setting up libllvm3.4 (1:3.4+206783-1~exp1) ...
Setting up libgomp1 (4.8.1-2ubuntu1~12.04) ...
Setting up libitm1 (4.8.1-2ubuntu1~12.04) ...
Setting up libtsan0 (4.8.1-2ubuntu1~12.04) ...
Setting up libquadmath0 (4.8.1-2ubuntu1~12.04) ...
Setting up libgcc-4.8-dev (4.8.1-2ubuntu1~12.04) ...
Setting up libstdc++-4.8-dev (4.8.1-2ubuntu1~12.04) ...
Setting up libobjc4 (4.8.1-2ubuntu1~12.04) ...
Setting up libobjc-4.8-dev (4.8.1-2ubuntu1~12.04) ...
Setting up libclang1-3.4 (1:3.4+206783-1~exp1) ...
Setting up binfmt-support (2.0.8) ...
binfmt-support stop/waiting
Setting up llvm-3.4-runtime (1:3.4+206783-1~exp1) ...
Setting up llvm-3.4 (1:3.4+206783-1~exp1) ...
Setting up llvm-3.4-dev (1:3.4+206783-1~exp1) ...
Setting up lldb-3.4 (1:3.4+206783-1~exp1) ...
Setting up libclang-common-3.4-dev (1:3.4+206783-1~exp1) ...
Setting up clang-3.4 (1:3.4+206783-1~exp1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
before_script.1
$ mkdir -p local-llvm/bin
before_script.2
$ ln -nsf /usr/bin/llvm-config-$LLVM_VERSION local-llvm/bin/llvm-config
before_script.3
$ ln -nsf /usr/bin/llvm-mc-$LLVM_VERSION local-llvm/bin/llvm-mc
before_script.4
$ ln -nsf /usr/bin/llvm-as-$LLVM_VERSION local-llvm/bin/llvm-as
before_script.5
$ ln -nsf /usr/bin/llvm-dis-$LLVM_VERSION local-llvm/bin/llvm-dis
before_script.6
$ ln -nsf /usr/bin/llc-$LLVM_VERSION local-llvm/bin/llc
before_script.7
$ ln -nsf /usr/include/llvm-$LLVM_VERSION local-llvm/include
before_script.8
$ ./configure --disable-docs --disable-optimize-tests --llvm-root=`pwd`/local-llvm --enable-fast-make --enable-clang
configure: looking for configure programs

@michaelwoerister
Copy link
Member

I'll look into this issue tomorrow. It's possible that the LLVM version has to do with it. In #14411 it also (?) only breaks with a custom LLVM version. The issue is related to the way LLVM collapses multiple IR metadata nodes into one, if they are the same. Maybe older LLVM versions do something different there (although 3.4 seems pretty new). I'll know more when I can reproduce the bug.

@michaelwoerister
Copy link
Member

@larsbergstrom Are you using the rustc version given in the listing above (commit 5effe33de4daae07115c485fd61dc22f0df48d3e)? Because this commit does not contain the fixes from PR #14486. If so, could you try again with a newer version (e.g. 0935beb)?

@larsbergstrom
Copy link
Contributor

Aha! Building with LLVM3.5 appears to get us past the problem (which was easy to do on Linux, given availability of 3.5 packages).

If I can also handle it on OSX with LLVM3.4.1, I think we'll have a workaround for now.

@michaelwoerister
Copy link
Member

Glad to hear it. Mind though, that it might be possible that you were/are using a rustc version that does not yet contain the fix for the regression causing this issue. That should also resolve the issue.

@larsbergstrom
Copy link
Contributor

You're right - this did not work with 3.4.1, which was the best prebuilt LLVM I could get for OSX easily.

I'm updating to the rustc version that you mentioned in the previous commit and will let you know if that works for us. Thanks!

@michaelwoerister
Copy link
Member

Great! If it still doesn't work then, I'll take another look and try to recreate your build environment.

@larsbergstrom
Copy link
Contributor

@michaelwoerister Unfortunately, your patches did not work against a prebuilt 3.4.1 LLVM - we still have this error.

@michaelwoerister
Copy link
Member

Well, in that case this will be the top-most item on my agenda tomorrow :)

@pczarn
Copy link
Contributor

pczarn commented Jun 11, 2014

Indeed, I'm using a system LLVM.

@michaelwoerister
Copy link
Member

OK, I just was able to reproduce this. Using the in-tree LLVM version it works, but using an out-of-tree 3.4.1 LLVM on Mac OSX triggers the bug.

@michaelwoerister
Copy link
Member

OK, I found the culprit. Compiling things with a out-of-tree LLVM below version 3.5 would so faithfully fail because of the following snippet from rustllvm/RustWrapper.cpp:

return wrap(Builder->createStructType(
        unwrapDI<DIDescriptor>(Scope),
        Name,
        unwrapDI<DIFile>(File),
        LineNumber,
        SizeInBits,
        AlignInBits,
        Flags,
        unwrapDI<DIType>(DerivedFrom),
        unwrapDI<DIArray>(Elements),
        RunTimeLang,
        unwrapDI<DIType>(VTableHolder)
#if LLVM_VERSION_MINOR >= 5
        ,UniqueId
#endif
        ));

Yuck! :)
The unique-id parameter (which is pretty crucial for programs over a certain size) was just uninitialized when older LLVM versions were used. The parameter is actually available since 3.4.0. I'll prepare a pull request that will correct this...

@jdm
Copy link
Contributor

jdm commented Jun 12, 2014

😱

@michaelwoerister
Copy link
Member

😱

Exactly :P
Nonetheless, it's also very gratifying to find a bug after methodically searching for it for a full day!

@larsbergstrom
Copy link
Contributor

@michaelwoerister Your hard work is appreciated in Servo's relentless quest to reduce its build time requirements :-)

@michaelwoerister
Copy link
Member

This should be resolved by now. I've tested it against a current glfw-rs version and with LLVM 3.4.1 and it works fine. As soon as you are using a version of rustc containing PR #14935, could you give me an update here? You can also just close the issue directly if this is resolved for you.

@Manishearth
Copy link
Member Author

I checked a bit and it was resolved. Closing for now, though I'll redownload the snapshot and check again later.

Thanks a bunch! :)

@michaelwoerister
Copy link
Member

@Manishearth You're welcome!

@Manishearth
Copy link
Member Author

Tried this with Rust@9f8d2205f0518389993a9b5de6646ba8b14e5a12 (yesterday-ish), it works perfectly.

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 5, 2023
Fix VS Code status message formatting error
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants