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

Open
tomaka opened this Issue Nov 3, 2015 · 6 comments

Comments

Projects
None yet
5 participants
@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:

@tomaka

This comment has been minimized.

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

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Nov 3, 2015

I can reproduce this on Linux.

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Nov 4, 2015

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

This comment has been minimized.

Copy link
Contributor

brson commented Apr 11, 2017

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

@michaelwoerister

This comment has been minimized.

Copy link
Contributor

michaelwoerister commented Apr 11, 2017

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

@steveklabnik

This comment has been minimized.

Copy link
Member

steveklabnik commented Sep 24, 2018

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.