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

crash: "Out of stack space, sorry" with structural recursive type #742

Closed
elly opened this issue Jul 26, 2011 · 6 comments
Closed

crash: "Out of stack space, sorry" with structural recursive type #742

elly opened this issue Jul 26, 2011 · 6 comments
Labels
A-type-system Area: Type system I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.

Comments

@elly
Copy link
Contributor

elly commented Jul 26, 2011

The following program is sufficient to crash rustc:

tag expr {
        app(expr);
}

fn main() { }

This yields the following stack trace:

#0  0xf7fce5a1 in check_stack (task=0x87239e4) at ./src/rt/rust_upcall.cpp:30
#1  0xf7fce5d5 in upcall_get_type_desc (task=0x87239e4, curr_crate=0x0, size=12,
align=1, n_descs=2, 
    descs=0xf62a5da4) at ./src/rt/rust_upcall.cpp:528
#2  0xf7f6a5b5 in smallintmap::find () from /home/elly/a/rust/libstd.so
#3  0x0868bab2 in
middle::ast_map::new_smallintmap_adapter::adapter::method::find ()
#4  0x08133d85 in middle::ty::tag_variants ()
#5  0x08053180 in middle::trans::type_of_tag ()
#6  0x08051ec1 in middle::trans::type_of_inner ()
#7  0x08052a57 in middle::trans::type_of_inner ()
#8  0x08050b4a in middle::trans::type_of ()
#9  0x08053ad6 in middle::trans::type_of_tag ()
...
@graydon
Copy link
Contributor

graydon commented Jul 26, 2011

It's an infinite type; we didn't catch it. try app(@expr) or so.

Bug should remain open of course, since we should catch it nicely.

@ghost ghost assigned catamorphism Aug 4, 2011
@catamorphism
Copy link
Contributor

I just implemented the occurs check, so I'll look at this too.

@catamorphism
Copy link
Contributor

On second thought, I don't think checking this is going to be very similar to the occurs check, as it doesn't involve type variables. Also, I'm not very familiar with the code that typechecks tag declarations. So I'm going to work on other bugs for now.

@ghost ghost assigned msullivan Aug 31, 2011
@msullivan
Copy link
Contributor

This should be pretty easy to do using the type_structurally_contains function that marijn wrote recently. I'll take it.

@brson
Copy link
Contributor

brson commented Jan 15, 2012

For future searching purposes, the error displayed now is 'rust: task ran out of stack'

@brson
Copy link
Contributor

brson commented Jan 24, 2012

For future searching purposes, tag is now enum

keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Add asmjs/wasm32 to CI

Rebase of rust-lang#610 and also move emscripten up much higher in the hierarchy to
ensure that it doesn't have too much of a ripple effect on other platforms.

This involved moving down a good number of definitions, but hopefully was done
with care to not break anything!
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
Linux/Android: re-add initgroups

This was removed in rust-lang#742
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 26, 2020
ZuseZ4 pushed a commit to EnzymeAD/rust that referenced this issue Mar 7, 2023
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-type-system Area: Type system I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.
Projects
None yet
Development

No branches or pull requests

6 participants