Skip to content

Clippy crash (version 1.59 on macOS) #8470

Closed
@printfn

Description

@printfn

Summary

Trying to run cargo clippy (version 1.59, macOS 12.2.1, x64) on a fresh checkout of https://github.com/printfn/fend (commit 3a392e50d45d5dce70bcdde9e22961517b895093) crashes inconsistently: after running the command 10 times (with cargo clean inbetween), it crashed exactly 5 times. It didn't used to crash on Rust 1.58.1. I have not been able to reproduce this on Linux.

The message that appears looks like this:

$ git clone git@github.com:printfn/fend.git
$ cd fend
$ cargo clippy
...
error: could not compile `fend-core`

Caused by:
  process didn't exit successfully: `/Users/printfn/.rustup/toolchains/stable-x86_64-apple-darwin/bin/clippy-driver rustc --crate-name fend_core --edition=2021 core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' -C metadata=b3e47eda875b4189 -C extra-filename=-b3e47eda875b4189 --out-dir /Users/printfn/Code/fend-copy/target/debug/deps -C incremental=/Users/printfn/Code/fend-copy/target/debug/incremental -L dependency=/Users/printfn/Code/fend-copy/target/debug/deps` (signal: 6, SIGABRT: process abort signal)
warning: build failed, waiting for other jobs to finish...
error: build failed

When I tried rerunning just the clippy-driver command that failed, I got this output:

$ /Users/printfn/.rustup/toolchains/stable-x86_64-apple-darwin/bin/clippy-driver rustc --crate-name fend_core --edition=2021 core/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 --cfg 'feature="default"' -C metadata=b3e47eda875b4189 -C extra-filename=-b3e47eda875b4189 --out-dir /Users/printfn/Code/fend-copy/target/debug/deps -C incremental=/Users/printfn/Code/fend-copy/target/debug/incremental -L dependency=/Users/printfn/Code/fend-copy/target/debug/deps
clippy-driver(17833,0x70001050a000) malloc: *** error for object 0x60000372a200: pointer being realloc'd was not allocated
clippy-driver(17833,0x70001050a000) malloc: *** set a breakpoint in malloc_error_break to debug
zsh: abort      /Users/printfn/.rustup/toolchains/stable-x86_64-apple-darwin/bin/clippy-drive

Reproducer

I tried this code: see above

I expected to see this happen: clippy runs correctly without crashing

Instead, this happened: clippy crashed

Version

rustc 1.59.0 (9d1b2106e 2022-02-23)
binary: rustc
commit-hash: 9d1b2106e23b1abd32fce1f17267604a5102f57a
commit-date: 2022-02-23
host: x86_64-apple-darwin
release: 1.59.0
LLVM version: 13.0.0

Additional Labels

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: Clippy is not doing the correct thingI-ICEIssue: Clippy panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions