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

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

Open
matthiaskrgr opened this issue Aug 19, 2022 · 4 comments
Open

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

matthiaskrgr opened this issue Aug 19, 2022 · 4 comments
Assignees
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-sanitizers Area: Sanitizers for correctness and code quality. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ PG-exploit-mitigations Project group: Exploit mitigations T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@matthiaskrgr
Copy link
Member

matthiaskrgr commented Aug 19, 2022

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

@matthiaskrgr matthiaskrgr added A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. C-bug Category: This is a bug. labels Aug 19, 2022
@rust-lang-glacier-bot rust-lang-glacier-bot added the glacier ICE tracked in rust-lang/glacier. label Aug 22, 2022
@rcvalle
Copy link
Member

rcvalle commented Aug 27, 2022

@rustbot claim

@JohnTitor
Copy link
Member

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

@rustbot rustbot added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label May 5, 2023
@matthiaskrgr
Copy link
Member Author

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!

@matthiaskrgr matthiaskrgr removed the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Aug 9, 2023
@Jules-Bertholet
Copy link
Contributor

@rustbot label A-sanitizers

@rustbot rustbot added the A-sanitizers Area: Sanitizers for correctness and code quality. label Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-debuginfo Area: Debugging information in compiled programs (DWARF, PDB, etc.) A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-sanitizers Area: Sanitizers for correctness and code quality. C-bug Category: This is a bug. glacier ICE tracked in rust-lang/glacier. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ PG-exploit-mitigations Project group: Exploit mitigations 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

6 participants