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

ICE: thread 'rustc' panicked at 'capacity overflow' #62554

Closed
dwrensha opened this issue Jul 10, 2019 · 2 comments · Fixed by #62638
Closed

ICE: thread 'rustc' panicked at 'capacity overflow' #62554

dwrensha opened this issue Jul 10, 2019 · 2 comments · Fixed by #62638
Assignees
Labels
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dwrensha
Copy link
Contributor

I'm seeing the following error on the nightly channel, but not on stable or beta:

$ echo "fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {" > main.rs

$ rustc main.rs
error: this file contains an un-closed delimiter
 --> main.rs:1:89
  |
1 | fn foo(u: u8) { if u8 macro_rules! u8 { (u6) => { fn uuuuuuuuuuu() { use s loo mod u8 {
  |               -                       -         -                  -                  - ^
  |               |                       |         |                  |                  |
  |               |                       |         |                  |                  un-closed delimiter
  |               |                       |         |                  un-closed delimiter
  |               |                       |         un-closed delimiter
  |               un-closed delimiter     un-closed delimiter

thread 'rustc' panicked at 'capacity overflow', src/liballoc/raw_vec.rs:748:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace.
error: aborting due to previous error


error: internal compiler error: unexpected panic

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.38.0-nightly (0b680cfce 2019-07-09) running on x86_64-apple-darwin

Found with the help of libfuzzer-sys.

@jonas-schievink jonas-schievink added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ I-nominated regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 10, 2019
@pnkfelix
Copy link
Member

triage: P-medium. Leaving nominated so that team double-checks that priority assignment.

@pnkfelix pnkfelix added E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc P-medium Medium priority I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. labels Jul 11, 2019
@estebank
Copy link
Contributor

estebank commented Jul 12, 2019

This is triggered here

let sugg = pprust::to_string(|s| {
use crate::print::pprust::INDENT_UNIT;
s.ibox(INDENT_UNIT);
s.bopen();
s.print_stmt(&stmt);
s.bclose_maybe_open(stmt.span, false)
});

It should be possible to use the span snippet instead.

I believe it was introduced in #62099

@estebank estebank self-assigned this Jul 12, 2019
bors added a commit that referenced this issue Jul 14, 2019
Use snippet instead of pprinting statement

Fix #62554.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-bisection Call for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustc I-compilemem Issue: Problems and improvements with respect to memory usage during compilation. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants