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

#[repr(align)] with no argument to align leads to ICE on Nightly/Beta. #85713

Closed
Chronos-Sk opened this issue May 26, 2021 · 15 comments
Closed
Assignees
Labels
C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Milestone

Comments

@Chronos-Sk
Copy link

Chronos-Sk commented May 26, 2021

Code

#[repr(align)]
pub struct Foo;

Meta

Version: 1.54.0-nightly (2021-05-25 ff2c947)

Found this on the Rust playground: reproducing link. Not sure how to get the verbose version output from the playground.

Error output

   Compiling playground v0.0.1 (/playground)
error: internal compiler error: unrecognized representation hint
 --> src/lib.rs:2:8
  |
2 | #[repr(align)]
  |        ^^^^^
  |
  = note: delayed at compiler/rustc_attr/src/builtin.rs:940:32

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1021:13
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.54.0-nightly (ff2c947c0 2021-05-25) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C codegen-units=1 -C debuginfo=2 --crate-type lib

note: some of the compiler flags provided by cargo are hidden

query stack during panic:
end of query stack
error: could not compile `playground`

To learn more, run the command again with --verbose.
Backtrace

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1021:13
stack backtrace:
   0: rust_begin_unwind
             at /rustc/ff2c947c00f867b9f012e28ba88cecfbe556f904/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/ff2c947c00f867b9f012e28ba88cecfbe556f904/library/std/src/panicking.rs:457:5
   2: rustc_errors::HandlerInner::flush_delayed
   3: <rustc_errors::HandlerInner as core::ops::drop::Drop>::drop
   4: core::ptr::drop_in_place<rustc_session::parse::ParseSess>
   5: <alloc::rc::Rc<T> as core::ops::drop::Drop>::drop
   6: core::ptr::drop_in_place<rustc_interface::interface::Compiler>
   7: rustc_span::with_source_map
   8: scoped_tls::ScopedKey<T>::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

@Chronos-Sk Chronos-Sk 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 May 26, 2021
@hellow554
Copy link
Contributor

Not sure how to get the verbose version output from the playground.

two possibilities:
tick backtrace enable:
grafik

or click that link (it does the same)
grafik

@hellow554
Copy link
Contributor

@rustbot modify labels: regression-from-stable-to-beta

@rustbot rustbot added regression-from-stable-to-beta Performance or correctness regression from stable to beta. I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 26, 2021
@hellow554
Copy link
Contributor

hellow554 commented May 26, 2021

Was introcuded by #81234 cc @repnop

Not sure why this was done: https://github.com/rust-lang/rust/pull/81234/files#diff-056d6eadf00f9575945a2e2b893636b990351ae149148579492a6a35c60d77a7L969-R940

@Mark-Simulacrum Mark-Simulacrum added this to the 1.53.0 milestone May 26, 2021
@apiraino
Copy link
Contributor

apiraino commented May 26, 2021

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

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-critical Critical priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels May 26, 2021
@LeSeulArtichaut LeSeulArtichaut self-assigned this May 26, 2021
@LeSeulArtichaut
Copy link
Contributor

cc @lcnr

@rustbot rustbot added the P-medium Medium priority label May 26, 2021
@LeSeulArtichaut LeSeulArtichaut removed the P-critical Critical priority label May 26, 2021
@jyn514
Copy link
Member

jyn514 commented May 26, 2021

@LeSeulArtichaut
Copy link
Contributor

Was introcuded by #81234 cc @repnop
Not sure why this was done: https://github.com/rust-lang/rust/pull/81234/files#diff-056d6eadf00f9575945a2e2b893636b990351ae149148579492a6a35c60d77a7L969-R940

Hmm, that should be caught here: https://github.com/rust-lang/rust/pull/81234/files#diff-77c442894af49f492927d99f7e60f4365a4829100c0c52f565f42dc184712c76R1222

Maybe check_attr isn't running on the attribute for some reason?

The diff you're pointing to is handling cases like

#[repr(foo)]
pub struct Foo;

@Chronos-Sk
Copy link
Author

Chronos-Sk commented May 28, 2021

Not sure how to get the verbose version output from the playground.

two possibilities:
tick backtrace enable:
grafik

or click that link (it does the same)
grafik

Is enabling the backtrace a sufficient substitute for rustc --version --verbose? That's the part of the ICE bug template I was having trouble with.

@LeSeulArtichaut LeSeulArtichaut removed their assignment Jun 1, 2021
@mibac138
Copy link
Contributor

mibac138 commented Jun 2, 2021

@rustbot claim

@estebank
Copy link
Contributor

estebank commented Jun 4, 2021

I'm happy to see #85976, but for beta backport we'll likely want a smaller PR or a revert of the PR introducing this issue.

fanninpm added a commit to fanninpm/glacier that referenced this issue Jun 4, 2021
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Jun 5, 2021
@Mark-Simulacrum Mark-Simulacrum modified the milestones: 1.53.0, 1.54.0 Jun 14, 2021
@Mark-Simulacrum
Copy link
Member

Moving milestone to 1.54 as we've included #86300 in 1.53 (via #86317).

bors added a commit to rust-lang-ci/rust that referenced this issue Jun 15, 2021
…imulacrum

[stable] 1.53.0 release

This includes a backport of:

* Revert "implement TrustedRandomAccess for Take iterator adapter" rust-lang#85975

And includes patches to:

* Update release notes to reflect rust-lang#85541
* Require RUSTC_FORCE_INCREMENTAL to truly enable incremental, fixing rust-lang#86004
* This reverts alignment-related commits to address issue rust-lang#85713 on beta.

r? `@Mark-Simulacrum`
@JohnTitor
Copy link
Member

Triage: Fixed by #87013, it has a regression test for this case, closing.

@Mark-Simulacrum
Copy link
Member

Reopening - that PR has not been backported to 1.54 (beta) yet.

@JohnTitor
Copy link
Member

We should mark #87013 as beta-nominated then.

@Mark-Simulacrum
Copy link
Member

#86413 already backported #81234 into 1.54 beta, so this is handled on 1.54 beta. Closing.

#87013 looks like a more invasive patch but seems good for 1.55.

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. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ P-medium Medium priority regression-from-stable-to-beta Performance or correctness regression from stable to beta. 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.