mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-24 14:34:23 +00:00
f54350a9ba
Detect truncated DepGraph files I suspect that the following issues are caused by truncated incr comp files: * https://github.com/rust-lang/rust/issues/120582 * https://github.com/rust-lang/rust/issues/121499 * https://github.com/rust-lang/rust/issues/122210 We fail with an allocation failure or capacity overflow in this case because we assume that the ending bytes of an DepGraph file are the lengths of arrays. If the file has somehow been truncated then the ending bytes are probably some of our varint encoding, which tries to eliminate zero bytes, so interpreting a random 8 bytes as an array length has a very high chance of producing a byte capacity over `isize::MAX`. Now theoretically since https://github.com/rust-lang/rust/pull/119510 merged I have fixed the out-of-disk issues and yet in https://github.com/rust-lang/rust/issues/120894#issuecomment-1945126700 I still see some decoding failures that look like out-of-disk ICEs, for example https://crater-reports.s3.amazonaws.com/beta-1.77-1/beta-2024-02-10/gh/scottfones.aoc_2022/log.txt So this PR should ensure that we get an ICE that clearly identifies if the file in question is truncated. |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |