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

Windows incremental compilation error: Data Area Passed to a System Call Is Too Small #55812

Closed
jeppeter opened this issue Nov 9, 2018 · 3 comments
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jeppeter
Copy link

jeppeter commented Nov 9, 2018

Problem

Steps

  1. cargo new hello
  2. cargo run --

output

   Compiling hello v0.1.0 (Z:\hello)
error: incremental compilation: error canonicalizing path `Z:\hello\target\debug\incremental\hello-cevblbahc1gh`: Data Area Passed to a System Call Is Too Small。 (os error 122)

thread 'main' panicked at 'librustc\session\mod.rs:802: Trying to get session directory from IncrCompSession `NotInitialized`', librustc\util\bug.rs:47:26
stack backtrace:
   0: <std::sys::windows::args::Args as core::ops::drop::Drop>::drop
   1: <std::ffi::os_str::OsString as std::sys_common::IntoInner<std::sys::windows::os_str::Buf>>::into_inner
   2: std::panicking::take_hook
   3: std::panicking::take_hook
   4: <rustc::ty::sty::Binder<rustc::ty::ProjectionPredicate<'tcx>> as rustc::ty::ToPredicate<'tcx>>::to_predicate
   5: std::panicking::rust_panic_with_hook
   6: <usize as rustc::session::config::dep_tracking::DepTrackingHash>::hash
   7: rustc::util::bug::bug_fmt
   8: rustc::ty::context::tls::track_diagnostic
   9: rustc::ty::context::tls::track_diagnostic
  10: rustc::ty::context::tls::track_diagnostic
  11: rustc::util::bug::bug_fmt
  12: rustc::util::bug::bug_fmt
  13: rustc::session::Session::incr_comp_session_dir
  14: rustc_incremental::persist::fs::garbage_collect_session_directories
  15: rustc_driver::target_features::add_configuration
  16: rustc_driver::driver::count_nodes
  17: rustc_driver::driver::compile_input
  18: rustc_driver::run_compiler
  19: <env_logger::filter::inner::Filter as core::fmt::Display>::fmt
  20: rustc_driver::run_compiler
  21: <env_logger::filter::inner::Filter as core::fmt::Display>::fmt
  22: _rust_maybe_catch_panic
  23: rustc_driver::profile::dump
  24: rustc_driver::main
  25: <unknown>
  26: std::panicking::update_panic_count
  27: _rust_maybe_catch_panic
  28: std::rt::lang_start_internal
  29: <unknown>
  30: <unknown>
  31: BaseThreadInitThunk
  32: RtlUserThreadStart
query stack during panic:
end of query stack
error: aborting due to previous error


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: rustc 1.30.1 (1433507eb 2018-11-07) running on x86_64-pc-windows-msvc

note: compiler flags: -C debuginfo=2 -C incremental --crate-type bin

note: some of the compiler flags provided by cargo are hidden

error: Could not compile `hello`.

To learn more, run the command again with --verbose.

if i run with release mode ,there is no error code

cargo run --release --
that is running ok

i used virtual disk on ram file system on z:
i run in windows 7 sp1

Possible Solution(s)

Notes

Output of cargo version:

@alexcrichton alexcrichton transferred this issue from rust-lang/cargo Nov 9, 2018
@alexcrichton alexcrichton changed the title call cargo run error Windows incremental compilation error: Data Area Passed to a System Call Is Too Small Nov 9, 2018
@alexcrichton
Copy link
Member

Thanks for the report! I've transferred this to the rust-lang/rust repo as this looks like a bug activated by incremental compilation. The error here looks quite scary!

error: incremental compilation: error canonicalizing path `Z:\hello\target\debug\incremental\hello-cevblbahc1gh`: Data Area Passed to a System Call Is Too Small。 (os error 122)

The implementation of canonicalize for Windows is here and comes from this location.

What I don't understand is that we should handle ERROR_INSUFFICIENT_BUFFER here (what exit code 122 is) and resize the buffer..

Curious! Do you perhaps have instructions for how to set up a ram filesystem to reproduce this? I wonder if perhaps there's a driver in play that's acting oddly?

@retep998
Copy link
Member

There are already multiple existing issues open of Rust having issues with canonicalization on RAM drives.

@retep998 retep998 added the O-windows Operating system: Windows label Nov 10, 2018
@jonas-schievink jonas-schievink added 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. C-bug Category: This is a bug. labels Mar 24, 2019
@Centril Centril added the A-incr-comp Area: Incremental compilation label Mar 10, 2020
@Elinvynia
Copy link
Contributor

Could this be a duplicate of #48249 ?

@Enselic Enselic closed this as not planned Won't fix, can't repro, duplicate, stale Aug 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ O-windows Operating system: Windows 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

7 participants