Comments (7)
This is the truncated dep graph crash that I've been hunting. We get this particular ICE because the last few bytes of a dep graph file are supposed to be the length of a Vec and so if the file is truncated arbitrary bytes get reinterpreted as a length and when multiplied by the size of the element type, we get overflow.
I'm assigning myself to keep track of such issues.
What filesystem are you using?
from rust.
Yes that was suggested to me before.
from rust.
Such a check can detect this scenario but it cannot distinguish been a bug in the compiler and a problem with the environment. The fact that we weren't papering over such invalid files is what allowed me to fix multiple bugs that were in the compiler for over a year and were reported numerous times.
I am not interested in just detecting invalid files and papering over the situation.
from rust.
As far as I can tell, the ICE reported in this issue is caused by another process damaging rustc's build artifacts or by a buggy filesystem. That other process could be anything from an IDE running the compiler at the same time as a manual build to a find-and-replace that accidentally edits files in the target directory.
#124686 contains a mitigation for this situation; the compiler now has a crude way to detect and ignore damaged incremental compilation files. You will still get a warning about the damaged file, but the build should proceed normally. That change shipped in Rust 1.80 which released today, so I am closing this issue and a few others which as far as I can tell all have the same root cause. You shouldn't see this ICE anymore, but please file a new issue if you see something like it on 1.80 or later.
from rust.
Btrfs
from rust.
@saethlin Maybe add a magic value at the end of the dep graph file and if that value is not present when decoding consider the incr comp session corrupt and ignore it? If the magic value is 16 random bytes, it is very unlikely that they will occur anywhere other than at the end, as such it would catch a truncated file with extremely high certainty.
from rust.
Got a similar ICE - my computer frozen while cargo was building the project and upon rebooting and retrying got this.
stacktrace
thread 'rustc' panicked at library/alloc/src/raw_vec.rs:570:5:
capacity overflow
stack backtrace:
0: 0x74fcea3d7d16 - std::backtrace_rs::backtrace::libunwind::trace::h92ba5ac126ecc5ad
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/../../backtrace/src/backtrace/libunwind.rs:104:5
1: 0x74fcea3d7d16 - std::backtrace_rs::backtrace::trace_unsynchronized::hfaa118b6e3a8f31a
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/../../backtrace/src/backtrace/mod.rs:66:5
2: 0x74fcea3d7d16 - std::sys_common::backtrace::_print_fmt::h2075f185adf13bbd
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:68:5
3: 0x74fcea3d7d16 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::h9c4bd387f9f3f544
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:44:22
4: 0x74fcea42a770 - core::fmt::rt::Argument::fmt::h018ecebdf268b5bb
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/fmt/rt.rs:142:9
5: 0x74fcea42a770 - core::fmt::write::h938c332fdab924eb
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/fmt/mod.rs:1120:17
6: 0x74fcea3cb58f - std::io::Write::write_fmt::h4a694b02e44e6363
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/io/mod.rs:1846:15
7: 0x74fcea3d7af4 - std::sys_common::backtrace::_print::h3595c0f4303f3ccd
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:47:5
8: 0x74fcea3d7af4 - std::sys_common::backtrace::print::ha888e6736b0bc71f
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:34:9
9: 0x74fcea3da887 - std::panicking::default_hook::{{closure}}::he19a7f79f7beab5e
10: 0x74fcea3da5e9 - std::panicking::default_hook::h67efe04e9a5d446e
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:292:9
11: 0x74fce71af6bc - std[c78d3cd131ec7074]::panicking::update_hook::<alloc[4e128ca7a2328977]::boxed::Box<rustc_driver_impl[f73d4ac0dd51449f]::install_ice_hook::{closure#0}>>::{closure#0}
12: 0x74fcea3dafd6 - <alloc::boxed::Box<F,A> as core::ops::function::Fn<Args>>::call::h9c9759b104a0af15
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/alloc/src/boxed.rs:2029:9
13: 0x74fcea3dafd6 - std::panicking::rust_panic_with_hook::h49021cdbc4b22349
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:785:13
14: 0x74fcea3dace9 - std::panicking::begin_panic_handler::{{closure}}::hfbf601f3d8c62d13
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:651:13
15: 0x74fcea3d8216 - std::sys_common::backtrace::__rust_end_short_backtrace::h98dd020b6e913806
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys_common/backtrace.rs:171:18
16: 0x74fcea3daa74 - rust_begin_unwind
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/panicking.rs:647:5
17: 0x74fcea426e75 - core::panicking::panic_fmt::h0d3f1893e38be419
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/core/src/panicking.rs:72:14
18: 0x74fcea417daf - alloc::raw_vec::capacity_overflow::hdebe4d61eabe5c80
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/alloc/src/raw_vec.rs:570:5
19: 0x74fce93f9917 - rustc_incremental[b64084db19a0a9a5]::persist::load::setup_dep_graph
20: 0x74fce93461ae - <rustc_interface[aa0080c74e239226]::queries::Queries>::global_ctxt
21: 0x74fce90ea5ae - rustc_interface[aa0080c74e239226]::interface::run_compiler::<core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>, rustc_driver_impl[f73d4ac0dd51449f]::run_compiler::{closure#0}>::{closure#0}
22: 0x74fce93382f1 - std[c78d3cd131ec7074]::sys_common::backtrace::__rust_begin_short_backtrace::<rustc_interface[aa0080c74e239226]::util::run_in_thread_with_globals<rustc_interface[aa0080c74e239226]::interface::run_compiler<core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>, rustc_driver_impl[f73d4ac0dd51449f]::run_compiler::{closure#0}>::{closure#0}, core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>>
23: 0x74fce933814f - <<std[c78d3cd131ec7074]::thread::Builder>::spawn_unchecked_<rustc_interface[aa0080c74e239226]::util::run_in_thread_with_globals<rustc_interface[aa0080c74e239226]::interface::run_compiler<core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>, rustc_driver_impl[f73d4ac0dd51449f]::run_compiler::{closure#0}>::{closure#0}, core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>>::{closure#0}::{closure#0}, core[853b3d1bf84aeb53]::result::Result<(), rustc_span[9a816cd1dc398d83]::ErrorGuaranteed>>::{closure#1} as core[853b3d1bf84aeb53]::ops::function::FnOnce<()>>::call_once::{shim:vtable#0}
24: 0x74fcea3e4675 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h4f08d401a486e446
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/alloc/src/boxed.rs:2015:9
25: 0x74fcea3e4675 - <alloc::boxed::Box<F,A> as core::ops::function::FnOnce<Args>>::call_once::h3476dfcdba628abc
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/alloc/src/boxed.rs:2015:9
26: 0x74fcea3e4675 - std::sys::pal::unix::thread::Thread::new::thread_start::h2770ac7f8882db09
at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/library/std/src/sys/pal/unix/thread.rs:108:17
27: 0x74fce44a955a - <unknown>
28: 0x74fce4526a5c - <unknown>
29: 0x0 - <unknown>
error: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md
note: rustc 1.77.0 (aedd173a2 2024-03-17) running on x86_64-unknown-linux-gnu
note: compiler flags: --crate-type bin -C embed-bitcode=no -C codegen-units=256 -C debuginfo=2 -C incremental=[REDACTED]
note: some of the compiler flags provided by cargo are hidden
query stack during panic:
end of query stack
from rust.
Related Issues (20)
- Tracking Issue for `lazy_get`
- [ICE] adding a def'n for node-id NodeId(130468) and def kind AnonConst but a previous def'n exists HOT 3
- #[inline(never)] does not work for async functions HOT 3
- `unreachable_patterns` fires on match arm that can't be removed. HOT 13
- Compiler doesn't realize that all match cases are covered HOT 3
- Error message suggests to use a Box to wrap dyn Trait when it's unnecessary HOT 1
- Compiler can't infer &str type when &String is inserted first in a collection with tuples HOT 1
- Integer literal type inference causes weird behavior including strange compiler diagnostic (but the suggestion is working).
- `dylib-soname` run-make test is not language independant HOT 3
- Add some docs for tidy
- ICE with higher order associated types HOT 5
- Tracking Issue for unbounded_shifts
- rust-analyzer compiler error (not issue with code) HOT 2
- Closure Fn* trait coercion removes other implementable Fn* traits HOT 3
- run-make: fix `run_make_support::fs::create_symlink` API and audit symlink usages in rmake.rs tests HOT 1
- run-make: audit tests that codegen for specific targets HOT 1
- Tracking Issue for `new_zeroed_alloc`
- Tracking Issue for `box_uninit_write`
- wasip2 uses wasi:random/random to generate hashmap_random_keys HOT 1
- `refining_impl_trait` suggestion in invalid code
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rust.