Closed rana closed 1 year ago
@rana: Could you share your Cargo.toml
(and ideally, the entire repository)?
Hi Aaron,
Great to hear from you. You're fast :slightly_smiling_face:
Attached is the project that generated the bug.
Most of it is hello_world-level
stuff- and disconnected tinkering.
The workflow was to run a test, write some code, run a test.
By about the second or third test-change the defect was consistent to get.
Hope that helps, and let me know if you have any questions.
Cheers!
Rana Ian
@rana: Unfortunately, I'm not able to reproduce your crash locally. Could you elaborate on the kinds if changes you were making to the tests before the crash started occuring?
@Aaron1011 I'm not able to reproduce it here again as well. If I see it again I'll do a screen record and post it.
The last predicate listed in the error message is interesting: Binder(TraitPredicate(<Self as pck::test::bitpacking::BitPacker>), []), /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs:162:1: 263:2 (#0))
It appears to be generated here:
The fact that we call guess_head_span
means that the span should be a single line (containing pub trait BitPacker: Sized + Clone + Copy
). However, the span is for the entire definition of the BitPacker
trait, indicating that guess_head_span
failed.
The file in question is part of a dependency, so it shouldn't have changed between compilation sessions (if the version number changed, then we would be dealing with a different file, since the version number is included in the directory name bitpacking-0.8.4
). I suspect that there's a bug in some of the filesystem-loading code involved in guess_head_span
- I'll investigate further.
I've managed to create a predicates_of
ICE locally by changing a file in a dependency, without modifying the timestamp. When Rust tries to read in an 'external src file' from the dependency during the second compilation session, the src_hash
will no longer match. This causes span_to_snippet
to fail, causing us to generate a different span in predicates_of
.
However, I'm not sure if this is the same ICE that you've reported.
@rana: Is there any change that /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs
somehow got modified between compilation sessions? Is /home/rana/.cargo
on an atypical partition (e.g. NFS)?
EDIT: On further investigation, it appears that modifying files in ~/.cargo/registry
does not trigger a rebuild of the dependency, even though the modification time changes. I think a modification of bitpacking-0.8.4/src/lib.rs
, combined with certain modifications to the tsr
crate, would be enough to cause an ICE similar to the one that you're seeing.
No change to /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs
. That's stable. I don't edit it.
/home/rana/.cargo
is on an ordinary partition as well. Here is the output from lsblk
.
rana@aum:~$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sda 8:0 0 238.5G 0 disk
└─sda1 8:1 0 238.5G 0 part
sr0 11:0 1 1024M 0 rom
nvme0n1 259:0 0 1.1T 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /boot/efi
└─nvme0n1p2 259:2 0 1.1T 0 part /
The workflow was only to add new tests, and use the in-IDE "Run test" link shown in the snapshot.
The current output window command (that's currently working) shows:
> Executing task: cargo test -- --nocapture num_bits_pkg <
Finished test [unoptimized + debuginfo] target(s) in 0.09s
Running unittests (target/debug/deps/tsr-6150d47f1fc41f28)
running 3 tests
num_bits_sorted 13
num_bits_sorted 13
num_bits_sorted 13
test pck::test::num_bits_pkg_2 ... ok
test pck::test::num_bits_pkg_3 ... ok
test pck::test::num_bits_pkg ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 15 filtered out; finished in 0.00s
When I get back to that workflow of adding new tests and code I expect it to crash as consistently as it did before. But I also plan to stop using nightly because of it.
That's interesting. The fact that you were getting the ICE consistently would seem to rule out any kind of transient I/O issue - Rust would need to fail to open /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs
each time you got the ICE.
I've opened https://github.com/rust-lang/rust/issues/86480 to track an issue that I've discovered from investigation this. It's possible that these two issues are actually the same, but I'm not certain.
Triage: Thank you for reporting. Since there is no way for others to reproduce the ICE reported in this issue, let's assume it is a duplicate. Feel free to reopen this issue if it turns out it is not a duplicate and after figuring out how others can reproduce this ICE.
Code
Ran the fn num_bits_pkg() from VSCode "Run test"
Meta
rustc --version --verbose
:Error output
Backtrace
``` thread 'rustc' panicked at 'Found unstable fingerprints for predicates_of(bitpacking[28cc]::BitPacker): GenericPredicates { parent: None, predicates: [(Binder(TraitPredicate(), []), /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs:162:22: 162:27 (#0)), (Binder(TraitPredicate(), []), /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs:162:30: 162:35 (#0)), (Binder(TraitPredicate(), []), /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs:162:38: 162:42 (#0)), (Binder(TraitPredicate(), []), /home/rana/.cargo/registry/src/github.com-1ecc6299db9ec823/bitpacking-0.8.4/src/lib.rs:162:1: 263:2 (#0))] }', /rustc/539d7bd3998d9bfed14c264eacda30097a4ea768/compiler/rustc_query_system/src/query/plumbing.rs:620:9
stack backtrace:
0: rust_begin_unwind
at /rustc/539d7bd3998d9bfed14c264eacda30097a4ea768/library/std/src/panicking.rs:515:5
1: std::panicking::begin_panic_fmt
at /rustc/539d7bd3998d9bfed14c264eacda30097a4ea768/library/std/src/panicking.rs:457:5
2: rustc_query_system::query::plumbing::incremental_verify_ich
3: rustc_query_system::query::plumbing::load_from_disk_and_cache_in_memory
4: rustc_data_structures::stack::ensure_sufficient_stack
5: rustc_query_system::query::plumbing::get_query_impl
6: ::predicates_of
7: rustc_middle::ty::generics::GenericPredicates::instantiate_into
8: rustc_middle::ty::generics::GenericPredicates::instantiate
9: rustc_typeck::check::fn_ctxt::_impl::::instantiate_bounds
10: rustc_typeck::check::fn_ctxt::_impl::::add_required_obligations
11: rustc_typeck::check::fn_ctxt::_impl::::instantiate_value_path
12: rustc_typeck::check::expr::::check_expr_kind
13: rustc_typeck::check::expr::::check_expr_with_expectation
14: rustc_typeck::check::callee::::check_call
15: rustc_typeck::check::expr::::check_expr_kind
16: rustc_typeck::check::expr::::check_expr_with_expectation
17: rustc_typeck::check::fn_ctxt::checks::::check_decl_initializer
18: rustc_typeck::check::fn_ctxt::checks::::check_decl_local
19: rustc_typeck::check::fn_ctxt::checks::::check_stmt
20: rustc_typeck::check::fn_ctxt::checks::::check_block_with_expected
21: rustc_typeck::check::expr::::check_expr_with_expectation
22: rustc_typeck::check::expr::::check_return_expr
23: rustc_typeck::check::check::check_fn
24: rustc_typeck::check::inherited::InheritedBuilder::enter
25: rustc_typeck::check::typeck
26: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
27: rustc_data_structures::stack::ensure_sufficient_stack
28: rustc_query_system::query::plumbing::force_query_with_job
29: rustc_query_system::query::plumbing::get_query_impl
30: ::typeck
31: rustc_middle::ty::::par_body_owners
32: rustc_typeck::check::typeck_item_bodies
33: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
34: rustc_data_structures::stack::ensure_sufficient_stack
35: rustc_query_system::query::plumbing::force_query_with_job
36: rustc_query_system::query::plumbing::get_query_impl
37: ::typeck_item_bodies
38: rustc_session::utils::::time
39: rustc_typeck::check_crate
40: rustc_interface::passes::analysis
41: rustc_middle::dep_graph::::with_deps
42: rustc_query_system::dep_graph::graph::DepGraph::with_task_impl
43: rustc_query_system::dep_graph::graph::DepGraph::with_eval_always_task
44: rustc_data_structures::stack::ensure_sufficient_stack
45: rustc_query_system::query::plumbing::force_query_with_job
46: rustc_query_system::query::plumbing::get_query_impl
47: ::analysis
48: rustc_interface::queries::::enter
49: rustc_span::with_source_map
50: rustc_interface::interface::create_compiler_and_run
51: scoped_tls::ScopedKey::set
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
```