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 failed to process buffered lint here (dummy = false) introduced by #87146 #87274

Closed
rylev opened this issue Jul 19, 2021 · 3 comments
Closed
Assignees
Labels
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.

Comments

@rylev
Copy link
Member

rylev commented Jul 19, 2021

Code

It seems that #87146 introduced an ICE which happens when building the piston_image benchmark for rustc-perf.

The ICE seems to be caused by delay_span_bug being issues but no errors being encountered.

Panic message: "no errors encountered even though delay_span_bug issued"

Unfortunately, I've not been able to reproduce this with something smaller and more manageable yet.

cc @Aaron1011 @petrochenkov

Meta

Built using:

cargo +0ecff8c623fa29cccad6f946c657e81dacd85847 rustc -- -A warnings

Error output

error: internal compiler error: failed to process buffered lint here (dummy = false)
   --> src/tiff/decoder/mod.rs:383:10
    |
383 |         (try!(self.get_tag(tag))).as_u32_vec()
    |          ^^^
    |
    = note: delayed at /rustc/0ecff8c623fa29cccad6f946c657e81dacd85847/compiler/rustc_lint/src/early.rs:402:18

error: internal compiler error: failed to process buffered lint here (dummy = false)
   --> src/tiff/decoder/mod.rs:378:10
    |
378 |         (try!(self.get_tag(tag))).as_u32()
    |          ^^^
    |
    = note: delayed at /rustc/0ecff8c623fa29cccad6f946c657e81dacd85847/compiler/rustc_lint/src/early.rs:402:18

thread 'rustc' panicked at 'no errors encountered even though `delay_span_bug` issued', compiler/rustc_errors/src/lib.rs:1050: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.55.0-nightly (0ecff8c62 2021-07-19) running on x86_64-unknown-linux-gnu

note: compiler flags: -C embed-bitcode=no -C debuginfo=2 -C incremental --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 `image`
Backtrace

stack backtrace:
   0: rust_begin_unwind
             at /rustc/0ecff8c623fa29cccad6f946c657e81dacd85847/library/std/src/panicking.rs:515:5
   1: std::panicking::begin_panic_fmt
             at /rustc/0ecff8c623fa29cccad6f946c657e81dacd85847/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: rustc_interface::interface::create_compiler_and_run
   9: scoped_tls::ScopedKey<T>::set

@rylev rylev added 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. C-bug Category: This is a bug. labels Jul 19, 2021
@Aaron1011 Aaron1011 self-assigned this Jul 19, 2021
@lqd
Copy link
Member

lqd commented Jul 19, 2021

pub struct Value {}
impl Value {
    pub fn as_u32_vec(self) -> Result<Vec<u32>, Box<dyn std::error::Error>> {
        unimplemented!()
    }
}
pub struct TIFFDecoder {}
impl TIFFDecoder {
    fn get_tag(&mut self) -> Result<Value, Box<dyn std::error::Error>> {
        unimplemented!()
    }
    pub fn get_tag_u32_vec(&mut self) -> Result<Vec<u32>, Box<dyn std::error::Error>> {
        (try!(self.get_tag())).as_u32_vec()
    }
}

rustc +0ecff8c623fa29cccad6f946c657e81dacd85847 --crate-name image src/lib.rs --crate-type lib

@Aaron1011
Copy link
Member

Minimized:

fn foo() -> Result<(), String>  {
    (try!(Ok::<u8, String>(1)));
    Ok(())
}

fn main() {}

This is caused by a weird special-case for ExprKind::Paren that was added back in 2016: #34355. I'm working on a fix.

@hellow554
Copy link
Contributor

#87284 is merged, this can be closed. :)

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. 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.
Projects
None yet
Development

No branches or pull requests

4 participants