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 "thread 'rustc' has overflowed its stack" on Windows (1.5 nightly x86_64 msvc toolchain) #28946

Closed
randomPoison opened this issue Oct 10, 2015 · 12 comments
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@randomPoison
Copy link
Contributor

I've got the following trait and impl:

pub trait Dot<Other=Self> {
    type Output;

    fn dot(self, rhs: Other) -> Self::Output;
}

impl<'a, T> Dot<&'a T> for T where T: Dot<T> + Copy {
    type Output = T::Output;

    fn dot(self, rhs: &T) -> Self::Output {
        self.dot(*rhs)
    }
}

When I change the impl to:

impl<'a, T, U> Dot<&'a U> for T where T: Dot<U>, U: Copy {
    type Output = T::Output;

    fn dot(self, rhs: &U) -> Self::Output {
        self.dot(*rhs)
    }
}

I get the error thread 'rustc' has overflowed its stack.

This is happening on the current nightly build (10/10/2015) with the x86_64 Windows MSVC toolchain. I tried to reproduce the error with just the above code but that didn't cause the error, but compiling the entire crate it's in did. The full crate (including commented out code that causes error) can be found here, the code that causes the error is in src/lib.rs.

Misc. Notes

  • Using the 1.5 nightly build (10/10) of the x86_64 MSVC toolchain.
  • Running Windows 10.
@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Oct 11, 2015
@apasel422
Copy link
Contributor

I can't reproduce on

rustc 1.5.0-nightly (1210fb9bc 2015-10-23)
binary: rustc
commit-hash: 1210fb9bc61b351cb0441cc48dac9e18987fb88b
commit-date: 2015-10-23
host: x86_64-unknown-linux-gnu
release: 1.5.0-nightly

@alexcrichton alexcrichton added the E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. label Oct 24, 2015
@steveklabnik steveklabnik added E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. labels Oct 25, 2015
@steveklabnik
Copy link
Member

If anyone needs help adding a test for this, please let me know!

@apasel422
Copy link
Contributor

I guess I missed the part about this occurring only when compiling the entire crate. I'm getting an error when I try to build the whole repo, so I'm not sure if this was actually fixed.

@randomPoison
Copy link
Contributor Author

@steveklabnik I would love to put together a better test case for this! Just let me know what I need to do :)

@steveklabnik
Copy link
Member

@excaliburHisSheath so, the basic idea is to put a file with the program into https://github.com/rust-lang/rust/tree/master/src/test/run-pass . Everything in that directory should compile successfully, so by just copying it in, we can test it.

However, @apasel422 seems to suggest that we haven't actually figured out a small reproduction, it requires the whole crate. So, for now, I'm going to remove those tags, as that's what we need first before we can do that.

@steveklabnik steveklabnik removed E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. E-mentor Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. labels Oct 26, 2015
@randomPoison
Copy link
Contributor Author

Cool, I'll work on paring down the case until I have a minimal example.

@randomPoison
Copy link
Contributor Author

As of the latest nightly (Rust 1.6 MSVC 10/31/2015) this no longer causes an ICE, instead giving the following compile error:

src\vector.rs:91:15: 91:24 error: overflow evaluating the requirement `<&vector::Vector3 as Dot<_>>::Output` [E0275]
src\vector.rs:91         (self.dot(self) - 1.0).is_zero()
                               ^~~~~~~~~
src\vector.rs:91:15: 91:24 help: run `rustc --explain E0275` to see a detailed explanation
src\vector.rs:91:15: 91:24 note: consider adding a `#![recursion_limit="128"]` attribute to your crate

If it would still be useful to have a reproducible case as a regression test I can still put one together with an older version of the compiler.

@takemyoxygen
Copy link

Not sure whether it's helpful for you or not, but in my case the code to reproduce stack overflow is

struct Foo<I> { parent: I,  }

impl<I: Iterator> Iterator for Foo<I> {
    type Item = Self::Item;

    fn next(&mut self) -> Option<I::Item> { None }
}

After I change it to type Item = I::Item, it compiles successfully.

I'm running Rust 1.5.0 on Windows 10.

@Mark-Simulacrum
Copy link
Member

Marking as E-needstest, for the test case in the previous issue comment.

@Mark-Simulacrum Mark-Simulacrum 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 12, 2017
@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. labels Jul 22, 2017
@steveklabnik
Copy link
Member

Triage: not aware of any tests added.

@randomPoison
Copy link
Contributor Author

I haven't seen this ICE in a long time, and I'm not working on the code that caused it anymore. Probably makes sense to just close this ticket, though I'll leave that at your discretion.

@steveklabnik
Copy link
Member

steveklabnik commented Sep 25, 2018

Will do :) Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. E-needs-test Call for participation: An issue has been fixed and does not reproduce, but no test has been added. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants