Skip to content

rustc hangs and leaks memory #79714

Closed

Description

@is8ac

In stable, rustc 1.48.0 (7eac88abb 2020-11-16), rustc demo.rs promptly returns overflow evaluating the requirement and exits. This is expected behavior.

In nightly, rustc 1.50.0-nightly (5be3f9f10 2020-12-03), rustc demo.rs hangs indefinitely, using 100% of one core. Memory usage fluctuates but tends to grow over time at ~800 MB per minute on my machine.

Source

pub trait Baz {}
impl Baz for () {}
impl<T> Baz for [T; 3] {}

pub trait Fiz {}
impl Fiz for bool {}

pub trait Corge<S> {
    type Foo;
}

impl<W: Corge<()>> Corge<[(); 3]> for W {
    type Foo = [<W as Corge<()>>::Foo; 3];
}

pub trait Grault
where
    Self::B: Fiz,
{
    type A;
    type B;
}

impl<T: Grault> Grault for [T; 3]
where
    Self::A: Baz,
    Self::B: Fiz,
{
    type A = [T::A; 3];
    type B = T::B;
}

pub trait Quaks<S, W> {
    fn bar() {}
}

impl<S> Quaks<S, bool> for u8
where
    bool: Corge<S>,
    <bool as Corge<S>>::Foo: Grault,
{
}

fn main() {
    <u8 as Quaks<[(); 3], bool>>::bar();
}

rustc --version --verbose:

rustc 1.50.0-nightly (5be3f9f10 2020-12-03)
binary: rustc
commit-hash: 5be3f9f10e9fd59ea03816840a6051413fbdefae
commit-date: 2020-12-03
host: x86_64-unknown-linux-gnu
release: 1.50.0-nightly

Activity

  1. added
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Dec 5, 2020
  2. added
    I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.
    on Dec 5, 2020
  3. JohnTitor commented on Dec 5, 2020

    @JohnTitor
    Member

    This happens on beta as well.

  4. added and removed on Dec 5, 2020
  5. JohnTitor commented on Dec 5, 2020

    @JohnTitor
    Member

    The regression introduced between nightly-2020-10-06 (a1dfd24) and nightly-2020-10-07 (98edd1f)

    Possible culprit PRs: #77606, #73905 (UPDATE: confirmed #73905 is the cause)

  6. added
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    P-highHigh priority
    and removed
    I-prioritizeIssue needs a team member to assess the impact. Will be replaced by P-{low,medium,high,critical}
    on Dec 5, 2020
  7. camelid commented on Dec 6, 2020

    @camelid
    Member

    Assigning P-high and removing I-prioritize as discussed in the prioritization working group.

  8. added this to the 1.49.0 milestone on Dec 11, 2020
  9. Mark-Simulacrum commented on Dec 11, 2020

    @Mark-Simulacrum
    Member

    I am going to move this to P-low as this isn't breaking working code, we have more urgent fall out from #73905 that needs to be fixed first.

  10. added
    P-lowLow priority
    and removed
    P-highHigh priority
    on Dec 11, 2020
  11. changed the title [-]rustc nightly hangs and leaks memory[/-] [+]rustc hangs and leaks memory[/+] on Dec 18, 2020
  12. added a commit that references this issue on Dec 26, 2020
    931aa27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-trait-systemArea: Trait systemC-bugCategory: This is a bug.I-hangIssue: The compiler never terminates, due to infinite loops, deadlock, livelock, etc.P-lowLow priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions