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

thread 'rustc' panicked at 'Stack should be empty: final_buf=FrameData ...' #87793

Closed
dwrensha opened this issue Aug 5, 2021 · 4 comments
Closed
Assignees
Labels
A-attributes Area: #[attributes(..)] A-parser Area: The parsing of Rust source code to an AST. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dwrensha
Copy link
Contributor

dwrensha commented Aug 5, 2021

On nightly, I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

fn m(){#[c=[r
e
e
rustc output
$ rustc bug.rs
error: this file contains an unclosed delimiter
 --> bug.rs:3:2
  |
1 | fn m(){#[c=[r
  |       - -  - unclosed delimiter
  |       | |
  |       | unclosed delimiter
  |       unclosed delimiter
2 | e
3 | e
  |  ^

error: expected `;`, found `e`
 --> bug.rs:1:14
  |
1 | fn m(){#[c=[r
  |              ^ help: add `;` here
2 | e
  | - unexpected token

error: expected `;`, found `e`
 --> bug.rs:2:2
  |
2 | e
  |  ^ help: add `;` here
3 | e
  | - unexpected token

error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, `}`, or an operator, found `]`
 --> bug.rs:3:2
  |
1 | fn m(){#[c=[r
  |       - unclosed delimiter
2 | e
3 | e
  |  ^
  |  |
  |  expected one of 8 possible tokens
  |  help: `}` may belong here

error[E0658]: attributes on expressions are experimental
 --> bug.rs:1:8
  |
1 | fn m(){#[c=[r
  |        ^^^^^^
  |
  = note: see issue #15701 <https://github.com/rust-lang/rust/issues/15701> for more information
  = help: add `#![feature(stmt_expr_attributes)]` to the crate attributes to enable

error: unexpected token: `[r]`
 --> bug.rs:1:12
  |
1 | fn m(){#[c=[r
  |            ^^

error: cannot find attribute `c` in this scope
 --> bug.rs:1:10
  |
1 | fn m(){#[c=[r
  |          ^

error[E0425]: cannot find value `e` in this scope
 --> bug.rs:2:1
  |
2 | e
  | ^ not found in this scope

error[E0425]: cannot find value `r` in this scope
 --> bug.rs:1:13
  |
1 | fn m(){#[c=[r
  |             ^ not found in this scope

thread 'rustc' panicked at 'Stack should be empty: final_buf=FrameData { open: bug.rs:1:12: 1:13 (#0), open_delim: Bracket, inner: [(Token(Token { kind: Ident("r", false), span: bug.rs:1:13: 1:14 (#0) }), Alone)] } stack=[FrameData { open: no-location (#0), open_delim: NoDelim, inner: [] }]', compiler/rustc_parse/src/parser/attr_wrapper.rs:501:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

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/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.56.0-nightly (25b764849 2021-08-04) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 9 previous errors

Some errors have detailed explanations: E0425, E0658.
For more information about an error, try `rustc --explain E0425`.
@dwrensha dwrensha added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Aug 5, 2021
@dwrensha
Copy link
Contributor Author

dwrensha commented Aug 5, 2021

searched nightlies: from nightly-2021-02-10 to nightly-2021-08-04
regressed nightly: nightly-2021-07-28
searched commits: from 08095fc to 2faabf5
regressed commit: 8bebfe5

bisected with cargo-bisect-rustc v0.6.0

Host triple: x86_64-unknown-linux-gnu
Reproduce with:

cargo bisect-rustc --start=2021-2-10 --end=2021-08-04 --regress ice 

@dwrensha
Copy link
Contributor Author

dwrensha commented Aug 5, 2021

It looks to me like the regression was introduced in this pull request: #87436
cc @ebobrow

@jonas-schievink jonas-schievink added A-attributes Area: #[attributes(..)] A-parser Area: The parsing of Rust source code to an AST. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 5, 2021
@Aaron1011 Aaron1011 self-assigned this Aug 5, 2021
@apiraino
Copy link
Contributor

Assigning priority as discussed in the Zulip thread of the Prioritization Working Group.

@rustbot label -I-prioritize +P-low

@rustbot rustbot added P-low Low priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Aug 12, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Aug 12, 2021
@Alexendoo
Copy link
Member

No longer ICEs since #96546

@Alexendoo Alexendoo added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label May 5, 2022
@dwrensha dwrensha closed this as completed May 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-attributes Area: #[attributes(..)] A-parser Area: The parsing of Rust source code to an AST. C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-low Low priority T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

7 participants