Skip to content

ICE when compiling nalgebra 0.25.4 in Release mode #100550

Closed
@aabizri

Description

@aabizri

Code

ICE is triggered when building nalgebra 0.25.4 in file src\geometry\quaternion.rs in release mode. I'm not able to reproduce when building in debug mode. In my situation, the nalgebra crate is built as part of the dependency tree for a binary crate.

Meta

rustc --version --verbose:

<version>
rustc 1.65.0-nightly (75b7e52e9 2022-08-13)
binary: rustc
commit-hash: 75b7e52e92c3b00fc891b47f5b2efdff0a2be55a
commit-date: 2022-08-13
host: x86_64-pc-windows-msvc
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

error: internal compiler error: no errors encountered even though `delay_span_bug` issued

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:23009 ~ nalgebra[f868]::geometry::quaternion_ops::{impl#40}::mul), const_param_did: None }) (end of phase transition to Optimized) at bb6[22]:
                                Field projection `(*_25).field[0]` specified type `base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, base::array_storage::ArrayStorage<N, base::dimension::U4, base::dimension::U1>>`, but actual type is base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, <base::default_allocator::DefaultAllocator as base::allocator::Allocator<N, base::dimension::U4>>::Buffer>
   --> C:\Users\alexandre\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.25.4\src\geometry\quaternion.rs:197:9
    |
197 |         self.coords[3]
    |         ^^^^^^^^^^^
    |
   ::: C:\Users\alexandre\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.25.4\src\geometry\quaternion_ops.rs:388:13
    |
388 |         t * self.as_ref().scalar() + cross + rhs
    |             ---------------------- in this inlined function call
    |
    = note: delayed at compiler\rustc_const_eval\src\transform\validate.rs:129:36

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:22868 ~ nalgebra[f868]::geometry::quaternion_ops::{impl#12}::mul), const_param_did: None }) (end of phase transition to Optimized) at bb0[11]:
                                Field projection `(*_9).field[0]` specified type `base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, base::array_storage::ArrayStorage<N, base::dimension::U4, base::dimension::U1>>`, but actual type is base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, <base::default_allocator::DefaultAllocator as base::allocator::Allocator<N, base::dimension::U4>>::Buffer>
   --> C:\Users\alexandre\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.25.4\src\geometry\quaternion_ops.rs:70:10
    |
70  |         &self.coords[i]
    |          ^^^^^^^^^^^
...
163 |         self[3] * rhs[3] - self[0] * rhs[0] - self[1] * rhs[1] - self[2] * rhs[2],
    |         ------- in this inlined function call
    |
    = note: delayed at compiler\rustc_const_eval\src\transform\validate.rs:129:36

[ many other error: internal compiler error: broken MIR in Item ... nalgebra-0.25.4\src\geometry\quaternion.rs ... delayed at compiler\rustc_const_eval\src\transform\validate.rs:129:36 ]

error: internal compiler error: broken MIR in Item(WithOptConstParam { did: DefId(0:23718 ~ nalgebra[f868]::geometry::dual_quaternion_ops::{impl#119}::mul_assign), const_param_did: None }) (end of phase transition to Optimized) at bb2[2]:
                                Field projection `_6.field[0]` specified type `base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, base::array_storage::ArrayStorage<N, base::dimension::U4, base::dimension::U1>>`, but actual type is base::matrix::Matrix<N, base::dimension::U4, base::dimension::U1, <base::default_allocator::DefaultAllocator as base::allocator::Allocator<N, base::dimension::U4>>::Buffer>
    --> C:\Users\alexandre\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.25.4\src\geometry\quaternion.rs:29:23
     |
29   | #[derive(Debug, Copy, Clone, Hash, PartialEq, Eq)]
     |                       ^^^^^
     |
    ::: C:\Users\alexandre\.cargo\registry\src\github.com-1ecc6299db9ec823\nalgebra-0.25.4\src\geometry\dual_quaternion_ops.rs:1123:14
     |
1123 |     *self *= rhs.clone(); 'b);
     |              ----------- in this inlined function call
     |
     = note: delayed at compiler\rustc_const_eval\src\transform\validate.rs:129:36

[backtrace]

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.65.0-nightly (75b7e52e9 2022-08-13) running on x86_64-pc-windows-msvc

note: compiler flags: --crate-type lib -C opt-level=3 -C linker-plugin-lto -C codegen-units=1

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `nalgebra`
warning: build failed, waiting for other jobs to finish...
Backtrace

<backtrace>
thread 'rustc' panicked at 'Box<dyn Any>', compiler\rustc_errors\src\lib.rs:1425:13
stack backtrace:
   0:     0x7ff9c0749582 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hef430966cfd40ac8
   1:     0x7ff9c07848fb - core::fmt::write::h08e7466f952b94e4
   2:     0x7ff9c073c1ca - <std::io::IoSliceMut as core::fmt::Debug>::fmt::heb4f98fe9372c10e
   3:     0x7ff9c074cf04 - std::panicking::default_hook::hf1a1189a353bdc32
   4:     0x7ff9c074cb3a - std::panicking::default_hook::hf1a1189a353bdc32
   5:     0x7ff9695685b2 - rustc_driver[7ff512c552c17f15]::describe_lints
   6:     0x7ff9c074d902 - std::panicking::rust_panic_with_hook::h67d909907cf690e1
   7:     0x7ff96b8916b3 - <rustc_errors[245989d7d338c5df]::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter>::ui_testing
   8:     0x7ff96b891659 - <rustc_errors[245989d7d338c5df]::annotate_snippet_emitter_writer::AnnotateSnippetEmitterWriter>::ui_testing
   9:     0x7ff96b885cc9 - <rustc_errors[245989d7d338c5df]::emitter::FileWithAnnotatedLines as core[d233d27e09fbdb12]::fmt::Debug>::fmt
  10:     0x7ff96b87b919 - <rustc_feature[c68d06452a2c172]::builtin_attrs::AttributeType as core[d233d27e09fbdb12]::fmt::Debug>::fmt
  11:     0x7ff967d18ea7 - <rustc_errors[245989d7d338c5df]::HandlerInner as core[d233d27e09fbdb12]::ops::drop::Drop>::drop
  12:     0x7ff966e482c9 - <unknown>
  13:     0x7ff966e4af6f - <unknown>
  14:     0x7ff966e2601d - <unknown>
  15:     0x7ff966e232ac - <unknown>
  16:     0x7ff966e27c22 - <unknown>
  17:     0x7ff966e5d6f7 - rustc_driver[7ff512c552c17f15]::args::arg_expand_all
  18:     0x7ff966e26409 - <unknown>
  19:     0x7ff966e4cbfd - <unknown>
  20:     0x7ff9c075e0cc - std::sys::windows::thread::Thread::new::h92481c9c665bb623
  21:     0x7ffa63ac54e0 - BaseThreadInitThunk
  22:     0x7ffa6492485b - RtlUserThreadStart

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️P-criticalCritical priorityS-has-mcveStatus: A Minimal Complete and Verifiable Example has been found for this issueT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions