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

[ICE] assertion failed: (left == right) && (right == left) (left: 11, right: 0) #16763

Closed
Bastacyclop opened this issue Aug 26, 2014 · 11 comments
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@Bastacyclop
Copy link

I have no idea where is the problem coming from, so I have no minimal example.
It happened with a Box2D binding I'm currently working on.
The binding is compiling fine but not the example:

[basta@manjaro rust_box2d]$ RUST_BACKTRACE=1 cargo test
unused manifest key: package.license
   Compiling rust_box2d v0.2.0 (file:///home/basta/Projects/rust_box2d)
/home/basta/Projects/rust_box2d/examples/example.rs:5:10: 5:15 warning: unused import, #[warn(unused_imports)] on by default
/home/basta/Projects/rust_box2d/examples/example.rs:5 use b2::{Owned, Ref, RefMut};
                                                               ^~~~~
/home/basta/Projects/rust_box2d/examples/example.rs:5:17: 5:20 warning: unused import, #[warn(unused_imports)] on by default
/home/basta/Projects/rust_box2d/examples/example.rs:5 use b2::{Owned, Ref, RefMut};
                                                                      ^~~
/home/basta/Projects/rust_box2d/examples/example.rs:5:22: 5:28 warning: unused import, #[warn(unused_imports)] on by default
/home/basta/Projects/rust_box2d/examples/example.rs:5 use b2::{Owned, Ref, RefMut};
                                                                           ^~~~~~
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'assertion failed: `(left == right) && (right == left)` (left: `11`, right: `0`)', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/librustc/middle/trans/base.rs:517

stack backtrace:
   1:     0x7f2ce9982770 - rt::backtrace::imp::write::h8cd99dff1e402ef9UZq
   2:     0x7f2ce9985920 - failure::on_fail::ha41409a33267b3c2Blr
   3:     0x7f2cea150510 - unwind::begin_unwind_inner::h8c1fbf5424a0d801Zie
   4:     0x7f2cea150210 - unwind::begin_unwind_fmt::h7d1a8b26e8f4f235pge
   5:     0x7f2cea8f3bf0 - middle::trans::base::get_res_dtor::haffd43b5c98b1ff2fvb
   6:     0x7f2cea8f38b0 - middle::trans::glue::trans_struct_drop::ha623b901491bd7beDVY
   7:     0x7f2cea8f3840 - middle::trans::glue::trans_struct_drop_flag::closure.114447
   8:     0x7f2cea8f3630 - middle::trans::base::with_cond::h5f39b86e2535fff7Bnc
   9:     0x7f2cea8f1470 - middle::trans::glue::make_drop_glue::as_closure.114413
  10:     0x7f2cea8f0450 - middle::trans::glue::make_generic_glue::h3252634c1ae5afcenoZ
  11:     0x7f2cea8eeaf0 - middle::trans::glue::get_drop_glue::h8f3e6346e22e028dDLY
  12:     0x7f2cea8ee9d0 - middle::trans::glue::drop_ty::haf109e2809857511hJY
  13:     0x7f2cea9fe920 - middle::trans::cleanup::DropValue.Cleanup::trans::h59af69c9d899b958Fpw
  14:     0x7f2cea9fc0f0 - middle::trans::cleanup::FunctionContext<'a>.CleanupHelperMethods<'a>::trans_cleanups_to_exit_scope::h0a28401680f9217b3Uv
  15:     0x7f2cea9ffe80 - middle::trans::cleanup::FunctionContext<'a>.CleanupHelperMethods<'a>::get_or_create_landing_pad::h5f72f4eb3dad1f31Tbw
  16:     0x7f2cea978720 - middle::trans::cleanup::FunctionContext<'a>.CleanupMethods<'a>::get_landing_pad::h915a0bc2fa152c11PHv
  17:     0x7f2cea8f5430 - middle::trans::base::invoke::h835930d70a255d9bC2b
  18:     0x7f2cea8e2410 - middle::trans::callee::trans_call_inner::hd5b053a59a029edbhZ0
  19:     0x7f2cea924960 - middle::trans::expr::trans_overloaded_op::h2c12d4646782278f7O3
  20:     0x7f2cea92ff20 - middle::trans::expr::deref_once::h89a80c5bee3ba998ih4
  21:     0x7f2cea8da700 - middle::trans::expr::trans::h9fde924695247345yP1
  22:     0x7f2cea90ffe0 - middle::trans::callee::trans_args::h94aa490682ec9488ek1
  23:     0x7f2cea8e2410 - middle::trans::callee::trans_call_inner::hd5b053a59a029edbhZ0
  24:     0x7f2cea90ab00 - middle::trans::callee::trans_method_call::h09857d1ff4ef116cvU0
  25:     0x7f2cea9184f0 - middle::trans::expr::trans_rvalue_dps_unadjusted::hf838e4d6ac48b5a0gG2
  26:     0x7f2cea8d8ff0 - middle::trans::expr::trans_into::h649653a95c0f1ba5CL1
  27:     0x7f2cea9184f0 - middle::trans::expr::trans_rvalue_dps_unadjusted::hf838e4d6ac48b5a0gG2
  28:     0x7f2cea917700 - middle::trans::expr::trans_unadjusted::hc3387fb48b9faca2781
  29:     0x7f2cea8da700 - middle::trans::expr::trans::h9fde924695247345yP1
  30:     0x7f2cea8d8eb0 - middle::trans::expr::trans_to_lvalue::h275612bee7c33b29971
  31:     0x7f2cea922c80 - middle::trans::expr::trans_addr_of::hb328313e7153cbaa6w3
  32:     0x7f2cea917700 - middle::trans::expr::trans_unadjusted::hc3387fb48b9faca2781
  33:     0x7f2cea8d8ff0 - middle::trans::expr::trans_into::h649653a95c0f1ba5CL1
  34:     0x7f2cea92b310 - middle::trans::expr::trans_adt::hda12d7a3d0f04bafBg3
  35:     0x7f2cea9184f0 - middle::trans::expr::trans_rvalue_dps_unadjusted::hf838e4d6ac48b5a0gG2
  36:     0x7f2cea917700 - middle::trans::expr::trans_unadjusted::hc3387fb48b9faca2781
  37:     0x7f2cea8da700 - middle::trans::expr::trans::h9fde924695247345yP1
  38:     0x7f2cea8d8eb0 - middle::trans::expr::trans_to_lvalue::h275612bee7c33b29971
  39:     0x7f2cea9299d0 - middle::trans::_match::trans_match::h288aefea821abbe87tg
  40:     0x7f2cea9184f0 - middle::trans::expr::trans_rvalue_dps_unadjusted::hf838e4d6ac48b5a0gG2
  41:     0x7f2cea8d8ff0 - middle::trans::expr::trans_into::h649653a95c0f1ba5CL1
  42:     0x7f2cea8d9580 - middle::trans::controlflow::trans_block::h64bf3c764c6ae1b0g4X
  43:     0x7f2cea9184f0 - middle::trans::expr::trans_rvalue_dps_unadjusted::hf838e4d6ac48b5a0gG2
  44:     0x7f2cea8d8ff0 - middle::trans::expr::trans_into::h649653a95c0f1ba5CL1
  45:     0x7f2cea8d84f0 - middle::trans::controlflow::trans_stmt_semi::ha1fb99ce3edb0c48m3X
  46:     0x7f2cea8d7c20 - middle::trans::controlflow::trans_stmt::h2f04ce0d083156615YX
  47:     0x7f2cea8d9580 - middle::trans::controlflow::trans_block::h64bf3c764c6ae1b0g4X
  48:     0x7f2cea981580 - middle::trans::base::trans_closure::h98df0502771bceb0Pcd
  49:     0x7f2cea8cad10 - middle::trans::base::trans_fn::h9827ee2f1991a21dCod
  50:     0x7f2cea8c6300 - middle::trans::base::trans_item::h6eac98275cebe034CGd
  51:     0x7f2cea98bc10 - middle::trans::base::trans_crate::h5cb30c85f982b3b7cBe
  52:     0x7f2cead51570 - driver::driver::phase_4_translate_to_llvm::h7a29ae2a079bac6cf6w
  53:     0x7f2cead48850 - driver::driver::compile_input::h4c4e2d8a00ea2981GIw
  54:     0x7f2ceaddc920 - driver::run_compiler::h5959ab20bfeb7861zfA
  55:     0x7f2ceaddc830 - driver::main_args::closure.137251
  56:     0x7f2ceadee700 - task::TaskBuilder<S>::try_future::closure.138371
  57:     0x7f2ceadee500 - task::TaskBuilder<S>::spawn_internal::closure.138348
  58:     0x7f2ceb8125f0 - task::spawn_opts::closure.8365
  59:     0x7f2cea1a8a90 - rust_try_inner
  60:     0x7f2cea1a8a80 - rust_try
  61:     0x7f2cea14db80 - unwind::try::hcf2c1555445335c8f7d
  62:     0x7f2cea14d920 - task::Task::run::h03e40729a1df1ac2zdd
  63:     0x7f2ceb8123b0 - task::spawn_opts::closure.8311
  64:     0x7f2cea14f760 - thread::thread_start::h194d23d584ee3229lCd
  65:     0x7f2ce941a060 - start_thread
  66:     0x7f2ce9e1d489 - __clone
  67:                0x0 - <unknown>

Could not compile `rust_box2d`.

To learn more, run the command again with --verbose.

The source code is here.
The library code is in the same repository.

The only hint I have is that my previous version doesn't have this problem.

The main thing I changed between those versions is that instead of using T, TPtr<'l> and TMutPtr<'l> objects I introduced Owned<T>, Ref<'l, T> and RefMut<'l, T> objects. So probably the problem is related to these objects, which code is located at the library main file.

Edit: the project is now hosted on https://github.com/Bastacyclop/rust_box2d

@tupshin
Copy link

tupshin commented Feb 7, 2015

I just got this exact same error on the latest nightly. Only material difference was that it's now line 517 of base.rs

stack backtrace:
   1:     0x7f168dd7d240 - sys::backtrace::write::h2d5b774b42a611774sy
   2:     0x7f168dda0940 - failure::on_fail::h0eb07a9d41d28278YWF
   3:     0x7f168dd007c0 - rt::unwind::begin_unwind_inner::ha069250519e26ab8vBF
   4:     0x7f168dd012d0 - rt::unwind::begin_unwind_fmt::h9f78c298dbf494751zF
   5:     0x7f168ca1d1d0 - trans::glue::trans_struct_drop::h9466bdc3f9700c551Oe
   6:     0x7f168ca1a260 - trans::glue::trans_struct_drop_flag::h53f57a0615513e0d2Me
   7:     0x7f168ca11dd0 - trans::glue::get_drop_glue::hdbf820817aebde49RHe
   8:     0x7f168ca11ad0 - trans::glue::drop_ty::hd6a4f4d0316c3ae28De
   9:     0x7f168cb48740 - trans::cleanup::DropValue<'tcx>.Cleanup<'tcx>::trans::h3d0e4bca022963da59L
  10:     0x7f168ca25e50 - trans::cleanup::FunctionContext<'blk, 'tcx>.CleanupMethods<'blk, 'tcx>::pop_and_trans_custom_cleanup_scope::h21d0ccfe42e4e080tbL
  11:     0x7f168cad4260 - trans::base::trans_closure::hd51332b4b14ebe7dW5t
  12:     0x7f168c9f61f0 - trans::base::trans_fn::h746e9efbc2b14f5b6gu
  13:     0x7f168c9f6750 - trans::monomorphize::monomorphic_fn::h823f1e98b4e6e83aQwd
  14:     0x7f168ca36df0 - trans::callee::trans_fn_ref_with_substs::hbe01e94c86fab1c8Hyg
  15:     0x7f168ca354d0 - trans::meth::trans_static_method_callee::h09f1ec79e37540b3y0y
  16:     0x7f168ca32260 - trans::callee::trans::hbc42ee6c50b5706dvbg
  17:     0x7f168ca49bd0 - trans::callee::trans_call_inner::h9042099031439240329
  18:     0x7f168ca52290 - trans::expr::trans_rvalue_dps_unadjusted::h13e0f4c2f7eed4fbrUi
  19:     0x7f168ca516a0 - trans::expr::trans_unadjusted::hebcf330aa76000bd3li
  20:     0x7f168ca0a890 - trans::expr::trans::hd2f453f3aad5f5202Dh
  21:     0x7f168caf13c0 - trans::_match::trans_match_inner::h25d04caf88e64d1bStx
  22:     0x7f168ca52290 - trans::expr::trans_rvalue_dps_unadjusted::h13e0f4c2f7eed4fbrUi
  23:     0x7f168ca09700 - trans::expr::trans_into::hded554efed2359ffyAh
  24:     0x7f168ca08ba0 - trans::controlflow::trans_stmt_semi::hdedd5d5900214185T9d
  25:     0x7f168ca09d10 - trans::controlflow::trans_block::h7c59eb740e387008Kae
  26:     0x7f168cad4260 - trans::base::trans_closure::hd51332b4b14ebe7dW5t
  27:     0x7f168c9f61f0 - trans::base::trans_fn::h746e9efbc2b14f5b6gu
  28:     0x7f168c9f12d0 - trans::base::trans_item::h8616676269d63cd8xFu
  29:     0x7f168cadb430 - trans::base::trans_crate::he650edc239d6aefahCv
  30:     0x7f168e37cbd0 - driver::phase_4_translate_to_llvm::h7647c8286ab427432Oa
  31:     0x7f168e355a80 - driver::compile_input::hc24e252c6a9debbbCba
  32:     0x7f168e427c00 - run_compiler::h07afdfea03e574126ac
  33:     0x7f168e426290 - thunk::F.Invoke<A, R>::invoke::h7167023940119686520
  34:     0x7f168e4251c0 - rt::unwind::try::try_fn::h7099284992991867290
  35:     0x7f168de0ca80 - rust_try_inner
  36:     0x7f168de0ca70 - rust_try
  37:     0x7f168e425470 - thunk::F.Invoke<A, R>::invoke::h7565834387748213469
  38:     0x7f168dd8ce30 - sys::thread::thread_start::h7df8ddcb97714d51VCB
  39:     0x7f1687dd90c0 - start_thread
  40:     0x7f168d97cfd9 - __clone
  41:                0x0 - <unknown>

@tamird
Copy link
Contributor

tamird commented Apr 22, 2015

@tupshin how does one reproduce this? https://gitlab.com/Bastacyclop/rust_box2d at cbc7aa25707532de40e1c0f98107f2b6753346c3 no longer works with current cargo because it uses a build script written in shell, and cargo expects rust.

@Bastacyclop
Copy link
Author

@tamird I just made a quick update for rust nightly, however I still use the workaround I found around the ICE. So if you really want to try to reproduce this, I'd say putting back the incriminated structure on top of this update should do the trick. I believe this commit sums up what you'd have to restore.

@tamird
Copy link
Contributor

tamird commented Apr 23, 2015

@Bastacyclop could you try it? This issue is pretty stale; I'm reluctant to reapply an old patch to code that has now drifted this much.

@Bastacyclop
Copy link
Author

@tamird I can, but I'll take my time

@skade
Copy link
Contributor

skade commented Oct 26, 2015

@Bastacyclop The source code you link to is not public/not available anymore.

@Bastacyclop
Copy link
Author

@skade Sorry, I moved the project to github and hid the old repository, it should be fixed.

@skade
Copy link
Contributor

skade commented Oct 26, 2015

@Bastacyclop Thank you 👍

@steveklabnik
Copy link
Member

It's been a very long time, are you still seeing this ICE? I can't build your project as I don't have the wrapper installed.

@Bastacyclop
Copy link
Author

@steveklabnik I rewrote the code in a different way to avoid the ICE at the time and did not look back. I don't think it's worthwhile to try to reproduce this anymore.

@steveklabnik
Copy link
Member

Cool, let's close.

Future readers: if you can reproduce this, please let me know!

matthiaskrgr pushed a commit to matthiaskrgr/rust that referenced this issue Mar 10, 2024
Add `fn index()` and `fn parent_fn()` accessors for `hir::Param`/`hir::SelfParam`

(the PR is motivated by an outside use of the `ra_ap_hir` crate that would benefit from being able to access a `hir::Param`'s/`hir::SelfParam`'s index and parent function)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants