Skip to content
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

"Could not compile advapi32-sys on a network-mapped drive #28002

Closed
horatius83 opened this issue Aug 25, 2015 · 12 comments
Closed

"Could not compile advapi32-sys on a network-mapped drive #28002

horatius83 opened this issue Aug 25, 2015 · 12 comments
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@horatius83
Copy link

I attempted to run the command:

cargo build --verbose

and got the following error:

PS Q:\projects\hello_world\src> cargo build --verbose
   Compiling advapi32-sys v0.1.2
     Running `rustc C:\Users\<name>\.cargo\registry\src\github.com-0a35038f75765ae4\advapi32-sys-0.1.2\build.rs --crat
e-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir Q:\projects\hello_world\target\debug\build\adv
api32-sys-cfef7a1f30f1e5f6 --emit=dep-info,link -L dependency=Q:\projects\hello_world\target\debug\deps -L dependency=Q:
\projects\hello_world\target\debug\deps --extern build=Q:\projects\hello_world\target\debug\deps\libbuild-304afb6bdff23d
72.rlib -Awarnings`
       Fresh winapi-build v0.1.1
       Fresh winapi v0.2.2
       Fresh libc v0.1.10
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
note: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 5, message: "Access is
 denied.\r\n" } }', ../src/libcore\result.rs:731


Could not compile `advapi32-sys`.

Caused by:
  Process didn't exit successfully: `rustc C:\Users\<name>\.cargo\registry\src\github.com-0a35038f75765ae4\advapi32-sy
s-0.1.2\build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir Q:\projects\hello_world
\target\debug\build\advapi32-sys-cfef7a1f30f1e5f6 --emit=dep-info,link -L dependency=Q:\projects\hello_world\target\debu
g\deps -L dependency=Q:\projects\hello_world\target\debug\deps --extern build=Q:\projects\hello_world\target\debug\deps\
libbuild-304afb6bdff23d72.rlib -Awarnings` (exit code: 101)

This is my Cargo.toml file:

[package]
name = "hello_world"
version = "0.1.0"
authors = ["<name and e-mail address>"]

[dependencies]
rand="0.3.0"

Meta

rustc --version --verbose:

rustc 1.2.0 (082e47636 2015-08-03)
binary: rustc
commit-hash: 082e4763615bdbe7b4dd3dfd6fc2210b7773edf5
commit-date: 2015-08-03
host: x86_64-pc-windows-gnu
release: 1.2.0

Backtrace:

@alexcrichton
Copy link
Member

Can you get a backtrace with RUST_BACKTRACE=1? Also, is there anything running in the background which is holding onto or holding open one of those output files? (e.g. an executable still running)

@horatius83
Copy link
Author

PS Q:\projects\hello_world> cargo build --verbose
   Compiling advapi32-sys v0.1.2
     Running `rustc C:\Users\<name>\.cargo\registry\src\github.com-0a35038f75765ae4\advapi32-sys-0.1.2\build.rs --crat
e-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir Q:\projects\hello_world\target\debug\build\adv
api32-sys-cfef7a1f30f1e5f6 --emit=dep-info,link -L dependency=Q:\projects\hello_world\target\debug\deps -L dependency=Q:
\projects\hello_world\target\debug\deps --extern build=Q:\projects\hello_world\target\debug\deps\libbuild-304afb6bdff23d
72.rlib -Awarnings`
       Fresh winapi v0.2.2
       Fresh libc v0.1.10
       Fresh winapi-build v0.1.1
error: internal compiler error: unexpected panic
note: the compiler unexpectedly panicked. this is a bug.
note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports
thread 'rustc' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Os { code: 5, message: "Access is
 denied.\r\n" } }', ../src/libcore\result.rs:731

stack backtrace:
   1:         0x66139105 - sys::backtrace::write::h2345dffb6069c92cLAs
   2:         0x661428ac - rt::unwind::register::heb8429a612e0fecdqfw
   3:         0x6610561f - rt::unwind::begin_unwind_inner::h3f101c489f219c5fzcw
   4:         0x66105f9a - rt::unwind::begin_unwind_fmt::he6ac4cfedf51005fFbw
   5:         0x661422c3 - rust_begin_unwind
   6:         0x6615ecd9 - panicking::panic_fmt::h99704e91012c930eH8B
   7:         0x65bad8dd - metadata::csearch::is_default_impl::h00b99fbd2aeff47fbQo
   8:         0x65ba2bd9 - metadata::loader::Context<'a>::load_library_crate::h257060908c1ee1f7UTo
   9:         0x65b9ef63 - metadata::cstore::CStore::add_used_link_args::h94dd1e859ee72f80Gko
  10:         0x65b9b097 - metadata::creader::CrateReader<'a>.visit..Visitor<'v>::visit_item::hed65f5c686d0cab949m
  11:         0x65b9e35f - metadata::creader::CrateReader<'a>::read_crates::ha65368decfa753bblon
  12:         0x6ef9eb3b - driver::assign_node_ids_and_map::h05e579775eaf79194Da
  13:         0x6ef82a66 - driver::compile_input::hd2fb89b180675596Tba
  14:         0x6f06460d - run_compiler::h282bf3c3999ca505x7b
  15:         0x6f062295 - run::h1c01070ec49f4ed0d7b
  16:         0x6f061bd9 - run::h1c01070ec49f4ed0d7b
  17:         0x6617d82c - rust_try
  18:         0x6617d809 - rust_try
  19:         0x6612d4d5 - rt::unwind::try::inner_try::h75b7bddb15a6c10cs8v
  20:         0x6f061d97 - run::h1c01070ec49f4ed0d7b
  21:         0x66140404 - sys::process::Command::cwd::heb9c93936e48371awUu
  22:         0x77a759cd - BaseThreadInitThunk

Could not compile `advapi32-sys`.

Caused by:
  Process didn't exit successfully: `rustc C:\Users\<name>\.cargo\registry\src\github.com-0a35038f75765ae4\advapi32-sy
s-0.1.2\build.rs --crate-name build_script_build --crate-type bin -C prefer-dynamic -g --out-dir Q:\projects\hello_world
\target\debug\build\advapi32-sys-cfef7a1f30f1e5f6 --emit=dep-info,link -L dependency=Q:\projects\hello_world\target\debu
g\deps -L dependency=Q:\projects\hello_world\target\debug\deps --extern build=Q:\projects\hello_world\target\debug\deps\
libbuild-304afb6bdff23d72.rlib -Awarnings` (exit code: 101)

@horatius83
Copy link
Author

The code was being compiled on a network-mapped drive in PowerShell if that helps at all.

@retep998
Copy link
Member

Ah, that would do it. Network mapped drives mean you don't see the results of your actions until some time later. Which also means that after doing something, like deleting a file, there is a short period in which that file hangs in limbo until the action is processed. In this case Rust is probably assuming the file is immediately available, but that's clearly false, and so it panics. The way to fix this would be to find every place where rustc works with files and make it loop a few times to try to open the file while sleeping between attempts.

@steveklabnik steveklabnik added the I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ label Sep 3, 2015
@horatius83
Copy link
Author

What does I-ICE mean? Sorry I'm new to Rust and not very knowledgeable about GitHub in general.

@caipre
Copy link
Contributor

caipre commented Sep 4, 2015

Internal Compiler Error. There used to be a wiki about such things, not sure where that knowledge lives now.

Edit: Here's a backup anyway: https://github.com/rust-lang/rust-wiki-backup/blob/7097b584ebcfe514df646347fcda1f0e12390614/Note-tag-label-names-and-definitions.md

@steveklabnik
Copy link
Member

@horatius83 are you still seeing this?

@retep998
Copy link
Member

retep998 commented Mar 1, 2017

This issue should probably remain open until someone has thoroughly tested building rust code on a network mapped drive and verified that there are no issues.

@horatius83
Copy link
Author

I am still observing, yes. Is there any particular build or anything I should test for my particular use-case?

@Mark-Simulacrum Mark-Simulacrum added C-bug Category: This is a bug. and removed C-bug Category: This is a bug. labels Jul 22, 2017
@steveklabnik steveklabnik changed the title "Could not compile advapi32-sys "Could not compile advapi32-sys on a network-mapped drive Dec 20, 2018
@Centril Centril added the T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. label Oct 25, 2019
@workingjubilee workingjubilee added the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Mar 15, 2023
@workingjubilee
Copy link
Member

workingjubilee commented Mar 15, 2023

I have been reviewing many older issues and trying to ascertain their applicability, whether they should be redirected, closed, left open, etc. Usually, I feel comfortable making a quick investigation and then deciding to leave it open or closed based on findings plus what seems to have been emerging consensus, and trying to document consensus. But with this one, I am at a bit of a loss.

So here, I formally am requesting a judgement from T-compiler on whether this issue, and indeed this class of issue, "Let's keep this open until we can be certain no issues are present in a known-faulty environment", is actionable or desirable, whether it should be broken down into smaller steps or simply cast to the winds, or even whether the changes over the past seven and a half years have made this issue functionally impossible to follow up on (e.g. due to implementing the incremental compilation system, which will tend to dominate over other kinds of filesystem issues). Or, perhaps, if those changes have given this one increased relevance.

@workingjubilee
Copy link
Member

I should also note there are, at a glance, many other network filesystem, shared partition, or ramdisk issues that have caused other interesting ICEs, some of which may be related and some of which are probably not, e.g.

@pnkfelix
Copy link
Member

Discussed at T-compiler triage.

We hypothesize:

  1. other people are still hitting ICE's, and are seeing this issue but not mentioning or leaving a "me too" comment (or are filing other issues, but not linking to this one)
  2. other people are hitting ICE's and not looking at our issue repo at all
  3. no one is hitting ICE's here anymore, and/or
  4. no one is using Windows network shares for rustc

In the absence of data to guide us into which one of the above four cases we are in, we are going to speculative close this issue. If you see this comment, and are someone that is running into this issue, please do open a new issue (with lots of info to help us know more about your specific scenario), or leave a comment and reopen this issue.

@workingjubilee workingjubilee removed the I-compiler-nominated Nominated for discussion during a compiler team meeting. label Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

9 participants