Skip to content

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

Closed as not planned

Description

@jeppeter

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:

Activity

  1. changed the title [-]call cargo run error[/-] [+]Windows incremental compilation error: Data Area Passed to a System Call Is Too Small[/+] on Nov 9, 2018
  2. alexcrichton commented on Nov 9, 2018

    @alexcrichton
    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?

  3. retep998 commented on Nov 10, 2018

    @retep998
    Contributor

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

  4. added
    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.
    C-bugCategory: This is a bug.
    on Mar 24, 2019
  5. Elinvynia commented on May 10, 2020

    @Elinvynia
    Contributor

    Could this be a duplicate of #48249 ?

  6. added a commit that references this issue on Sep 3, 2026
  7. added 3 commits that reference this issue on Sep 3, 2026
  8. added a commit that references this issue on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-windowsOperating system: WindowsT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions