Skip to content

ICE when compiling code #16800

Closed
Closed
@retep998

Description

@retep998

When compiling https://github.com/retep998/rustoban/tree/bcab8157692ff3c21cc8d63dc954a568cc968ff0
First I compiled using cargo and got

$ cargo build -v
     Running `rustc A:\msys64\home\retep998\rustoban\src\main.rs --crate-name rustoban --crate-type bin --out-dir A:\msys64\home\retep998\rustoban\target --dep-info A:\msys64\home\retep998\rustoban\target\.fingerprint\rustoban-012bcebb903b7931\dep-bin-rustoban -L A:\msys64\home\retep998\rustoban\target -L A:\msys64\home\retep998\rustoban\target\deps`
   Compiling rustoban v0.0.1 (file:///A:/msys64/home/retep998/rustoban)
A:\msys64\home\retep998\rustoban\src\level.rs:10:1: 10:57 warning: code is never used: `MAX_SIZE`, #[warn(dead_code)] on by default
A:\msys64\home\retep998\rustoban\src\level.rs:10 static MAX_SIZE: Size2D = Size2D{width: 80, height: 23};
                                                 ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
A:\msys64\home\retep998\rustoban\src\level.rs:13:5: 13:17 warning: code is never used: `size`, #[warn(dead_code)] on by default
A:\msys64\home\retep998\rustoban\src\level.rs:13     size: Size2D,
                                                     ^~~~~~~~~~~~
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 'unreachable', A:\msys64\home\retep998\rust\src\librustc\middle\trans\type_of.rs:218


Could not compile `rustoban`.

Caused by:
  Process didn't exit successfully: `rustc A:\msys64\home\retep998\rustoban\src\main.rs --crate-name rustoban --crate-type bin --out-dir A:\msys64\home\retep998\rustoban\target --dep-info A:\msys64\home\retep998\rustoban\target\.fingerprint\rustoban-012bcebb903b7931\dep-bin-rustoban -L A:\msys64\home\retep998\rustoban\target -L A:\msys64\home\retep998\rustoban\target\deps` (status=101)

So then I ran rustc from gdb to get a full stacktrace

$ gdb rustc
GNU gdb (GDB) 7.8
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from rustc...done.
(gdb) run src/main.rs
Starting program: A:\rust64\bin\rustc.exe src/main.rs
[New Thread 14968.0x1520]
[New Thread 14968.0x55bc]
src\level.rs:10:1: 10:57 warning: code is never used: `MAX_SIZE`, #[warn(dead_code)] on by default
src\level.rs:10 static MAX_SIZE: Size2D = Size2D{width: 80, height: 23};
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src\level.rs:13:5: 13:17 warning: code is never used: `size`, #[warn(dead_code)] on by default
src\level.rs:13     size: Size2D,
                    ^~~~~~~~~~~~

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 14968.0x55bc]
je_huge_salloc () at A:/msys64/home/retep998/rust/src/jemalloc/src/huge.c:193
193             ret = node->size;
(gdb) bt
#0  je_huge_salloc ()
    at A:/msys64/home/retep998/rust/src/jemalloc/src/huge.c:193
#1  0x00000000637d53a8 in je_isalloc ()
    at include/jemalloc/internal/jemalloc_internal.h:727
#2  je_dallocx ()
    at A:/msys64/home/retep998/rust/src/jemalloc/src/jemalloc.c:1771
#3  0x0000000061f369a5 in middle::trans::adt::mk_struct::haef641ecaeb9d3d7YNt
    () from A:\rust64\bin\rustc-4e7c5e5c.dll
#4  0x0000000061e141c0 in middle::trans::adt::represent_type::ha68319fbe6c0a90bimt () from A:\rust64\bin\rustc-4e7c5e5c.dll
#5  0x0000000061e1bc2d in middle::trans::type_of::sizing_type_of::hb8d66a4c8a93b724Ma9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#6  0x0000000061f36601 in middle::trans::adt::mk_struct::haef641ecaeb9d3d7YNt
    () from A:\rust64\bin\rustc-4e7c5e5c.dll
#7  0x0000000061e141c0 in middle::trans::adt::represent_type::ha68319fbe6c0a90bimt () from A:\rust64\bin\rustc-4e7c5e5c.dll
#8  0x0000000061e0e6d9 in middle::trans::type_of::type_of::h78d399b053e3623dIh9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#9  0x0000000061e0e6ae in middle::trans::type_of::type_of::h78d399b053e3623dIh9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#10 0x0000000061e0e2bf in middle::trans::type_of::type_of::h78d399b053e3623dIh9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#11 0x0000000061f39e74 in middle::trans::adt::struct_llfields::h206178ff796aa467zfu () from A:\rust64\bin\rustc-4e7c5e5c.dll
#12 0x0000000061e98581 in middle::trans::adt::finish_type_of::h05a7814766e4235211t () from A:\rust64\bin\rustc-4e7c5e5c.dll
#13 0x0000000061e0eb17 in middle::trans::type_of::type_of::h78d399b053e3623dIh9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#14 0x0000000061e0dec1 in middle::trans::type_of::type_of::h78d399b053e3623dIh9 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#15 0x0000000061e440e7 in middle::trans::base::alloc_ty::h018db85475642681mTd
    () from A:\rust64\bin\rustc-4e7c5e5c.dll
#16 0x0000000061eef781 in middle::trans::_match::mk_binding_alloca::h4969656315549397990 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#17 0x0000000061eb5ddb in middle::trans::_match::store_local::he1a21cfffa050be4A2h () from A:\rust64\bin\rustc-4e7c5e5c.dll
#18 0x0000000061e05b7b in middle::trans::base::init_local::he7cbcde5c1956afdWFd () from A:\rust64\bin\rustc-4e7c5e5c.dll
#19 0x0000000061e0508c in middle::trans::controlflow::trans_stmt::hac36615c99ac44fclhY () from A:\rust64\bin\rustc-4e7c5e5c.dll
#20 0x0000000061e0695d in middle::trans::controlflow::trans_block::h992f76f1deffb940wmY () from A:\rust64\bin\rustc-4e7c5e5c.dll
#21 0x0000000061ec0920 in middle::trans::base::trans_closure::h252b88d832aec661vye () from A:\rust64\bin\rustc-4e7c5e5c.dll
#22 0x0000000061df7113 in middle::trans::base::trans_fn::h739d4f2f94d4f049iKe
    () from A:\rust64\bin\rustc-4e7c5e5c.dll
#23 0x0000000061ec3167 in middle::trans::meth::trans_impl::h190f2654818d6d98i9j () from A:\rust64\bin\rustc-4e7c5e5c.dll
#24 0x0000000061df26ba in middle::trans::base::trans_item::h588143bd387a01d1i2e () from A:\rust64\bin\rustc-4e7c5e5c.dll
#25 0x0000000061df2390 in middle::trans::base::trans_item::h588143bd387a01d1i2e () from A:\rust64\bin\rustc-4e7c5e5c.dll
#26 0x0000000061eca30d in middle::trans::base::trans_crate::h41a261962f300c38JWf () from A:\rust64\bin\rustc-4e7c5e5c.dll
#27 0x00000000622a32ea in driver::driver::phase_4_translate_to_llvm::h8cf9745bc029f2a2Qyy () from A:\rust64\bin\rustc-4e7c5e5c.dll
#28 0x000000006229c78f in driver::driver::compile_input::he4e9a6195a5d54dchby
    () from A:\rust64\bin\rustc-4e7c5e5c.dll
#29 0x00000000623330d9 in driver::run_compiler::h71eecfc64ef3e541aIB ()
   from A:\rust64\bin\rustc-4e7c5e5c.dll
#30 0x00000000623317b5 in driver::main_args::closure.138287 ()
   from A:\rust64\bin\rustc-4e7c5e5c.dll
#31 0x0000000062343b02 in task::TaskBuilder$LT$S$GT$::try_future::closure.139405 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#32 0x00000000623439fc in task::TaskBuilder$LT$S$GT$::spawn_internal::closure.139382 () from A:\rust64\bin\rustc-4e7c5e5c.dll
#33 0x000000006374ee77 in task::spawn_opts::closure.8796 ()
   from A:\rust64\bin\native-4e7c5e5c.dll
#34 0x0000000063820d4f in rust_try_inner ()
   from A:\rust64\bin\rustrt-4e7c5e5c.dll
#35 0x0000000063820d29 in rust_try () from A:\rust64\bin\rustrt-4e7c5e5c.dll
#36 0x00000000637b5da6 in unwind::try::he51b9bde125c595fLOd ()
   from A:\rust64\bin\rustrt-4e7c5e5c.dll
#37 0x00000000637b5a7f in task::Task::run::h6502d549d95597afJbd ()
   from A:\rust64\bin\rustrt-4e7c5e5c.dll
#38 0x000000006374ecb0 in task::spawn_opts::closure.8742 ()
   from A:\rust64\bin\native-4e7c5e5c.dll
#39 0x00000000637b7bf1 in thread::thread_start::hc05d3a3e9c547ba5vAd ()
   from A:\rust64\bin\rustrt-4e7c5e5c.dll
#40 0x00007ffe53eb16ad in KERNEL32!BaseThreadInitThunk ()
   from C:\WINDOWS\system32\kernel32.dll
#41 0x00007ffe566934a5 in ntdll!RtlUserThreadStart ()
   from C:\WINDOWS\SYSTEM32\ntdll.dll
#42 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb)

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions