-
Notifications
You must be signed in to change notification settings - Fork 13.3k
rustc panics when it can't spawn a thread #72482
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
Comments
Please check that your system is configured correctly, see #69140 |
Does this mean that the issue is not with the rust code or with rust itself, but rather the system I'm running rust on? |
Yes |
Well, or at least that's very likely. All the compiler does is spawn a couple of threads, which fails on your system. |
Have you tried the |
Yes. It appears to reduce to occurrence of the issue, although not solving it entirely. |
Also Cc #46345 |
@RithvikChuppala Are you using a lot of compute power when this happens? This seems unlikely to be an issue that Rust can solve, and there's already a related issue, so closing for now. Reopen if you disagree. |
Re-opening this; it's possible libtest could retry if it can't spawn a thread instead of panicking. #46345 is not really related; libtest has to handle the error somehow, the standard library can't do that for it. |
Seems like this line might be the cause, but not sure: Line 473 in 981346f
|
Perhaps instead of panicking if we can't spawn more threads, we print a message like "Unable to spawn thread" and |
Actually it might make more sense to just run the tests synchronously in that case. |
Put up a draft PR that may fix this: #78165. |
I think this issue was originally about the |
As far as I understand, this issue is about a libtest ICE, not a rustc ICE. The ICE occurs when libtest is unable to spawn a thread to run a test. For example, if your system is at the thread limit, libtest would try to spawn a thread, fail, and crash. |
The log clearly shows the ICE happened when compiling tests using rustc:
ICE stands for "internal compiler error", which should not be reported by libtest in my case (I don't have any doctest), because the compiler never runs non-documentation tests (edit: I take back what I said before, looks like rustdoc can call libtest and may cause ICE). Cargo does this job instead, and if libtest panics, only the normal panicking message and The log I pasted on #46345 (comment) does not contain anything related to ICEs. |
@jyn514 ^ |
Sorry for the mis-diagnosis, I updated the issue to match what's going on. |
At this point, I'm not really sure what the cause of this issue. I think in the end it's unrelated to the libtest issue. Probably this should just be closed since I don't think it's actionable. But let's see if anyone else wants to comment. |
Triage: There were no objections, so let's close as duplicate to #46345 |
I wrote up some public and private strcuts, public methods, and traits in a module called structures.rs
In main.rs, I import structures.rs and write tests in its own separate module (within main.rs) using #[cfg(test)] and #[test] above each test method, which tests some public functions and structs from structures.rs
In both files, the fn main() only contains 1 println! statement.
Compiling both main.rs and structures.rs gives me a few warnings but no errors.
I try to run the unit tests using "cargo test" in the "src" folder of my crate but it doesn't act deterministically. Running "cargo test --verbose" errors with the message:
Other times, it works successfully and gives me the result of running the tests. I've done a variety of things, including reinstalling Rust and resourcing the path, and received continued undeterministic results (sometimes working, sometimes erring). Any advice?
rustc --version: rustc 1.43.1 (8d69840 2020-05-04)
system: linux CentOS
The text was updated successfully, but these errors were encountered: