Comments (12)
I did have this happen again, though it is very rare. One potential note is that it seems to occur when I am using
cargo watch
, and I hit save multiple times quickly.
This is great info. Maybe I can craft another test harness that provokes this crash.
from rust.
Maybe a dupe of #109879 - tho this is on Linux instead of Windows, and at a different worker stage (not LTO).
from rust.
I did have this happen again, though it is very rare. One potential note is that it seems to occur when I am using cargo watch
, and I hit save multiple times quickly.
It's possible what is happening is:
- Some sort of incremental compilation happens, and SOME work products are written, but others aren't
- the process is killed because
cargo watch
notices a new save was made - the next compilation fails because it things something (???) should exist on disk, but doesn't (or is incomplete) due to the process being killed
Does incremental compilation have any notion of "transactions"? e.g. what if the compilation is killed?
from rust.
In the run BEFORE the error occurred, I did get this warning
:
warning: variable does not need to be mutable
--> src/main.rs:23:13
|
23 | let mut listeners = Listeners::new();
| ----^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: error copying object file `/mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/deps/river-f96f9f6f9262ae0d.26wqoch9hrpxldmx.rcgu.o` to incremental directory as `/mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/incremental/river-1mpzbb0wp27rk/s-guwsu8i3hc-1glc1l2-working/26wqoch9hrpxldmx.o`: No such file or directory (os error 2)
[Running 'cargo check && cargo test && cargo run -- --config-toml ./assets/test-config.toml']
Checking river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
warning: unused variable: `listeners`
--> src/main.rs:23:17
|
23 | let mut listeners = Listeners::new();
| ^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_listeners`
|
in the subsequent error:
thread 'cpy 26wqoch9hrpxldmx' panicked at /rustc/aedd173a2c086e558c2b66d3743b344f977621a7/compiler/rustc_codegen_ssa/src/back/write.rs:917:44:
no saved object file in work product
stack backtrace:
0: 0xffff7fd439ec - std::backtrace_rs::backtrace::libunwind::trace::ha909211bcabbe3ac
from rust.
Does incremental compilation have any notion of "transactions"? e.g. what if the compilation is killed?
To be clear: There is supposed to be a mechanism to prevent the scenario you're reporting here. We write all our output to a staging directory then fs::rename
the staging directory to the name that the next compilation is actually going to look for. The implementation was designed with this "what if the compiler is killed?" scenario in mind. It's probably just buggy.
from rust.
Also potentially worth mentioning: I'm using a VM with a shared folder for this, with:
- The host has an editor open, running Rust Analyzer
- The client VM is running
cargo watch
IMO it shouldn't be THAT different than having an IDE with R-A and running cargo-watch at the same time, but just wanted to note.
from rust.
VM with a shared folder
Hmmmmmmmmmmmmmmmmmmmmmmm
rust/compiler/rustc_incremental/src/persist/fs.rs
Lines 94 to 104 in 4fd4797
from rust.
HMMMM indeed. For MORE detail on my setup:
- Host is MacOS Sonoma 14.3 on an M2 Max (darwin aarch64)
- Guest is Fedora 39 (linux aarch64)
- VM software is UTM v4.4.5
- The VM is using Apple Virtualization (not QEMU)
- The host is using APFS for the file system
- The guest is using
virtiofs
for the shared folder
I will try two things today (tho it might not proc/repro today) to see if I can retrigger the issue (it only happens once every day or two, but maybe I can try to trigger it intentionally):
- Try to trigger it running both RA and cargo watch on the host PC only (macos)
- Try to trigger it running ONLY cargo watch on the guest vm only, in a local (not shared) dir. Fedora uses
btrfs
for the/
and/home
mounts
In both of those cases I eliminate the "shared" folder, if I can get it to trigger in either of those cases it's probably not virtiofs' fault, if it is then it is. I'll also peek at some of the other issues to see if they are also potentially using virtualization or Weird Filesystems
from rust.
So, I wrote this crude stress testing script, sharing in case it is useful:
#!/bin/bash
set -euxo pipefail
for i in {1..1000}
do
stime=`bc <<< "scale=2; $i/100"`
echo "// hehe" >> ./toml.rs
sleep $stime
done
I was able to get it to repro once (out of a couple of runs) using the VM + Host setup where it repro'd before, and it acted weird one other time (errors about "can't copy, folder doesn't exist", but no ICE).
I wasn't able to get it to repro at all in the other setups (only linux on btrfs, only macos on apfs).
I'll try it again a couple times, it doesn't proc reliably, so there's still some chance the timing is just different in the other configs.
Still definitely could be virtiofs not handling file locking or hard linking correctly.
Let me know if there's anything I can do to help with my occasionally reproing setup.
Edit, here's the "weird" errors I mention in the not-quite-repro case above:
Compiling river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
error: unable to copy /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/incremental/river-u700q7cd53gp/s-guxhx8y84l-96tqgp-working/5axxxb4yfcfqc0p3.o to /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/deps/river-df648408b139a4a9.5axxxb4yfcfqc0p3.rcgu.o: No such file or directory (os error 2)
error: could not compile `river` (bin "river" test) due to 1 previous error
[Finished running. Exit status: 101]
[Running 'cargo check && cargo test']
Checking river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
Finished dev [unoptimized + debuginfo] target(s) in 0.52s
Compiling river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
error: unable to copy /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/incremental/river-u700q7cd53gp/s-guxhx9ybn5-bxtj5l-working/3c55jdxwnbidcvho.o to /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/deps/river-df648408b139a4a9.3c55jdxwnbidcvho.rcgu.o: No such file or directory (os error 2)
error: could not compile `river` (bin "river" test) due to 1 previous error
[Finished running. Exit status: 101]
[Running 'cargo check && cargo test']
Checking river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
Finished dev [unoptimized + debuginfo] target(s) in 0.51s
Compiling river v0.2.0 (/mnt/share/vmshare/contracts/isrg/river/source/river)
error: unable to copy /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/incremental/river-u700q7cd53gp/s-guxhxaykhm-1eu4zaf-working/3tluzuoovoqa9saq.o to /mnt/share/vmshare/contracts/isrg/river/source/river/target/debug/deps/river-df648408b139a4a9.3tluzuoovoqa9saq.rcgu.o: No such file or directory (os error 2)
error: could not compile `river` (bin "river" test) due to 1 previous error
[Finished running. Exit status: 101]
from rust.
I slapped together a little flock stress tester using the flock
implementation in rustc that's used on non-Linux unices, which I think is what you have: https://github.com/saethlin/flock-stress
Can you run it in your virtiofs?
from rust.
@saethlin is there a specific way you want me to run it?
- Run two instances on the virtiofs partition on the guest linux vm
- Run one instance in the virtiofs partition on the guest linux vm and the same shared folder on the host apfs partition
- Something else?
Trying either of these it doesn't seem to crash
from rust.
You did everything I would have suggested. I suppose exposing a bug with such a simple test would have been too easy.
I have access to a Mac, I'll see if I can recreate your setup.
from rust.
Related Issues (20)
- ICE on stable due to messed up target/ directory HOT 6
- Unheplful Borrow Error Related to Use of Borrows in Loop
- ICE: `assertion failed: layout.is_sized()` HOT 3
- Tracking Issue for future-compatibility warning `SELF_CONSTRUCTOR_FROM_OUTER_ITEM`
- ICE: `error performing operation: fully_perform` HOT 3
- Couldn't evaluate constant const with `-Zpolymorphize=on` HOT 2
- missing diagnostic HOT 1
- std::fs::symlink_metadata + set_permissions makes unintuitive behavior HOT 2
- test
- AST pretty-printer produces invalid syntax for postfix match
- ICE: `Layout::compute: unexpected type '_'` HOT 1
- The compiler keeps going on Ctrl-C HOT 13
- Document minimum supported versions for apple operating systems to platform documentation HOT 3
- Performance regression: rustc failed to optimize `_mm256_avg_epu8` after 1.75.0 HOT 8
- Future version of mingw-w64 breaks externally linking some math functions
- Tracking Issue for `macro_metavar_expr_concat` HOT 13
- Debug for FilePermissions prints the mode in decimal. HOT 3
- Improve error[E0492]: statics cannot refer to interior mutable data HOT 1
- `-C linker-plugin-lto` prevents vectorization of `mem::swap` at `-C opt-level=3` HOT 6
- Null reference in `PanicInfo.location().file()` when panicking on target `aarch64-nintendo-switch-freestanding` HOT 3
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.