You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiling my project, the disk filled up and I got:
thread 'rustc' panicked at 'assertion failed: pos.get() <= self.position()', compiler/rustc_metadata/src/rmeta/encoder.rs:447:9
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.
Reacted by Sergey Ivanov, Kisaragi, l and Felipe Mica
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, seth cullerne bown, Gregory Conrad, Martin Indra, Jakub Beránek, Jay, Felipe Mica, Degubi and Anatol Ulrich
This 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 FileEncoder has a reimplementation of BufWriter woven 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
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 -Dwarnings due 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 -Dwarnings due 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.
Activity
leikang123 commentedon Aug 30, 2023
ChrisDenton commentedon Aug 30, 2023
Posting a wall of AI generated text is very unhelpful here. Please refrain from doing so in the future.
saethlin commentedon Sep 4, 2023
This 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.Auto merge of rust-lang#115542 - saethlin:fileencoder-is-bufwriter, r…
Auto merge of rust-lang#115542 - saethlin:fileencoder-is-bufwriter, r…
Auto merge of #115542 - saethlin:fileencoder-is-bufwriter, r=WaffleLa…
felipelalli commentedon 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."
saethlin commentedon Sep 21, 2023
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.felipelalli commentedon Sep 21, 2023
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.
Auto merge of #115542 - saethlin:fileencoder-is-bufwriter, r=WaffleLa…
Auto merge of #115542 - saethlin:fileencoder-is-bufwriter, r=WaffleLa…