Skip to content

Internal compiler error: broken MIR in gecko_bindings #42042

Closed
@rillian

Description

@rillian

Rust 1.18.0-beta.2 (f4e8e81 2017-05-11) fails to compile some stylo code in Firefox:

 6:27.45 error[E0161]: cannot move a value of type [gecko_bindings::structs::root::nsStyleCoord]: the size of [gecko_bindings::structs::root::nsStyleCoord] cannot be statically determined
 6:27.45     --> /home/giles/firefox/obj-x86_64-pc-linux-gnu/toolkit/library/x86_64-unknown-linux-gnu/debug/build/style-9cea8a5ed5bf5b1e/out/gecko_properties.rs:8177:29
 6:27.45      |
 6:27.45 8177 |                             shape.mCoordinates[2 * i].leaky_set_null();
 6:27.45      |                             ^^^^^^^^^^^^^^^^^^
 6:27.45 
 6:27.45 error[E0161]: cannot move a value of type [gecko_bindings::structs::root::nsStyleCoord]: the size of [gecko_bindings::structs::root::nsStyleCoord] cannot be statically determined
 6:27.45     --> /home/giles/firefox/obj-x86_64-pc-linux-gnu/toolkit/library/x86_64-unknown-linux-gnu/debug/build/style-9cea8a5ed5bf5b1e/out/gecko_properties.rs:8178:29
 6:27.45      |
 6:27.45 8178 |                             shape.mCoordinates[2 * i + 1].leaky_set_null();
 6:27.45      |                             ^^^^^^^^^^^^^^^^^^
 6:27.45 
 6:27.45 error: internal compiler error: broken MIR (Terminator { source_info: SourceInfo { span: /home/giles/firefox/obj-x86_64-pc-linux-gnu/toolkit/library/x86_64-unknown-linux-gnu/debug/build/style-9cea8a5ed5bf5b1e/out/gecko_properties.rs:8177:29: 8177:54, scope: scope16 }, kind: _179 = const std::ops::Index::index(_180, _183) -> [return: bb87, unwind: bb21] }): bad arg #0 (&[gecko_bindings::structs::root::nsStyleCoord] <- [gecko_bindings::structs::root::nsStyleCoord]): Sorts(ExpectedFound { expected: &[gecko_bindings::structs::root::nsStyleCoord], found: [gecko_bindings::structs::root::nsStyleCoord] })
[...]
 6:28.22 note: the compiler unexpectedly panicked. this is a bug.
 6:28.22 
 6:28.22 note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
 6:28.22 
 6:28.22 note: run with `RUST_BACKTRACE=1` for a backtrace
 6:28.22 
 6:28.22 thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:375
 6:28.22 stack backtrace:
 6:28.22    0: std::sys::imp::backtrace::tracing::imp::unwind_backtrace
 6:28.22              at /checkout/src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
 6:28.22    1: std::sys_common::backtrace::_print
 6:28.23              at /checkout/src/libstd/sys_common/backtrace.rs:71
 6:28.23    2: std::panicking::default_hook::{{closure}}
 6:28.23              at /checkout/src/libstd/sys_common/backtrace.rs:60
 6:28.23              at /checkout/src/libstd/panicking.rs:355
 6:28.23    3: std::panicking::default_hook
 6:28.23              at /checkout/src/libstd/panicking.rs:365
 6:28.23    4: std::panicking::rust_panic_with_hook
 6:28.23              at /checkout/src/libstd/panicking.rs:549
 6:28.23    5: std::panicking::begin_panic
 6:28.23    6: rustc_errors::Handler::span_bug
 6:28.24    7: rustc_mir::transform::type_check::TypeChecker::check_terminator
 6:28.24    8: rustc::infer::InferCtxtBuilder::enter
 6:28.24    9: <rustc_mir::transform::type_check::TypeckMir as rustc::mir::transform::MirPass<'tcx>>::run_pass
 6:28.24   10: <T as rustc::mir::transform::MirMapPass<'tcx>>::run_pass
 6:28.24   11: rustc::mir::transform::Passes::run_passes
 6:28.24   12: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}::{{closure}}
 6:28.24   13: rustc_driver::driver::phase_3_run_analysis_passes::{{closure}}
 6:28.24   14: rustc::ty::context::TyCtxt::create_and_enter
 6:28.24   15: rustc_driver::driver::phase_3_run_analysis_passes
 6:28.24   16: rustc_driver::driver::compile_input
 6:28.24   17: rustc_driver::run_compiler
 6:28.24   18: std::panicking::try::do_call
 6:28.24   19: __rust_maybe_catch_panic
 6:28.24              at /checkout/src/libpanic_unwind/lib.rs:98
 6:28.24   20: <F as alloc::boxed::FnBox<A>>::call_box
 6:28.24   21: std::sys::imp::thread::Thread::new::thread_start
 6:28.24              at /checkout/src/liballoc/boxed.rs:650
 6:28.24              at /checkout/src/libstd/sys_common/thread.rs:21
 6:28.24              at /checkout/src/libstd/sys/unix/thread.rs:84
 6:28.24   22: start_thread
 6:28.24   23: clone
 6:28.24 
 6:28.24 error: Could not compile `style`.
 6:28.24 
 6:28.24 To learn more, run the command again with --verbose.
 6:28.24 /home/giles/firefox/config/rules.mk:1020: recipe for target 'force-cargo-library-build' failed
 6:28.24 gmake[5]: *** [force-cargo-library-build] Error 101
 6:28.24 /home/giles/firefox/config/recurse.mk:73: recipe for target 'toolkit/library/rust/target' failed

This is yesterday's firefox master with --enable-stylo.

$ rustc --version --verbose
rustc 1.18.0-beta.2 (f4e8e81c3 2017-05-11)
binary: rustc
commit-hash: f4e8e81c34e7c378fc230b589623aaaf94bd17a7
commit-date: 2017-05-11
host: x86_64-unknown-linux-gnu
release: 1.18.0-beta.2
LLVM version: 3.9

See https://treeherder.mozilla.org/#/jobs?repo=try&revision=86ebd4aa3836&selectedJob=99289427 for a full build example.

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-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

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions