Skip to content

ICE on Windows: "incorrect function" #40282

Closed
@icylogic

Description

@icylogic

It happens when I try to install xargo via cargo install xargo, but it's an internel compiler error so I think it should be reported here. I've searched for the error message "incorrect function", but there is no relevant issue. (#31178 seems to be related to VirtualBox)

Logs (with RUST_BACKTRACE=full)

If I run this command multiple times, the panic happens randomly on different packages.

Failed on dbghelp-sys

D:\Temp\empty_dir>cargo install xargo
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing xargo v0.3.5
   Compiling winapi-build v0.1.1
   Compiling gcc v0.3.43
   Compiling libc v0.2.21
   Compiling xargo v0.3.5
   Compiling backtrace v0.3.0
   Compiling dbghelp-sys v0.2.0
   Compiling dtoa v0.2.2
error: internal compiler error: unexpected panic

   Compiling semver v0.1.20
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: 1, message: "Incorrect function." } }', src\libcore\result.rs:860
stack backtrace:
   0:     0x7ff869012a1f - <std::time::SystemTimeError as core::fmt::Display>::fmt::h4979473f9576d1ed
   1:     0x7ff869024bcc - std::panicking::Location::line::h170804a3d9d5008a
   2:     0x7ff86902440d - std::panicking::Location::line::h170804a3d9d5008a
   3:     0x7ff8690250f1 - std::panicking::rust_panic_with_hook::h616f04586b77efa9
   4:     0x7ff869024fa8 - std::panicking::begin_panic_fmt::h028887a0b806a12e
   5:     0x7ff869024ec4 - std::panicking::begin_panic_fmt::h028887a0b806a12e
   6:     0x7ff869024e59 - rust_begin_unwind
   7:     0x7ff8690372e7 - core::panicking::panic_fmt::h9303d733b4241e2b
   8:     0x7ff874292568 - <unknown>
   9:     0x7ff87433f0af - rustc_metadata::locator::Context::report_errs::hda477d168a30f72f
  10:     0x7ff87432c071 - rustc_metadata::creader::CrateLoader::new::h7bf5da15849ecfc2
  11:     0x7ff87432a628 - rustc_metadata::creader::CrateLoader::new::h7bf5da15849ecfc2
  12:     0x7ff874333f26 - <rustc_metadata::creader::CrateLoader<'a> as rustc::middle::cstore::CrateLoader>::process_item::h258b2b401f5a9188
  13:     0x7ff87e256c7e - rustc_resolve::build_reduced_graph::<impl rustc_resolve::ToNameBinding<'a> for (rustc::hir::def::Def, rustc::ty::Visibility, syntax_pos::Span, syntax::ext::hygiene::Mark)>::to_name_binding::hf7964fb6f9d14b15
  14:     0x7ff87e25e5b3 - <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor<'a, 'b> as syntax::visit::Visitor<'a>>::visit_item::h70066d7c3e0a55b2
  15:     0x7ff87e25e80e - <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor<'a, 'b> as syntax::visit::Visitor<'a>>::visit_item::h70066d7c3e0a55b2
  16:     0x7ff87e24e68f - rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::visit_expansion::h529069ee8f38fea8
  17:     0x7ff85cfb400f - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  18:     0x7ff85cfad460 - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  19:     0x7ff85cfaccaa - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  20:     0x7ff879b6675f - rustc_driver::driver::count_nodes::h6cb58d80fe92ca42
  21:     0x7ff879b5af72 - rustc_driver::driver::count_nodes::h6cb58d80fe92ca42
  22:     0x7ff879b51e36 - rustc_driver::driver::compile_input::ha02e227e35183dfd
  23:     0x7ff879bb3cd8 - rustc_driver::run_compiler::h4601882a3e07ab36
  24:     0x7ff879aa9e5e - <unknown>
  25:     0x7ff869028261 - _rust_maybe_catch_panic
  26:     0x7ff879acb2b6 - <unknown>
  27:     0x7ff86902244e - std::sys::imp::thread::Thread::new::hf457da10939bdcb7
  28:     0x7ff8a5358363 - BaseThreadInitThunk

error: Could not compile `dbghelp-sys`.
Build failed, waiting for other jobs to finish...
error: failed to compile `xargo v0.3.5`, intermediate artifacts can be found at `R:\Temp\cargo-install.qv3ogdZnww8r`

Caused by:
  build failed

Failed on rustc_version

D:\Temp\empty_dir>cargo install xargo
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing xargo v0.3.5
   Compiling backtrace v0.3.0
   Compiling rustc-serialize v0.3.22
   Compiling itoa v0.1.1
   Compiling serde v0.8.23
   Compiling rustc-demangle v0.1.4
   Compiling semver v0.1.20
   Compiling num-traits v0.1.37
   Compiling rustc_version v0.1.7
   Compiling winapi v0.2.8
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: 1, message: "Incorrect function." } }', src\libcore\result.rs:860
stack backtrace:
   0:     0x7ff869012a1f - <std::time::SystemTimeError as core::fmt::Display>::fmt::h4979473f9576d1ed
   1:     0x7ff869024bcc - std::panicking::Location::line::h170804a3d9d5008a
   2:     0x7ff86902440d - std::panicking::Location::line::h170804a3d9d5008a
   3:     0x7ff8690250f1 - std::panicking::rust_panic_with_hook::h616f04586b77efa9
   4:     0x7ff869024fa8 - std::panicking::begin_panic_fmt::h028887a0b806a12e
   5:     0x7ff869024ec4 - std::panicking::begin_panic_fmt::h028887a0b806a12e
   6:     0x7ff869024e59 - rust_begin_unwind
   7:     0x7ff8690372e7 - core::panicking::panic_fmt::h9303d733b4241e2b
   8:     0x7ff868c12568 - <unknown>
   9:     0x7ff868cbf0af - rustc_metadata::locator::Context::report_errs::hda477d168a30f72f
  10:     0x7ff868cac071 - rustc_metadata::creader::CrateLoader::new::h7bf5da15849ecfc2
  11:     0x7ff868caa628 - rustc_metadata::creader::CrateLoader::new::h7bf5da15849ecfc2
  12:     0x7ff868cb3f26 - <rustc_metadata::creader::CrateLoader<'a> as rustc::middle::cstore::CrateLoader>::process_item::h258b2b401f5a9188
  13:     0x7ff87e0c6c7e - rustc_resolve::build_reduced_graph::<impl rustc_resolve::ToNameBinding<'a> for (rustc::hir::def::Def, rustc::ty::Visibility, syntax_pos::Span, syntax::ext::hygiene::Mark)>::to_name_binding::hf7964fb6f9d14b15
  14:     0x7ff87e0ce5b3 - <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor<'a, 'b> as syntax::visit::Visitor<'a>>::visit_item::h70066d7c3e0a55b2
  15:     0x7ff87e0ce80e - <rustc_resolve::build_reduced_graph::BuildReducedGraphVisitor<'a, 'b> as syntax::visit::Visitor<'a>>::visit_item::h70066d7c3e0a55b2
  16:     0x7ff87e0be68f - rustc_resolve::macros::<impl syntax::ext::base::Resolver for rustc_resolve::Resolver<'a>>::visit_expansion::h529069ee8f38fea8
  17:     0x7ff863b1400f - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  18:     0x7ff863b0d460 - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  19:     0x7ff863b0ccaa - syntax::ext::expand::MacroExpander::expand_crate::h9c2ada897f8517ae
  20:     0x7ff8742b675f - rustc_driver::driver::count_nodes::h6cb58d80fe92ca42
  21:     0x7ff8742aaf72 - rustc_driver::driver::count_nodes::h6cb58d80fe92ca42
  22:     0x7ff8742a1e36 - rustc_driver::driver::compile_input::ha02e227e35183dfd
  23:     0x7ff874303cd8 - rustc_driver::run_compiler::h4601882a3e07ab36
  24:     0x7ff8741f9e5e - <unknown>
  25:     0x7ff869028261 - _rust_maybe_catch_panic
  26:     0x7ff87421b2b6 - <unknown>
  27:     0x7ff86902244e - std::sys::imp::thread::Thread::new::hf457da10939bdcb7
  28:     0x7ff8a5358363 - BaseThreadInitThunk

error: Could not compile `rustc_version`.
Build failed, waiting for other jobs to finish...
error: failed to compile `xargo v0.3.5`, intermediate artifacts can be found at `R:\Temp\cargo-install.udJV5z3WDfuT`

Caused by:
  build failed

Details

  • rustc version:

    rustc 1.17.0-nightly (691eba135 2017-03-01)
    binary: rustc
    commit-hash: 691eba1358fc3c9c7a8033314a4112d43680c128
    commit-date: 2017-03-01 
    host: x86_64-pc-windows-msvc
    release: 1.17.0-nightly
    LLVM version: 3.9
    
  • The toolchain stable-x86_64-pc-windows-msvc (rustc 1.15.1), nightly-x86_64-pc-windows-gnu does not work either.

  • It also failed on rand and other packages.

  • When RUST_LOG is set to debug, the output has 618563 lines and i could not found any helpful information different from the backtrace.

  • I've tried a different binary package from Cargo like gcc and it is installed without problem.

  • I've also managed to clone rustc-version from the repo (https://github.com/Kimundi/rustc-version-rs/tree/v0.1.7) and dbghelp-sys from the repo (https://github.com/retep998/winapi-rs) and build them using cargo build, cargo build --release.

  • The command runs successfully on Linux

    rustc 1.17.0-nightly (691eba135 2017-03-01)
    binary: rustc
    commit-hash: 691eba1358fc3c9c7a8033314a4112d43680c128
    commit-date: 2017-03-01
    host: x86_64-unknown-linux-gnu
    release: 1.17.0-nightly
    LLVM version: 3.9
    

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️O-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions