Skip to content

ICE: build cache corruption #49663

Closed
@elinorbgr

Description

@elinorbgr
Contributor

Sorry, the testcase is not exactly simple, but:

diff --git a/wayland-server/src/lib.rs b/wayland-server/src/lib.rs
index 8685ab04..f83909dd 100644
--- a/wayland-server/src/lib.rs
+++ b/wayland-server/src/lib.rs
@@ -1,3 +1,5 @@
+#![warn(missing_docs)]
+
 #[macro_use]
 extern crate bitflags;
 extern crate libc;
  • re-run cargo +beta test --all --all-features
  • ICE :
error: internal compiler error: librustc/ty/context.rs:998: tried to cache DefId(20/0:393 ~ wayland_server[52b1]::generated[0]::c_interfaces[0]::wl_surface_interface[0]), but was already existing as AllocId(
    451
)
  • run cargo clean
  • re-run cargo +beta test --all --all-features
  • builds and run fine
$ rustc +beta --version
rustc 1.26.0-beta.1 (18aaa1d2c 2018-04-03)
$cargo +beta --version
cargo 1.26.0-beta (d63299b6e 2018-03-28)

Does not reproduce on stable 1.25, reproduces on nightly as well.

Activity

self-assigned this
on Apr 4, 2018
oli-obk

oli-obk commented on Apr 4, 2018

@oli-obk
Contributor

Do you have a generated Wayland_c_interfaces.rs at hand? If not I'll have a look tomorrow

elinorbgr

elinorbgr commented on Apr 4, 2018

@elinorbgr
ContributorAuthor
added
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
C-bugCategory: This is a bug.
T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
on Apr 5, 2018
added this to the 1.26 milestone on Apr 5, 2018
nikomatsakis

nikomatsakis commented on Apr 5, 2018

@nikomatsakis
Contributor

triage: P-high

Regression, @oli-obk is on it.

oli-obk

oli-obk commented on Apr 7, 2018

@oli-obk
Contributor

I don't have a minimal repro yet, but it looks very much like this is only happening cross crate.

oli-obk

oli-obk commented on Apr 8, 2018

@oli-obk
Contributor

Minimized (probably not minimal) repro:

// a.rs
pub const FOO: *const i8 = 0 as *const i8;

pub static mut BAR: [*const i8; 4] = [FOO, FOO, FOO, FOO];

pub static mut BAA: (*const i8, i32, *const i8) = (
    unsafe { &BAR as *const _ as *const i8 },
    42,
    unsafe { &BOO as *const _ as *const i8 },
);
pub static mut BOO: (*const i8, *const i8, u32) = (
    unsafe { &BAA as *const _ as *const i8 },
    &FOO as *const _ as *const i8,
    99,
);

// b.rs
extern crate a;

static mut BOO: *const i32 = unsafe { &a::BOO as *const _ as *const i32 };

fn main() {}

Adding an empty line to the beginning of a.rs causes another symptom of this bug.

oli-obk

oli-obk commented on Apr 9, 2018

@oli-obk
Contributor

Fully minimized

pub static mut BAA: *const i8 = unsafe { &BOO as *const _ as *const i8 };
pub static mut BOO: *const i8 = unsafe { &BAA as *const _ as *const i8 };
fn main() {}

Adding an empty line to the beginning of the file causes an ICE.

The only possible fix I see is to add the previously discussed interpret-alloc-table that'll get cached via the footer instead of trying to do everything inline

added a commit that references this issue on Apr 15, 2018

Auto merge of #49833 - oli-obk:incremental_miri_regression, r=michael…

7360d6d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @alexcrichton@nikomatsakis@oli-obk@pietroalbini@elinorbgr

    Issue actions

      ICE: build cache corruption · Issue #49663 · rust-lang/rust