mozilla/rust — Issue #1530: rust: task ran out of stack 
Author: grahame
Created: 2012-01-15 12:36:24+00:00
State: open

This program fails under rust as of rev 7e6ce6637e7. I've reduced it a bit, but not hugely - I the issue is the recursive reference to the state tag. I don't know if the program is valid (I've reduced it a lot too).

herugrim::~/code/csv $ RUST_LOG=rustc=0,::rt::backtrace rustc csv.rs
rust: task 7fbfa2417040 ran out of stack
0 librustrt.dylib 0x000000010716d1d3 _ZL7new_stkP14rust_schedulerP9rust_taskm + 1203
1 librustrt.dylib 0x000000010716d206 _ZN9rust_task9new_stackEmPvm + 50
2 librustrt.dylib 0x000000010716f675 upcall_s_new_stack + 37
3 librustrt.dylib 0x000000010717ea19 __morestack + 9
error: internal compiler error unexpected failure
note: The compiler hit an unexpected failure path. This is a bug. Try running with RUST_LOG=rustc=0,::rt::backtrace to get further details and report the results to github.com/mozilla/rust/issues
rust: upcall fail 'explicit failure', src/comp/driver/rustc.rs:175
0 librustrt.dylib 0x000000010717ea19 __morestack + 9
rust: domain main @0x7fbfa2818c00 root task failed
[1] 74836 exit 101 RUST_LOG=rustc=0,::rt::backtrace rustc csv.rs

Code:
tag state {
inescapedfield(uint, uint, bool, state);
}

type rowreader = {
mutable state : state
};

iface rowiter {
fn readrow();
}

impl of rowiter for rowreader {
fn readrow() {
alt self.state {
inescapedfield(b, o, at_start, last_state) {
}
}
}
}

fn main()
{
}