Better error message when the compiler runs out of stack #6455
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
I-crash
Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Hi,
I am new to rust and was trying to write a simple program when I ran into this failure. The failure message with backtrace enabled is as follows :
RUST_LOG=rustc=1,::rt::backtrace rustc list.rs
rust: task 7f8a7b415f20 ran out of stack
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug
note: try running with RUST_LOG=rustc=1,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: task failed at 'explicit failure', /private/tmp/rust-xCH0/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7f8a7b815e10 root task failed
The source code that gets the compiler to fail is pasted below. I realize that I made a mistake by not making the "next" field an owned pointer in the structure below. Correcting this by making "next" an owned pointer using
Option<~Node>
fixes the problem.Is this expected ? Can the compiler instead catch such mistakes instead of running out of stack.
Thanks,
Madhu
The text was updated successfully, but these errors were encountered: