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

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

Closed
matthiaskrgr opened this issue Jul 28, 2023 · 1 comment
Assignees
Labels
C-bug Category: This is a bug. I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. PG-exploit-mitigations Project group: Exploit mitigations requires-nightly This issue requires a nightly compiler in some way. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

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!

@matthiaskrgr matthiaskrgr added I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. PG-exploit-mitigations Project group: Exploit mitigations labels Jul 28, 2023
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 28, 2023
@matthiaskrgr matthiaskrgr added the requires-nightly This issue requires a nightly compiler in some way. label Jul 28, 2023
@saethlin saethlin removed the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Jul 29, 2023
@rcvalle
Copy link
Member

rcvalle commented Aug 9, 2023

This seems to have been fixed in #113593.

@rcvalle rcvalle closed this as completed Aug 9, 2023
@rcvalle rcvalle self-assigned this Aug 9, 2023
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-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. PG-exploit-mitigations Project group: Exploit mitigations requires-nightly This issue requires a nightly compiler in some way. 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