Skip to content

cfi: llvm error: inlinable function call in a function with debug info must have a !dbg location #114187

Closed
@matthiaskrgr

Description

@matthiaskrgr

Code

rustc -Zsanitizer=cfi -Clto --edition=2021 -Cdebuginfo=2 -Copt-level=2

use std::io::{self, Write};

fn f(wr: &mut dyn Write) {
    wr.write_all(b"hello").ok().expect("failed");
}

fn main() {
    let mut wr = Box::new(io::stdout()) as Box<dyn Write>;
    f(&mut wr);
}

Meta

rustc --version --verbose:

rustc 1.73.0-nightly (500647fd8 2023-07-27)
binary: rustc
commit-hash: 500647fd8138cc09e87edb08d62f81654fbf6ef8
commit-date: 2023-07-27
host: x86_64-unknown-linux-gnu
release: 1.73.0-nightly
LLVM version: 16.0.5

Error output

<output>
Backtrace

inlinable function call in a function with debug info must have a !dbg location
  %12 = invoke noundef ptr @"_ZN57_$LT$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$9write_all17h607695b79a9ca4b5E"(ptr noundef nonnull align 1 %6, ptr noalias noundef nonnull readonly align 1 @anon.dae3f8c0716a6eb28d61d069331568f8.6, i64 noundef 5)
          to label %13 unwind label %18
inlinable function call in a function with debug info must have a !dbg location
  %12 = invoke noundef ptr @"_ZN57_$LT$std..io..stdio..Stdout$u20$as$u20$std..io..Write$GT$9write_all17h607695b79a9ca4b5E"(ptr noundef nonnull align 1 %6, ptr noalias noundef nonnull readonly align 1 @anon.dae3f8c0716a6eb28d61d069331568f8.6, i64 noundef 5)
          to label %13 unwind label %18
LLVM ERROR: Broken module found, compilation aborted!

Metadata

Metadata

Assignees

Labels

C-bugCategory: This is a bug.I-crashIssue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics.PG-exploit-mitigationsProject group: Exploit mitigationsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.requires-nightlyThis issue requires a nightly compiler in some way.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions