Skip to content

track_caller on panic_no_unwind leads to LLVM crash #94337

Closed
@Mark-Simulacrum

Description

@Mark-Simulacrum

#94290 is expecting to land having introduced #[cfg_attr(bootstrap, track_caller)] on panic_no_unwind in library/core/src/panicking.rs.

We saw these errors in stage 1 std compilation in CI (with track_caller and without it):

Incorrect number of arguments passed to called function!
  tail call void @_ZN4core9panicking15panic_no_unwind17heb5bd7bc5de639ecE(%"core::panic::location::Location"* bitcast (<{ i8*, [16 x i8] }>* @10 to %"core::panic::location::Location"*)) #15
in function _ZN12panic_unwind8real_imp5panic17exception_cleanup17h7b2c07bcac8db7c5E
LLVM ERROR: Broken function found, compilation aborted!
�[0m�[0m�[1m�[31merror�[0m�[1m:�[0m could not compile `panic_unwind`
�[0m�[0m�[1m�[33mwarning�[0m�[1m:�[0m build failed, waiting for other jobs to finish...
Incorrect number of arguments passed to called function!
  call void @_ZN4core9panicking15panic_no_unwind17heb5bd7bc5de639ecE(%"panic::location::Location"* bitcast (<{ i8*, [16 x i8] }>* @364 to %"panic::location::Location"*)) #26
in function _ZN4core9panicking15panic_no_unwind17heb5bd7bc5de639ecE
LLVM ERROR: Broken function found, compilation aborted!
Incorrect number of arguments passed to called function!
  call void @_ZN4core9panicking15panic_no_unwind17h8631ddd8246c176fE() #16
in function _ZN4core9panicking15panic_no_unwind17h8631ddd8246c176fE
LLVM ERROR: Broken function found, compilation aborted!

Locally, I'm not able to reproduce these (perhaps need to enable LLVM asserts or something), but I do see the following in stage 1 std compilation when building with track_caller.

error: failed to parse bitcode for LTO module: Invalid record (Producer: 'LLVM14.0.0-rust-1.61.0-nightly' Reader: 'LLVM 14.0.0-rust-1.61.0-nightly')

error: could not compile `core` due to previous error

cc @Amanieu @nbdd0121 -- seems plausible that something in #92911 is causing this

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-codegenArea: Code generationF-track_caller`#![feature(track_caller)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions