Repository navigation
Compiler panics when disk is full #115298
Description
Activity
- addedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Aug 27, 2023 - addedT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Aug 28, 2023 - addedI-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️C-bugCategory: This is a bug.Category: This is a bug.and removedneeds-triageThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triagingThis issue may need triage. Remove when done. See docs forge.rust-lang.org/release/issue-triaging
on Aug 29, 2023 Posting a wall of AI generated text is very unhelpful here. Please refrain from doing so in the future.
Reacted by Demi Marie Obenour, Tim Neumann, radiish, Gregory Conrad, Martin Indra, Jakub Beránek, Jay, Felipe Mica, Degubi and Anatol UlrichThis ICE has been reported at least 9 times now; the issues above contain a total of 7 reports, then there's this issue and @kpreid posted about running into this on the community Discord.
I do not know why we've seen a recent uptick in reports of this ICE, but as far as I can tell the root cause is this PR (which predates all the reports): #94732, which subtly changes the API of
Encoder. All writes are infallible but do not necessarily update the encoder position and thus any assertion which is based on inspecting the encoder position will explode if an encoder encounters an IO error.It looks to me like this tripping hazard wasn't noticed at the time, which is hardly surprising considering that this is along an error path and all the reports we have will result in unsuccessful compilation even if the assertion isn't tripped.
I am going to try to make this not ICE anymore. The current implementation of
FileEncoderhas a reimplementation ofBufWriterwoven together with the delayed error handling; in its current state I have little confidence in my ability to review a fix that just adds updates to the encoder position so I'm going to try to untangle the logic first.Reacted by Kevin Reid, Demi Marie Obenour, Jakub Beránek and Felipe Mica- added a commit that references this issue
on Sep 21, 2023 It might be good, in addition to fixing this specific error, for the compiler to estimate a "safe" disk space requirement before starting its operations. It could at least issue a warning before initiating or completely fail and proceed only if the user decides to force it.
It could also issue a warning at the end of a compilation when disk space is running low, something like:
"WARN: Low disk space, this may affect future compilations."
You're welcome to open a feature request issue for this.
I do not think we can do such estimation accurately enough to have an acceptable false positive rate, so I suspect we would get reports of the warning firing when it shouldn't when people compile on systems with a small disk. If we actually issue such a thing as a warning, we will probably break a lot of CI that uses
-Dwarningsdue to estimation error.You're welcome to open a feature request issue for this.
I do not think we can do such estimation accurately enough to have an acceptable false positive rate, so I suspect we would get reports of the warning firing when it shouldn't when people compile on systems with a small disk. If we actually issue such a thing as a warning, we will probably break a lot of CI that uses
-Dwarningsdue to estimation error.Well, I suggested it. As expected, the idea was poorly received. Here is the link for record and cross-reference: Check disk space before compilation.
- added a commit that references this issue
on Apr 7, 2024 - added a commit that references this issue
on Apr 27, 2024
When compiling my project, the disk filled up and I got:
I’m assuming this is a compiler bug, if only because the error message is not helpful. I haven’t included an example because I don’t think the specific code being compiled matters here.