Skip to content

rust: task ran out of stack #1530

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

Closed
grahame opened this issue Jan 15, 2012 · 4 comments
Closed

rust: task ran out of stack #1530

grahame opened this issue Jan 15, 2012 · 4 comments

Comments

@grahame
Copy link
Contributor

grahame commented Jan 15, 2012

This program fails under rust as of rev 7e6ce66. 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()
{
}
@jdm
Copy link
Contributor

jdm commented Jan 15, 2012

This is probably #742.

@brson
Copy link
Contributor

brson commented Jan 15, 2012

rustc is hitting the arbitrary limit on maximum stack size. The best thing to do in the short term is probably to add core::sys::set_max_stack to set the global max stack size, and have rustc request a gigantic max stack size. I will do that today and close both these.

@ghost ghost assigned brson Jan 15, 2012
@brson
Copy link
Contributor

brson commented Jan 15, 2012

I should have looked closer. This is just rustc recurring infinitely - changing the max stack size won't help.

@brson brson closed this as completed Jan 15, 2012
@brson
Copy link
Contributor

brson commented Jan 15, 2012

I agree it's the same as #742. Closing as dupe.

celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
* Added workspace flag and tests.

* Added license, adjusted comments.

* Fixed docs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants