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

Compilation ICE on nphysics crate #33096

Closed
trolleyman opened this issue Apr 19, 2016 · 19 comments · Fixed by #33099
Closed

Compilation ICE on nphysics crate #33096

trolleyman opened this issue Apr 19, 2016 · 19 comments · Fixed by #33099
Assignees
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: Writing correctness tests. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@trolleyman
Copy link

trolleyman commented Apr 19, 2016

When trying to compile nphysics on a nightly created on or after 2016-04-14, the compiler errors. Before this date it is fine.

Example code:

git clone https://github.com/sebcrozet/nphysics
rustup update nightly-2016-04-13 && rustup run nightly-2016-04-13 cargo build # Works fine
rustup update nightly-2016-04-14 && rustup run nightly-2016-04-13 cargo build # Errors

Presumably was this commit that broke things, as it's a commit on that day that touches trans.

On Windows 64 bit GNU this is the output:

   Compiling nphysics3d v0.2.2 (https://github.com/sebcrozet/nphysics.git#b379109f)
error: internal compiler error: ../src/librustc_trans\debuginfo\type_names.rs:155: debuginfo: Trying to create type name for unexpected type: <na::Pnt3<f32> as nc::ncollide_math::Point>::Vect
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'Box<Any>', ../src/libsyntax\errors/mod.rs:575
@trolleyman trolleyman changed the title ICE regression Compilation ICE on nphysics Apr 19, 2016
@alexcrichton
Copy link
Member

cc @eddyb

@alexcrichton alexcrichton added I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 19, 2016
@eddyb
Copy link
Member

eddyb commented Apr 19, 2016

You sure it's that innocent commit and not, you know, my changes to debuginfo, for MIR?
Specifically, this normalization is gone, that could cause problems.

@eddyb
Copy link
Member

eddyb commented Apr 19, 2016

@trolleyman I can't reproduce on master (just rebased one of my branches containing unrelated changes, so I had a compiler to check with).

EDIT: Still no reproduction, even after git checkout b379109f.

@trolleyman
Copy link
Author

trolleyman commented Apr 19, 2016

Ok so I was misinterpreting which crate was being compiled. nphysics compiles fine, but my crate, which uses nphysics, doesn't. I'm trying to narrow down the code now.

@trolleyman
Copy link
Author

Here's some of the rust log that I got when compiling on debug builds:

INFO:rustc_trans::common: Cache hit: Binder(<nc::shape::Plane<na::Vec3<f32>> as nc::ray::RayCast<na::Pnt3<f32>, na::Iso3<f32>>>)
INFO:rustc::middle::region: CodeExtent(118736) = CallSiteScope { fn_id: 5171551, body_id: 5171571 } [parent=0]
INFO:rustc::middle::region: CodeExtent(118737) = ParameterScope { fn_id: 5171551, body_id: 5171571 } [parent=118736]
INFO:rustc::middle::region: CodeExtent(118738) = Misc(5171554) [parent=0]
INFO:rustc::middle::region: CodeExtent(118739) = Misc(5171557) [parent=0]
INFO:rustc::middle::region: CodeExtent(118740) = Misc(5171561) [parent=0]
INFO:rustc::middle::region: CodeExtent(118741) = Misc(5171566) [parent=0]
INFO:rustc::middle::region: CodeExtent(118742) = DestructionScope(5171571) [parent=118737]
INFO:rustc::middle::region: CodeExtent(118743) = Misc(5171571) [parent=118742]
INFO:rustc::middle::region: CodeExtent(118744) = Misc(5171572) [parent=118743]
INFO:rustc::middle::region: CodeExtent(118745) = Misc(5171573) [parent=118744]
INFO:rustc::middle::region: CodeExtent(118746) = Misc(5171574) [parent=118745]
INFO:rustc::middle::region: CodeExtent(118747) = Misc(5171575) [parent=118745]
INFO:rustc::middle::region: CodeExtent(118748) = Misc(5171576) [parent=118745]
INFO:rustc::middle::region: CodeExtent(118749) = Misc(5171577) [parent=118745]
INFO:rustc::middle::region: CodeExtent(118750) = Misc(5171578) [parent=118744]
INFO:rustc::middle::region: CodeExtent(118751) = CallSiteScope { fn_id: 5171578, body_id: 5171582 } [parent=118750]
INFO:rustc::middle::region: CodeExtent(118752) = ParameterScope { fn_id: 5171578, body_id: 5171582 } [parent=118751]
INFO:rustc::middle::region: CodeExtent(118753) = Misc(5171580) [parent=0]
INFO:rustc::middle::region: CodeExtent(118754) = DestructionScope(5171582) [parent=118752]
INFO:rustc::middle::region: CodeExtent(118755) = Misc(5171582) [parent=118754]
INFO:rustc::middle::region: CodeExtent(118756) = Misc(5171583) [parent=118755]
INFO:rustc::middle::region: CodeExtent(118757) = Misc(5171584) [parent=118756]
INFO:rustc::middle::region: CodeExtent(118758) = DestructionScope(5171551) [parent=0]
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1]
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(118759) = CallSiteScope { fn_id: 11887, body_id: 11907 } [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::middle::region: CodeExtent(11868) = Misc(11909) [parent=1] BOGUS!
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as std::marker::Sized>))`
INFO:rustc::traits::fulfill: check_duplicate_trait hit: `Binder(TraitPredicate(<f32 as nc::ncollide_math::Scalar>))`
error: internal compiler error: ../src/librustc_trans\debuginfo\type_names.rs:155: debuginfo: Trying to create type name for unexpected type: <na::Pnt3<f32> as nc::ncollide_math::Point>::Vect

@eddyb
Copy link
Member

eddyb commented Apr 19, 2016

@trolleyman That's not really helpful, sadly, nightly doesn't use -C debug-assertions yet, so there's no debug! output.

@eddyb
Copy link
Member

eddyb commented Apr 19, 2016

@trolleyman This bug is not in beta, correct?

@trolleyman
Copy link
Author

@eddyb I'm afraid that I can't test that as I'm using #[feature]s.

@eddyb
Copy link
Member

eddyb commented Apr 20, 2016

@trolleyman Can you check the test from #33099 instead? Particularly interested about the nightlies you had issues with.

@trolleyman
Copy link
Author

@eddyb Sure, unfortunately that test case works fine for both pre and post-2016-04-14.

@eddyb
Copy link
Member

eddyb commented Apr 20, 2016

@trolleyman Ah, beats me then.

@eddyb eddyb added the E-needs-test Call for participation: Writing correctness tests. label Apr 20, 2016
@trolleyman
Copy link
Author

trolleyman commented Apr 20, 2016

@eddyb I'll try and find which part of my code hits the error.

@nagisa nagisa changed the title Compilation ICE on nphysics Compilation ICE on neat crate Apr 20, 2016
@trolleyman
Copy link
Author

@eddyb So I did some digging and I was wrong again, it turns out it is the nphysics crate. This is a minimal test case:

extern crate nphysics3d;

pub fn main() {
    nphysics3d::world::World::new().step(1.0);
}

@trolleyman trolleyman changed the title Compilation ICE on neat crate Compilation ICE on nphysics crate Apr 20, 2016
@eddyb
Copy link
Member

eddyb commented Apr 20, 2016

@trolleyman It depends on the nphysics3d crate, but it's not the crate itself, and that testcase is still large in terms of how much it needs to monomorphize.

@trolleyman
Copy link
Author

@eddyb True, sorry but I am not knowledgeable at all in rustc or nphysics, so it's the best I can do :/

@nikomatsakis
Copy link
Contributor

triage: P-high

@rust-highfive rust-highfive added P-high High priority and removed I-nominated labels Apr 21, 2016
bors added a commit that referenced this issue Apr 22, 2016
Normalize types before using them in debuginfo.

Small oversight, fixes #33096 - odd thing is that the old code doesn't look like it should've ever worked, although it wasn't using all of the type parameters, so maybe that's what changed.
bors added a commit that referenced this issue Apr 26, 2016
Normalize types before using them in debuginfo.

Small oversight, fixes #33096 - odd thing is that the old code doesn't look like it should've ever worked, although it wasn't using all of the type parameters, so maybe that's what changed.
@eddyb
Copy link
Member

eddyb commented Apr 26, 2016

Still need a good regression test.

@eddyb eddyb reopened this Apr 26, 2016
@nikomatsakis
Copy link
Contributor

triage: P-low

@rust-highfive rust-highfive added P-low Low priority and removed P-high High priority labels May 5, 2016
@nikomatsakis nikomatsakis added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. and removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. labels May 5, 2016
@arielb1 arielb1 removed the regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. label Jun 9, 2016
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 25, 2017
@Mark-Simulacrum
Copy link
Member

I'm going to go ahead and close this. It's somewhat unlikely we'll hit this again (at least, we haven't obviously done so in the past 3ish years), and coming up with a good test case when the current case is all of nphysics is likely to be quite hard.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: Writing correctness tests. P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants