Skip to content

error: incremental compilation: could not create session directory lock file: Input/output error (os error 5) #76251

Closed
@allenzhao64

Description

@allenzhao64

I tried this code:

$ cargo build
error: incremental compilation: could not create session directory lock file: Input/output error (os error 5)

thread 'rustc' panicked at 'trying to get session directory from `IncrCompSession`: NotInitialized', src/librustc_session/session.rs:840:48
stack backtrace:
   Compiling term v0.6.1
   Compiling rand v0.6.5
   0:     0x7f53f5fcd0d5 - backtrace::backtrace::libunwind::trace::h396c07d2071b43af
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/libunwind.rs:86
   1:     0x7f53f5fcd0d5 - backtrace::backtrace::trace_unsynchronized::h7aa0e4bb23d9c158
                               at /cargo/registry/src/github.com-1ecc6299db9ec823/backtrace-0.3.46/src/backtrace/mod.rs:66
   2:     0x7f53f5fcd0d5 - std::sys_common::backtrace::_print_fmt::hd15ac5d4adcd355b
                               at src/libstd/sys_common/backtrace.rs:78
   3:     0x7f53f5fcd0d5 - <std::sys_common::backtrace::_print::DisplayBacktrace as core::fmt::Display>::fmt::hec5354be8ccc3ecc
                               at src/libstd/sys_common/backtrace.rs:59
   4:     0x7f53f600a7ec - core::fmt::write::h3d34909eeb4f225b
                               at src/libcore/fmt/mod.rs:1076
   5:     0x7f53f5fbf7e3 - std::io::Write::write_fmt::h1da287b3de55ed16
                               at src/libstd/io/mod.rs:1537
   6:     0x7f53f5fd20f0 - std::sys_common::backtrace::_print::h4d206838e1ace354
                               at src/libstd/sys_common/backtrace.rs:62
   7:     0x7f53f5fd20f0 - std::sys_common::backtrace::print::h1f778e9940ee5977
                               at src/libstd/sys_common/backtrace.rs:49
   8:     0x7f53f5fd20f0 - std::panicking::default_hook::{{closure}}::h704403a56cbf5783
                               at src/libstd/panicking.rs:198
   9:     0x7f53f5fd1e3c - std::panicking::default_hook::ha4567a10dec4ef8d
                               at src/libstd/panicking.rs:218
  10:     0x7f53f66fc5c3 - rustc_driver::report_ice::h162d93c732cfa263
  11:     0x7f53f5fd279c - std::panicking::rust_panic_with_hook::h88a1f16ec8a7bb20
                               at src/libstd/panicking.rs:490
  12:     0x7f53f5fd237b - rust_begin_unwind
                               at src/libstd/panicking.rs:388
  13:     0x7f53f5fd22eb - std::panicking::begin_panic_fmt::ha3ac96e620978458
                               at src/libstd/panicking.rs:342
  14:     0x7f53f91d81d3 - rustc_session::session::Session::incr_comp_session_dir::h15dc136056f816e8
  15:     0x7f53f7f768e2 - rustc_incremental::persist::fs::garbage_collect_session_directories::hc4ddf55a33fd9839
  16:     0x7f53f690dc10 - rustc_session::utils::<impl rustc_session::session::Session>::time::h559d22a69e3f6c89
  17:     0x7f53f68af60d - rustc_interface::queries::Queries::register_plugins::h618f60f3b86c029d
  18:     0x7f53f66c01f8 - rustc_interface::interface::run_compiler_in_existing_thread_pool::h71a70a633e2a927e
  19:     0x7f53f670b3bf - rustc_ast::attr::with_globals::hb004aafbc16d2612
  20:     0x7f53f671040e - std::sys_common::backtrace::__rust_begin_short_backtrace::h547683b640c7a8c7
  21:     0x7f53f66c3c2e - core::ops::function::FnOnce::call_once{{vtable.shim}}::hcb850442add305d8
  22:     0x7f53f5fe20fa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::hcf205bcf9b46c587
                               at /rustc/5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2/src/liballoc/boxed.rs:1076
  23:     0x7f53f5fe20fa - <alloc::boxed::Box<F> as core::ops::function::FnOnce<A>>::call_once::h2d53e2246128f5d8
                               at /rustc/5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2/src/liballoc/boxed.rs:1076
  24:     0x7f53f5fe20fa - std::sys::unix::thread::Thread::new::thread_start::h3b6d8a0cd87a87c6
                               at src/libstd/sys/unix/thread.rs:87
  25:     0x7f53f5d49aa1 - start_thread
  26:     0x7f53f568aaad - __clone
  27:                0x0 - <unknown>

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.45.0 (5c1f21c3b 2020-07-13) running on x86_64-unknown-linux-gnu

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

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

query stack during panic:
end of query stack

Meta

rustc --version --verbose:

linux-2018.gtisoft.com:/Ydir/savesets/v2022/g/lib/gtchannel/gtchannel_core # rustc --version --verbose
rustc 1.45.0 (5c1f21c3b 2020-07-13)
binary: rustc
commit-hash: 5c1f21c3b82297671ad3ae1e8c942d2ca92e84f2
commit-date: 2020-07-13
host: x86_64-unknown-linux-gnu
release: 1.45.0
LLVM version: 10.0

Backtrace

<backtrace>

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.P-mediumMedium priority

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions