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

Stack exhaustion with bodyless mod statement that matches filename #5711

Closed
kimhyunkang opened this issue Apr 4, 2013 · 5 comments
Closed
Labels
A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@kimhyunkang
Copy link

While I was playing with the new rustc 0.6, I encountered an internal compiler error

~/project/protobuf-rust(master) > RUST_LOG=rustc=1,::rt::backtrace rustc protobuf.rs --test -o protobuf-tests
rust: task 7fbd705018b0 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', /Users/kimhyunkang/usr/pkgs/rust-0.6/src/librustc/rustc.rc:357
rust: domain main @0x7fbd70819410 root task failed

The source code is here: https://gist.github.com/kimhyunkang/5307274

Compiler version is 0.6, built with gcc, on OS X 10.7.5

~/project/protobuf-rust(master) > rustc --version
rustc 0.6
host: x86_64-apple-darwin
~/project/protobuf-rust(master) > gcc --version
i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2336.1.00)
Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@jdm
Copy link
Contributor

jdm commented Apr 4, 2013

If you run rustc under gdb and break on rust_task_fail, could you paste the backtrace here?

@kimhyunkang
Copy link
Author

OK. Here is the backtrace: https://gist.github.com/kimhyunkang/5307684

@jdm
Copy link
Contributor

jdm commented Apr 4, 2013

Looks like stack exhaustion to me. What happens if you remove mod protobuf?

@kimhyunkang
Copy link
Author

The code compiles with no problem when I wrap the rest of the code with mod block. Like:

mod protobuf {
    ...
}

@catamorphism
Copy link
Contributor

This yields a proper error message now; closing.

flip1995 pushed a commit to flip1995/rust that referenced this issue Jun 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

3 participants