Skip to content

Failure on maketest: c-dynamic-dylib #18733

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
retep998 opened this issue Nov 7, 2014 · 11 comments
Closed

Failure on maketest: c-dynamic-dylib #18733

retep998 opened this issue Nov 7, 2014 · 11 comments

Comments

@retep998
Copy link
Member

retep998 commented Nov 7, 2014

When running make check on Windows 8.1 x64 with MSYS2 using the 64-bit toolchain (also tested with external mingw-w64 toolchains and alternate msys tools), I get the following error:

maketest: c-dynamic-dylib
----- A:/msys64/home/retep998/rust/src/test/run-make/c-dynamic-dylib/ --------------------
------ stdout ---------------------------------------------
make[1]: Entering directory '/home/retep998/rust/src/test/run-make/c-dynamic-dylib'
gcc -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600  -L /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib -c -o /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/libcfoo.o cfoo.c
gcc -Wall -Werror -g -m64 -D_WIN32_WINNT=0x0600  -L /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib -o /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/cfoo.dll /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/libcfoo.o -shared
PATH="/A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib:/A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/git/bin:/a/rust64/bin:/a/cmake/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib -L /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib foo.rs -C prefer-dynamic
PATH="/A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib:/A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/stage2/bin:/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/git/bin:/a/rust64/bin:/a/cmake/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl" /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/stage2/bin/rustc.exe --out-dir /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib -L /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib bar.rs
PATH="/mingw64/bin:/mingw64/bin:/usr/local/bin:/usr/bin:/usr/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/git/bin:/a/rust64/bin:/a/cmake/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/stage1/bin/rustlib/x86_64-pc-windows-gnu/lib" /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/bar
Makefile:9: recipe for target 'all' failed
rm /A/msys64/home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/libcfoo.o
make[1]: Leaving directory '/home/retep998/rust/src/test/run-make/c-dynamic-dylib'

------ stderr ---------------------------------------------
make[1]: *** [all] Error 127

------        ---------------------------------------------

/home/retep998/rust/mk/tests.mk:1062: recipe for target 'x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib-2-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu.ok' failed
make: *** [x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib-2-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu.ok] Error 2

Attempting to run the exe for that test in gdb results in a failure during startup.

(gdb) set environment PATH="/mingw64/bin:/usr/local/bin:/usr/bin:/bin:/c/WINDOWS/system32:/c/WINDOWS:/a/mingw/mingw64/bin:/a/git/bin:/a/rust64/bin:/a/cmake/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/retep998/rust/x86_64-pc-windows-gnu/stage1/bin/rustlib/x86_64-pc-windows-gnu/lib"
(gdb) run
Starting program: /home/retep998/rust/x86_64-pc-windows-gnu/test/run-make/c-dynamic-dylib/bar.exe
[New Thread 8140.0x20e8]
gdb: unknown target exception 0xc0000139 at 0x7ffc4401c0b4
During startup program exited with code 0xc0000139.
@Gankra
Copy link
Contributor

Gankra commented Nov 22, 2014

I get the exact same issue on Win8 x64

@retep998
Copy link
Member Author

cc @vadimcn @cmr @alexcrichton

@vadimcn
Copy link
Contributor

vadimcn commented Nov 23, 2014

My 64-bit build passes tests without any errors.
BTW, 0xc0000139 means "DLL Entry Point Not Found", i.e. a missing exported function in some dll. What happens if you just run bar.exe without gdb?

@retep998
Copy link
Member Author

I think I figured out the issue. Apparently the problem was that my installed Rust was in the PATH, so if I removed that from my PATH, it worked just fine. Fortunately I installed it to a separate location so it was easy to do so, although if someone installed it without a custom prefix in msys2, it could be a bit tricky.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 23, 2014

if you installed it without a custom prefix, make uninstall will do the job, too

@retep998
Copy link
Member Author

I tried to do make check-stage1-std today, and it failed with a similar error and went away once I removed my existing Rust from my PATH.

@Diggsey
Copy link
Contributor

Diggsey commented Jan 20, 2015

I ran into this problem as well. Why is it looking in the path for rustc at all, it should know the exact path to the version of rustc currently being tested?

@bombless
Copy link
Contributor

@Diggsey I think it's the dynamic linking part that makes it fail, not the rustc part.

@Marwes
Copy link
Contributor

Marwes commented May 29, 2015

Still an issue and I could not get the workaround that retep998 posted to work.

@Diggsey
Copy link
Contributor

Diggsey commented Aug 5, 2015

edit:
Actually, this was caused by something else, ignore me.

This still happens even if there is no rust installation on PATH: I've reconfigured msys so that it doesn't inherit my windows environment variables, but I still get the exact same error:

$ make check-stage1-std NO_REBUILD=1 NO_BENCH=1
cfg: version 1.4.0-dev (d03456183 2015-08-05)
cfg: build triple x86_64-pc-windows-gnu
cfg: host triples x86_64-pc-windows-gnu
cfg: target triples x86_64-pc-windows-gnu
cfg: host for x86_64-pc-windows-gnu is x86_64
cfg: os for x86_64-pc-windows-gnu is pc-windows-gnu
cfg: good valgrind for x86_64-pc-windows-gnu is
cfg: using CC=gcc (CFG_CC)
cfg: disabling valgrind run-pass tests
cfg: no xelatex found, disabling LaTeX docs
cfg: no pandoc found, omitting PDF and EPUB docs
cfg: including test rules
cfg: javac not available, skipping lexer test...
run: x86_64-pc-windows-gnu/stage1/test/stdtest-x86_64-pc-windows-gnu.exe
/c/Users/Diggory/Projects/rust/x86_64-pc-windows-gnu/stage1/test/stdtest-x86_64-pc-windows-gnu.exe: error while loading shared libraries: test-a5fc0d6c.dll: cannot open shared object file: No such file or directory
                                                      /c/Users/Diggory/Projects/rust/mk/tests.mk:450: recipe for target 'tmp/check-stage1-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu-std.ok' failed
make: *** [tmp/check-stage1-T-x86_64-pc-windows-gnu-H-x86_64-pc-windows-gnu-std.ok] Error 127

Diggory@Diggory-Laptop MINGW64 /c/Users/Diggory/Projects/rust
$ rustc
bash: /usr/local/bin/rustc: No such file or directory

@alexcrichton
Copy link
Member

I think this was fixed in #27553, so closing.

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

No branches or pull requests

9 participants