Skip to content

LLVM ERROR: Broken module with -Cdebuginfo=2 -Zsanitizer=cfi -Clto #100783

Closed

Description

@matthiaskrgr

Code

./src/test/ui/issues/issue-27901.rs

// run-pass
trait Stream { type Item; }
impl<'a> Stream for &'a str { type Item = u8; }
fn f<'s>(s: &'s str) -> (&'s str, <&'s str as Stream>::Item) {
    (s, 42)
}

fn main() {
    let fx = f as for<'t> fn(&'t str) -> (&'t str, <&'t str as Stream>::Item);
    assert_eq!(fx("hi"), ("hi", 42));
}

Meta

rustc --version --verbose:

rustc 1.65.0-nightly (0b79f758c 2022-08-18)
binary: rustc
commit-hash: 0b79f758c9aa6646606662a6d623a0752286cd17
commit-date: 2022-08-18
host: x86_64-unknown-linux-gnu
release: 1.65.0-nightly
LLVM version: 15.0.0

Error output

rustc ./issue-27901.rs -Cdebuginfo=2 -Zsanitizer=cfi -Clto

inlinable function call in a function with debug info must have a !dbg location
  call void @_ZN11issue_279011f17h923e371f4763f6b8E.cfi(ptr sret({ { ptr, i64 }, i8, [7 x i8] }) %6, ptr align 1 @3, i64 2)
inlinable function call in a function with debug info must have a !dbg location
  call void @_ZN11issue_279011f17h923e371f4763f6b8E.cfi(ptr sret({ { ptr, i64 }, i8, [7 x i8] }) %6, ptr align 1 @3, i64 2)
LLVM ERROR: Broken module found, compilation aborted!
Backtrace

same

Activity

  1. added
    A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.
    A-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Aug 19, 2022
  2. added a commit that references this issue on Aug 21, 2022
  3. rcvalle commented on Aug 27, 2022

    @rcvalle
    Member

    @rustbot claim

  4. JohnTitor commented on May 5, 2023

    @JohnTitor
    Member

    Triage: This is no longer ICE since today's nightly.
    @rustbot labels: +E-needs-test

  5. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on May 5, 2023
  6. matthiaskrgr commented on Aug 9, 2023

    @matthiaskrgr
    MemberAuthor

    I think this is still reproducible:

    ./tests/ui/associated-types/associated-types-doubleendediterator-object.rs

    fn pairwise_sub(mut t: Box<dyn DoubleEndedIterator<Item=isize>>) -> isize {
        let mut result = 0;
        loop {
            let front = t.next();
            let back = t.next_back();
            match (front, back) {
                (Some(f), Some(b)) => { result += b - f; }
                _ => { return result; }
            }
        }
    }
    
    fn main() {
        let v = vec![1, 2, 3, 4, 5, 6];
        let r = pairwise_sub(Box::new(v.into_iter()));
        assert_eq!(r, 9);
    }

    rustc -Zsanitizer-cfi-normalize-integers -Clto -Zsanitizer=cfi -Ccodegen-units=1 -Cdebuginfo=2 -Copt-level=3 ./tests/ui/associated-types/associated-types-doubleendediterator-object.rs

    
    inlinable function call in a function with debug info must have a !dbg location
      %24 = tail call { i64, i64 } @"_ZN103_$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hf0fad4eb49ef37d8E"(ptr noundef nonnull align 1 %12)
    inlinable function call in a function with debug info must have a !dbg location
      %25 = tail call { i64, i64 } @"_ZN103_$LT$alloc..vec..into_iter..IntoIter$LT$T$C$A$GT$$u20$as$u20$core..iter..traits..iterator..Iterator$GT$4next17hf0fad4eb49ef37d8E"(ptr noundef nonnull align 1 %12)
    LLVM ERROR: Broken module found, compilation aborted!
    
  7. removed
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Aug 9, 2023
  8. Jules-Bertholet commented on Apr 8, 2024

    @Jules-Bertholet
    Contributor

    @rustbot label A-sanitizers

  9. added
    A-sanitizersArea: Sanitizers for correctness and code quality
    on Apr 8, 2024
  10. 1c3t3a commented on Nov 1, 2024

    @1c3t3a
    Member

    I am unable to reproduce this on latest nightly.

  11. added
    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.
    on Nov 1, 2024
  12. 1c3t3a commented on Nov 5, 2024

    @1c3t3a
    Member

    It seems like this is coming up again in #132615. The example here doesn't throw an error for me though.

  13. added a commit that references this issue on Nov 12, 2024
  14. added a commit that references this issue on Nov 13, 2024
  15. 1c3t3a commented on Nov 15, 2024

    @1c3t3a
    Member

    This can be closed as it was fixed in #132702.

  16. added a commit that references this issue on Jan 13, 2025
  17. Enselic commented on Oct 7, 2025

    @Enselic
    Member

    Triage: Your PR also added a test so yes, this can be closed. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.A-control-flow-integrityArea: Control Flow Integrity (CFI) security mitigationA-debuginfoArea: Debugging information in compiled programs (DWARF, PDB, etc.)A-sanitizersArea: Sanitizers for correctness and code qualityC-bugCategory: This is a bug.E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️PG-exploit-mitigationsProject group: Exploit mitigationsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.glacierICE tracked in rust-lang/glacier.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions