Skip to content

ICE: Result::unwrap() on an Err value: couldn't rename path #17951

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

Closed
msiemens opened this issue Oct 11, 2014 · 3 comments · Fixed by #18239
Closed

ICE: Result::unwrap() on an Err value: couldn't rename path #17951

msiemens opened this issue Oct 11, 2014 · 3 comments · Fixed by #18239

Comments

@msiemens
Copy link
Contributor

Tried to compile rustc@9b9833299245cc1eac68b52169e9152d0f412d6b on my Windows 7 x64 (MSYS2) when it crashed. Crashed even after running make clean first. For the record, I tried to compile with RUSTFLAGS='-C codegen-units=8' set.

$ export RUSTFLAGS='-C codegen-units=8'
$ make RUST_BACKTRACE=1
cfg: build triple i686-w64-mingw32
cfg: host triples i686-w64-mingw32
cfg: target triples i686-w64-mingw32
cfg: host for i686-w64-mingw32 is i386
cfg: os for i686-w64-mingw32 is w64-mingw32
cfg: using CC=gcc (CFG_CC)
cfg: disabling valgrind due to its unreliability on this platform
cfg: no llnextgen found, omitting grammar-verification
cfg: disabling doc build (CFG_DISABLE_DOCS)
rustc: i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/librand
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x2b0): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x300): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x170): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x1c0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x110): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x160): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.4.o:(.rdata+0x2aa0): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.4.o:(.rdata+0x3b10): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.5.o:(.rdata+0x70): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.5.o:(.rdata+0xc0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.6.o:(.rdata+0x70): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.6.o:(.rdata+0xc0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.7.o:(.rdata+0x70): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h3a06d40217e7486bdMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.7.o:(.rdata+0xc0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h3a06d40217e7486bwgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
collect2.exe: error: ld returned 1 exit status
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'called `Result::unwrap()` on an `Err` value: couldn't rename path (file not found (OS Error 2: Das System kann die angegebene Datei nicht finden.
); from=i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.o.exe; to=i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.o)', C:\bot\slave\snap3-win-32\build\src\libcore\result.rs:808

stack backtrace:
   1:  0x1e64dca - main
   2:  0x1e7be1c - main
   3:  0x1e7bbad - main
   4:  0x1e7b9c5 - main
   5:  0x1ecb31f - main
   6:   0x432cd2 - main
   7:   0x42fc69 - main
   8:   0xd04e86 - main
   9:   0x421d49 - main
  10:   0xcb3de1 - main
  11:   0xcaccfc - main
  12:   0xd2df45 - main
  13:   0xd2bea4 - main
  14:   0x439e7e - main
  15:   0x439dc6 - main
  16:  0x1abe123 - main
  17:  0x1e7b81c - main
  18:  0x1e79dfe - main
  19:  0x1abdf91 - main
  20:  0x1e7b507 - main
  21: 0x777e9f72 - RtlInitializeExceptionChain

/f/Dokumente/Coding/rust/rust-lang/mk/target.mk:166: recipe for target 'i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/stamp.rand' failed
make: *** [i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/stamp.rand] Error 101
@msiemens
Copy link
Contributor Author

As of c245c5b parallel codegen is enabled by default. Thus, the crash always occurs when compiling rustc. I was now able to get the full stack backtrace:

$ RUST_BACKTRACE=1 make
cfg: build triple i686-w64-mingw32
cfg: host triples i686-w64-mingw32
cfg: target triples i686-w64-mingw32
cfg: host for i686-w64-mingw32 is i386
cfg: os for i686-w64-mingw32 is w64-mingw32
cfg: using CC=ccache gcc (CFG_CC)
cfg: disabling valgrind due to its unreliability on this platform
cfg: no llnextgen found, omitting grammar-verification
cfg: disabling doc build (CFG_DISABLE_DOCS)
rustc: i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/librand
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x2a0): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h5ef920f83fd19327dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.1.o:(.rdata+0x2f0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h5ef920f83fd19327Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x170): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h5ef920f83fd19327dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.2.o:(.rdata+0x1c0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h5ef920f83fd19327Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x2b30): multiple definition of `isaac::IsaacRng.Rng::next_u32::_MSG_FILE_LINE::h5ef920f83fd19327dMb'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x3f0): first defined here
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.3.o:(.rdata+0x3ba0): multiple definition of `isaac::Isaac64Rng.Rng::next_u64::_MSG_FILE_LINE::h5ef920f83fd19327Mgc'
i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.0.o:(.rdata+0x440): first defined here
collect2.exe: error: ld returned 1 exit status
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'called `Result::unwrap()` on an `Err` value: couldn't rename path (file not found (OS Error 2: Das System kann die angegebene Datei nicht finden.
); from=i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.o.exe; to=i686-w64-mingw32\stage0\bin\rustlib\i686-w64-mingw32\lib\rand-4e7c5e5c.o)', F:\Dokumente\Coding\rust\rust-lang\src\libcore\result.rs:789

stack backtrace:
   1:   0x8235cc - ZN2rt4init20hfcca88ec6cfbbb64PVqE
   2: 0x6290651c - ZN6unwind18begin_unwind_inner20hbadd90e57916f74csgdE
   3: 0x629062ad - ZN6unwind16begin_unwind_fmt20h35cd0cf23edb2fe5UddE
   4: 0x629060c5 - rust_begin_unwind
   5: 0x62963c4f - ZN7failure8fail_fmt20h6f560916285a7c12r6jE
   6: 0x6fcf1e72 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20h92f308eb1ecaa85dMFAE
   7: 0x6fceee19 - ZN4back5write10run_passes20hb458ae00ff4146b2kScE
   8: 0x704ddbd6 - ZN4lint7context11check_crate20h74ddfe7130dd0539a7HE
   9: 0x6fce1109 - ZN8metadata6cstore6CStore21get_used_crate_source20h44586f0b7c3e05a3VvxE
  10: 0x7048a94a - ZN6driver6driver23phase_5_run_llvm_passes20h2f933419587f07ecgkAE
  11: 0x70484285 - ZN6driver6driver13compile_input20h425d923af718a892iQzE
  12: 0x70504dec - ZN6driver7monitor20h65c71efef7bbade2xrEE
  13: 0x70502db4 - ZN6driver7monitor20h65c71efef7bbade2xrEE
  14: 0x6fcf908e - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20h92f308eb1ecaa85dMFAE
  15: 0x6fcf8fd6 - ZN6driver6driver35OutputFilenames...std..clone..Clone5clone20h92f308eb1ecaa85dMFAE
  16: 0x6aee9d43 - ZN4task15Ops.rt..Runtime4wrap20h0122d5dc6ff0992dVxeE
  17: 0x62905f1c - ZN6unwind8Unwinder9unwinding20hd2e2793548e8061dX4cE
  18: 0x629044fe - ZN4task4Task3run20h2fd13b26e6c6503aAzcE
  19: 0x6aee9bb1 - ZN4task15Ops.rt..Runtime4wrap20h0122d5dc6ff0992dVxeE
  20: 0x62905c07 - ZN4task11BlockedTask14cast_from_uint20hae61d96ed7595d1cdScE
  21: 0x772a9f72 - RtlInitializeExceptionChain

/f/Dokumente/Coding/rust/rust-lang/mk/target.mk:166: recipe for target 'i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/stamp.rand' failed
make: *** [i686-w64-mingw32/stage0/bin/rustlib/i686-w64-mingw32/lib/stamp.rand] Error 101

@alexcrichton
Copy link
Member

cc @epdtry (looks like a duplicate codegen bug)

@msiemens
Copy link
Contributor Author

Actually we have two different problems here:

  1. The ICE when linking fails on Windows. I've made an attempt to fix it in rustc: Fail immediately if linking returns status code != 0 #18239
  2. Linking of librand fails with parallel codegen. I've created a new issue (multiple definition in librand with parallel codegen #18243) to not confuse these two.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants