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

LLVM assertion failed: conflicting locations for variable #29541

Closed
tomaka opened this issue Nov 3, 2015 · 8 comments
Closed

LLVM assertion failed: conflicting locations for variable #29541

tomaka opened this issue Nov 3, 2015 · 8 comments
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@tomaka
Copy link
Contributor

tomaka commented Nov 3, 2015

To reproduce, just clone this repo: https://github.com/tomaka/rustc-issue-repro (it's a stripped down version of my project)

cargo build should trigger:

Assertion failed: std::all_of(Expr.begin(), Expr.end(), [](const DIExpression *E) { return E && E->isBitPiece(); }) && "conflicting locations for variable", file c:\bot\slave\nightly-dist-rustc-win-msvc-64\build\src\llvm\lib\codegen\asmprinter\DwarfDebug.h, line 154

This is with the MSVC 64bits nightly from a few days ago.

The only clue that I have is that here if you replace the call to VertexBuffer::immutable with unsafe { ::std::mem::zeroed() }, it fixes the problem.

The problematic call graph is:

@michaelwoerister michaelwoerister added the A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) label Nov 3, 2015
@tomaka
Copy link
Contributor Author

tomaka commented Nov 3, 2015

Note that I have enabled 2 codegen units (https://github.com/tomaka/rustc-issue-repro/blob/master/Cargo.toml#L8), but it's also buggy even without that line.

Using opt-level 0 fixes it however.

@michaelwoerister
Copy link
Member

I can reproduce this on Linux.

@michaelwoerister
Copy link
Member

I have not had the time to really debug into this but my hunch is that LLVM messes up the debuginfo during optimization. This might still be a problem of rustc producing LLVM IR that is not quite valid.

@brson brson added P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. labels Apr 11, 2017
@brson
Copy link
Contributor

brson commented Apr 11, 2017

@michaelwoerister you might check out whether this is still an issue sometime.

@michaelwoerister
Copy link
Member

Yes, let's hope that a year of LLVM progress has solved this...

@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@steveklabnik
Copy link
Member

I cannot reproduce, but for unrelated reasons:

error: Could not compile `rustc-serialize`.
warning: build failed, waiting for other jobs to finish...
error[E0592]: duplicate definitions with name `item`
    --> C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\macros.rs:134:13
     |
134  |                pub unsafe fn $variant(&self) -> &$fieldtype {
     |   _____________-
     |  |_____________|
     | ||
135  | ||                 ::std::mem::transmute(&self.$field)
136  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item`
     |                other definition for `item`
     |
    ::: C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\commctrl.rs:2889:1
     |
2889 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error[E0592]: duplicate definitions with name `item_mut`
    --> C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\macros.rs:138:13
     |
138  |                pub unsafe fn $variantmut(&mut self) -> &mut $fieldtype {
     |   _____________-
     |  |_____________|
     | ||
139  | ||                 ::std::mem::transmute(&mut self.$field)
140  | ||             }
     | ||             -
     | ||_____________|
     | |______________duplicate definitions for `item_mut`
     |                other definition for `item_mut`
     |
    ::: C:\Users\Steve Klabnik\.cargo\registry\src\github.com-1ecc6299db9ec823\winapi-0.2.4\src\commctrl.rs:2889:1
     |
2889 |    UNION!(TVINSERTSTRUCTA, itemex, item, item_mut, TV_ITEMA);
     |    ---------------------------------------------------------- in this macro invocation

error: aborting due to 2 previous errors

@workingjubilee
Copy link
Member

Likewise, no repro but for apparently unrelated reasons, like so:

error[E0642]: patterns aren't allowed in functions without bodies
   --> /home/jubilee/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.3.16/src/serialize.rs:145:45
    |
145 | ...                   &f_name: &str,
    |                       ^^^^^^^ pattern not allowed in function without body

   Compiling byteorder v0.3.13
   Compiling lzw v0.8.0
   Compiling color_quant v1.0.0
error: aborting due to previous error

For more information about this error, try `rustc --explain E0642`.
error: could not compile `rustc-serialize`.

To learn more, run the command again with --verbose.
warning: build failed, waiting for other jobs to finish...
error: build failed

@hellow554
Copy link
Contributor

I'm not sure if this is still relevant. The original code can't be compiled anymore, because outdated dependencies e.g.:

error: `$stype:ty` may be followed by `functions`, which is not allowed for `ty` fragments
  --> /home/marcel/.cargo/registry/src/github.com-1ecc6299db9ec823/dlib-0.1.1/src/lib.rs:39:11
   |
39 |         $(functions: $(fn $fname: ident($($farg: ty),*) -> $fret:ty),+)|*
   |           ^^^^^^^^^ not allowed after `ty` fragments
   |
   = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`

and a lot more of that.

Even when updating all dependencies with cargo update it still does not compile.

So... can this be closed?

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.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants