Skip to content

non-fatal overflow during monomorphization results in ICE #155

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

Open
lcnr opened this issue Jan 29, 2025 · 3 comments
Open

non-fatal overflow during monomorphization results in ICE #155

lcnr opened this issue Jan 29, 2025 · 3 comments

Comments

@lcnr
Copy link
Contributor

lcnr commented Jan 29, 2025

instead of aborting due to fatal overflow, we ICE due to an error in Instance::resolve or normalize_erasing_regions:

affected tests:

  • resolve instance
    • tests/ui/impl-trait/failed-to-resolve-instance-ice-105488.rs
  • normalize erasing regions
    • tests/ui/infinite/infinite-instantiation-struct-tail-ice-114484.rs
    • tests/ui/recursion_limit/zero-overflow.rs
    • tests/ui/type-alias-impl-trait/mututally-recursive-overflow.rs
    • tests/ui/issues/issue-67552.rs

We should also fatal error with the new solver during monomorphization

@lcnr lcnr moved this to todo in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr closed this as completed by moving to todo in -Znext-solver=globally Jan 29, 2025
@lcnr lcnr reopened this Jan 29, 2025
@lcnr lcnr moved this from toduu to todo in -Znext-solver=globally Jan 29, 2025
@compiler-errors
Copy link
Member

Not clear where to insert this fatal overflow in a way that doesn't just reintroduce the limitations in the old solver w/ overflow.

@compiler-errors
Copy link
Member

We may want to push this down into the callsites of normalize + instance resolve so that this only affects codegen.

@lcnr
Copy link
Contributor Author

lcnr commented Feb 25, 2025

This currently also results in a bunch of ICE if the recursion limit isn't high enough during bootstrap:

error: internal compiler error: compiler/rustc_monomorphize/src/collector.rs:883:22: failed to resolve instance for unsafe fn(*const ()) {<rayon_core::job::StackJob<rayon_core::latch::LatchRef<'_, rayon_core::latch::LockLatch>, {closure@rayon_core::registry::Registry::in_worker_cold<{closure@rayon_core::join::join_context<{closure@rayon_core::join::join::call<std::option::Option<FromDyn<()>>, {closure@rustc_data_structures::sync::join<{closure@compiler/rustc_incremental/src/persist/save.rs:52:13: 52:20}, {closure@compiler/rustc_incremental/src/persist/save.rs:63:13: 63:20}, (), ()>::{closure#0}::{closure#0}}>::{closure#0}}, {closure@rayon_core::join::join::call<std::option::Option<FromDyn<()>>, {closure@rustc_data_structures::sync::join<{closure@compiler/rustc_incremental/src/persist/save.rs:52:13: 52:20}, {closure@compiler/rustc_incremental/src/persist/save.rs:63:13: 63:20}, (), ()>::{closure#0}::{closure#1}}>::{closure#0}}, std::option::Option<FromDyn<()>>, std::option::Option<FromDyn<()>>>::{closure#0}}, (std::option::Option<FromDyn<()>>, std::option::Option<FromDyn<()>>)>::{closure#0}::{closure#0}}, (std::option::Option<FromDyn<()>>, std::option::Option<FromDyn<()>>)> as rayon_core::job::Job>::execute}

thread 'rustc' panicked at compiler/rustc_monomorphize/src/collector.rs:883:22

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

No branches or pull requests

2 participants