-
Notifications
You must be signed in to change notification settings - Fork 13k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Compiler unexpectedly panics occasionally on Windows #48700
Comments
I also ran into what seems to be a nearly identical issue just now, also on Windows. I suspect based on similar errors I run into from time to time when working on other programs, that this may be due to conflicts between 3rd party file indexing programs and the compilation process. In particular, if you're using any kind of antivirus software or any kind of automatic backup service like Dropbox, what can happen is that when you create or modify a new file, the external indexing program temporarily locks the file to scan it. This can cause issues if you then try deleting or moving the file soon after -- it's locked, so the operation fails. This problem is particularly acute if you're generating and deleting a bunch of files in rapid succession. (So basically, there's a race condition somewhere.) I vaguely recall doing some research into fixing this, and found the easiest solution was to just retry the deleting operation two or three times with a short delay then give up if that doesn't work. And now that I'm re-thinking about this, a second solution might also be to just write-lock the file until the compilation process is completely done -- I think that would prevent some other process stealing the lock in the middle of compilation. But I'm no Windows expert, and am certainly no Rust expert, so please take everything I'm saying with a grain of salt. (I figured I might as well just leave this info here to give anybody who decides to tackle this issue some leads to work with.) |
I am getting a similar but different error when I run cargo run on a simple test project. rustc is the line giving the warning:
I'm running this in WSL, Windows 10 1903. ls -l of that incremental directory shows a bunch of .o and .bin files, and they are are all owned by me, as is the directory itself, and permissions are rw. It's also worth noting, warning aside, the program seems to actually be generated and work. |
I'm also having this problem recently after updating to 1.36 on wsl. It's annoying because it explodes compile times.
|
@MoAlyousef I had the same issue, if your using vscode it's because of the file watcher. {
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/target/**": true
}
} |
Thank you...that fixed things. |
I am not using VScode, but I had something similar in my build of https://github.com/rust-osdev/bootloader in release mode. I reported it to bootloader project, but after some exploration, I believe it is a problem in rustc. Symptoms: I managed to generate the stack trace as shown below:
Line 12 and 11 above show that rustc tries to remove the intermediate objects after linking, then fails.
|
I found if I move the bootloader project directory to be under the wsl filesystem (e.g., the home ~/ in my case), the bootloader just builds fine. The error only happens when the project is in a mounted windows filesystem (e.g., the disk D: or /mnt/d in my case). I suspected the error was caused by some mismatch in the file permission handling between rustc and wsl for the mounted filesystem. But I cannot produce a small test case that generates the same error. I produced a binary (with |
Source: #62031 (comment) That helped me fix this compiler's warning. I hope it could fix yours too. |
no reproduction, closing. |
Within all of my projects, when I run "cargo run" while in the directory of the project, the compiler occasionally panics and outputs:
Previous to 1.24 I did not experience this. Generally if I re-run the code without changing anything (i.e., I see the error/panic, retype "cargo run" and hit enter in the console) it compiles properly (so the compilation error / panic is annoying, but not critical in my case). I use Windows at work and Linux (Xubuntu 17.10) at home. If I work on the same code at home (on my linux box) the compiler error doesn't ever occur. My thoughts are that it might be something due to incremental compilation on Windows, but I'm new to Rust (and compiled code in general) so I'm not sure.
The text was updated successfully, but these errors were encountered: