Skip to content

tests/ui/sanitizier/asan_odr_windows.rs is broken on Windows MSVC with or without lld #140189

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
jieyouxu opened this issue Apr 23, 2025 · 1 comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@jieyouxu
Copy link
Member

jieyouxu commented Apr 23, 2025

Summary

tests/ui/sanitizier/asan_odr_windows.rs is broken on (native) Windows MSVC with or without lld (on a fresh msvc checkout).

Possibly related issues

Maybe related to:

But I don't consider this issue a duplicate, since it's failing on a fresh msvc checkout even if I explicitly spell

# bootstrap.toml

[rust]
lld = false

And AFAICT lld-link isn't used.

Failure message

--- stderr -------------------------------
error: linking with `link.exe` failed: exit code: 1104
   |
   = note: "C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.43.34808\\bin\\HostX64\\x64\\link.exe" "/NOLOGO" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\rustc5VvqWv\\symbols.o" "/INFERASANLIBS" "<1 object files omitted>" "X:\\repos\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\sanitizer\\asan_odr_windows\\auxiliary/{libothercrate.rlib}.rlib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib\\std-7e6f771a69e47fd0.dll.lib" "<sysroot>\\lib\\rustlib\\x86_64-pc-windows-msvc\\lib/{libcompiler_builtins-*}.rlib" "kernel32.lib" "kernel32.lib" "ntdll.lib" "userenv.lib" "ws2_32.lib" "dbghelp.lib" "/defaultlib:msvcrt" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\rustc5VvqWv\\api-ms-win-core-synch-l1-2-0.dll_imports_indirect.lib" "C:\\Users\\ADMINI~1\\AppData\\Local\\Temp\\rustc5VvqWv\\bcryptprimitives.dll_imports_indirect.lib" "/NXCOMPAT" "/LIBPATH:X:\\repos\\rust\\build\\x86_64-pc-windows-msvc\\native\\rust-test-helpers" "/LIBPATH:X:\\repos\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\sanitizer\\asan_odr_windows\\auxiliary" "/OUT:X:\\repos\\rust\\build\\x86_64-pc-windows-msvc\\test\\ui\\sanitizer\\asan_odr_windows\\a.exe" "/OPT:REF,ICF" "/DEBUG" "/PDBALTPATH:%_PDB%"
   = note: some arguments are omitted. use `--verbose` to show all linker arguments
   = note: LINK : fatal error LNK1104: cannot open file 'clang_rt.asan_dynamic_runtime_thunk-x86_64.lib'␍


error: aborting due to 1 previous error
------------------------------------------

What I also tried

//@ compile-flags: -Zexternal-clangrt

Did not help either.

# bootstrap.toml
[build]
sanitiziers = true

Didn't help.

@jieyouxu jieyouxu added A-sanitizers Area: Sanitizers for correctness and code quality A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 23, 2025
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 23, 2025
@jieyouxu jieyouxu added O-windows-msvc Toolchain: MSVC, Operating system: Windows and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 23, 2025
@jieyouxu jieyouxu closed this as not planned Won't fix, can't repro, duplicate, stale Apr 23, 2025
@jieyouxu
Copy link
Member Author

Actually I believe it's somehow my visual studio setup that's being a problem. I had a stale PATH entry that was used to debug a different problem, updating the toolchain + removing the stale entry seems to fix this.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-sanitizers Area: Sanitizers for correctness and code quality A-testsuite Area: The testsuite used to check the correctness of rustc C-bug Category: This is a bug. O-windows-msvc Toolchain: MSVC, Operating system: Windows T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

2 participants