Skip to content

Lintcheck never reports ICEs #12185

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

Closed
y21 opened this issue Jan 21, 2024 · 2 comments · Fixed by #12439
Closed

Lintcheck never reports ICEs #12185

y21 opened this issue Jan 21, 2024 · 2 comments · Fixed by #12439
Assignees
Labels
C-bug Category: Clippy is not doing the correct thing

Comments

@y21
Copy link
Member

y21 commented Jan 21, 2024

Description

The log file that lintcheck creates after a run has an ### ICE section at the end. However, I've never actually seen any entries in there.
To confirm this, I added a panic!(); to some random check_expr function and it indeed doesn't report them.
It does however print WARNING: bad exit status after checking ..., which I've seen many times but have always ignored because I wasn't sure what that's about, but I suspect that that's the ICE.

Version

99423e8

Additional Labels

@rustbot label +C-bug

@rustbot rustbot added the C-bug Category: Clippy is not doing the correct thing label Jan 21, 2024
@Jacherr
Copy link
Contributor

Jacherr commented Mar 8, 2024

@rustbot claim

@Jacherr
Copy link
Contributor

Jacherr commented Mar 8, 2024

After doing some digging around in the lintcheck code, I've boiled this down to the following issues:

  • Lintcheck collects information from stdout in JSON format about what Clippy reported for a particular crate (https://github.com/rust-lang/rust-clippy/blob/master/lintcheck/src/main.rs#L431-L436). However, ICEs are not sent to stdout, but to stderr, which is not used for this purpose.
  • ICEs are not reported in JSON format (and I'm not sure it's possible to report them as such). As a result, it is not possible to parse them using Message::parse_stream(...) the same way stdout is parsed.
  • There is the potential to manually check for ICEs in stderr through string matching (i.e., stdout.contains("panicked at")) - however, constructing a ClippyWarning from this is not possible due to Diagnostics being marked #[non_exhaustive]. We would need to first convert them to a JSON format and deserialize them from that.
  • Lastly, it's not possible to return the ICEs without first turning them into a diagnostic, because the run_clippy_lints function only returns a Vec<ClippyWarning> which is the output of the parsed stream (https://github.com/rust-lang/rust-clippy/blob/master/lintcheck/src/main.rs#L314).

Either we need to rethink how ICEs are detected in lintcheck entirely, or somehow convert them to a format that can be parsed into a ClippyWarning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Clippy is not doing the correct thing
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants