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

ICE: stack overflow with instrument-coverage + gce #135060

Open
matthiaskrgr opened this issue Jan 3, 2025 · 1 comment
Open

ICE: stack overflow with instrument-coverage + gce #135060

matthiaskrgr opened this issue Jan 3, 2025 · 1 comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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.

Comments

@matthiaskrgr
Copy link
Member

auto-reduced (treereduce-rust):

//@compile-flags: -Cinstrument-coverage

#![feature(generic_const_exprs)]

struct GenericStruct<const T: usize> { val: i64 }

impl<const T: usize> From<GenericStruct<T>> for GenericStruct<{T + 1}> {
    fn from(other: GenericStruct<T>) -> Self {
        Self { val: other.val }
    }
}

impl<const T: usize> From<GenericStruct<{T + 1}>> for GenericStruct<T> {
    fn from(other: GenericStruct<{T + 1}>) -> Self {
        Self { val: other.val }
    }
}

pub fn main() {}

original:

#![feature(generic_const_exprs)]

struct GenericStruct<const T: usize> { val: i64 }

impl<const T: usize> From<GenericStruct<T>> for GenericStruct<{T + 1}> {
    fn from(other: GenericStruct<T>) -> Self {
        Self { val: other.val }
    }
}

impl<const T: usize> From<GenericStruct<{T + 1}>> for GenericStruct<T> {
    fn from(other: GenericStruct<{T + 1}>) -> Self {
        Self { val: other.val }
    }
}

pub fn main() {}

Version information

rustc 1.85.0-nightly (870c13dc9 2025-01-03)
binary: rustc
commit-hash: 870c13dc9b85944ceb172df54c7b1c615a46cb6e
commit-date: 2025-01-03
host: x86_64-unknown-linux-gnu
release: 1.85.0-nightly
LLVM version: 19.1.6

Command:
/home/matthias/.rustup/toolchains/master/bin/rustc -Cinstrument-coverage

Program output

warning: the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes
 --> a.rs:1:12
  |
1 | #![feature(generic_const_exprs)]
  |            ^^^^^^^^^^^^^^^^^^^
  |
  = note: see issue #76560 <https://github.com/rust-lang/rust/issues/76560> for more information
  = note: `#[warn(incomplete_features)]` on by default

error: rustc interrupted by SIGSEGV, printing backtrace

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x36683f3) [0x795f7a0683f3]
/usr/lib/libc.so.6(+0x3d1d0) [0x795f7684c1d0]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x57273a3) [0x795f7c1273a3]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x41b28d7) [0x795f7abb28d7]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x57273a8) [0x795f7c1273a8]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x5726b18) [0x795f7c126b18]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x525) [0x795f7abb7a95]

### cycle encountered after 7 frames with period 14
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x835) [0x795f7abb7da5]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer11print_const+0x7f9) [0x795f7abb98c9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x41ba59a) [0x795f7abba59a]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x89f) [0x795f7abb7e0f]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer10print_type+0x3ab) [0x795f7abb891b]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer15print_impl_path+0x4f9) [0x795f7abb83f9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x134) [0x795f7abb76a4]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x835) [0x795f7abb7da5]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer11print_const+0x7f9) [0x795f7abb98c9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x41ba59a) [0x795f7abba59a]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x89f) [0x795f7abb7e0f]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer10print_type+0x3ab) [0x795f7abb891b]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer15print_impl_path+0x4f9) [0x795f7abb83f9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x134) [0x795f7abb76a4]
### recursed 17 times

/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x835) [0x795f7abb7da5]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer11print_const+0x7f9) [0x795f7abb98c9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x41ba59a) [0x795f7abba59a]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x89f) [0x795f7abb7e0f]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer10print_type+0x3ab) [0x795f7abb891b]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer15print_impl_path+0x4f9) [0x795f7abb83f9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x134) [0x795f7abb76a4]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x835) [0x795f7abb7da5]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer11print_const+0x7f9) [0x795f7abb98c9]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(+0x41ba59a) [0x795f7abba59a]
/home/matthias/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/librustc_driver-78e18ca94582029e.so(_RNvXs_NtCs9IDk8BqyfS6_21rustc_symbol_mangling2v0NtB4_13SymbolManglerNtNtNtCseKm81Dn2gJ6_12rustc_middle2ty5print7Printer14print_def_path+0x89f) [0x795f7abb7e0f]

note: rustc unexpectedly overflowed its stack! this is a bug
note: maximum backtrace depth reached, frames may have been lost
note: we would appreciate a report at https://github.com/rust-lang/rust
help: you can increase rustc's stack size by setting RUST_MIN_STACK=16777216
note: backtrace dumped due to SIGSEGV! resuming signal
[1]    1549998 segmentation fault  rustc a.rs -Cinstrument-coverage

@rustbot label +F-generic_const_exprs

@matthiaskrgr matthiaskrgr added C-bug Category: This is a bug. 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. labels Jan 3, 2025
@rustbot rustbot added needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. F-generic_const_exprs `#![feature(generic_const_exprs)]` labels Jan 3, 2025
@matthiaskrgr matthiaskrgr added A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Jan 3, 2025
@matthiaskrgr
Copy link
Member Author

bisection points to #130485

@matthiaskrgr matthiaskrgr added F-generic_const_exprs `#![feature(generic_const_exprs)]` I-crash Issue: The compiler crashes (SIGSEGV, SIGABRT, etc). Use I-ICE instead when the compiler panics. and removed I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-code-coverage Area: Source-based code coverage (-Cinstrument-coverage) C-bug Category: This is a bug. F-generic_const_exprs `#![feature(generic_const_exprs)]` 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.
Projects
None yet
Development

No branches or pull requests

2 participants