Skip to content
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

[win/asan] Failing to get instruction size of ucrtbase.dll strstr #125105

Closed
agudbrand opened this issue Jan 30, 2025 · 3 comments
Closed

[win/asan] Failing to get instruction size of ucrtbase.dll strstr #125105

agudbrand opened this issue Jan 30, 2025 · 3 comments
Labels
compiler-rt:asan Address sanitizer platform:windows question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!

Comments

@agudbrand
Copy link

Asan reports:

==44184==interception_win: unhandled instruction at 0x7ffff8c23a40: 44 0f b6 1a 4c 8b d2 48

Happening on a locally built llvm, compiling with clang++. When I initially built LLVM it wasn't working, but I rebuilt it and it started working, but I needed to rebuild it again and now it no longer works. I am building from this commit and the CMake command used to configure the build files was:

cmake ../../src/llvm -G "Visual Studio 17 2022" -DLLVM_OPTIMIZED_TABLEGEN=ON "-DLLVM_ENABLE_PROJECTS=clang;lld;compiler-rt;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -DLLVM_INCLUDE_TESTS=OFF  

LLVM was compiled using MSVC 2022 17.12.4. Asan is compiled into the program using -fsanitize=address.

@bernhardu
Copy link
Contributor

Hello, the commit you are building from should already include this line, so this instruction should be supported.

case 0x1ab60f44: // 44 0f b6 1a : movzx r11d, BYTE PTR [rdx]
return 4;

Could you maybe double check if you are using the right clang++ binary?

@agudbrand
Copy link
Author

Oh, I apologize for my confusion. It seems my LLVM clone was on a HEAD revision that must have been out of date. I unfortunately cannot test if swapping it to main has fixed it yet as I've found that I need to dynamically link the c runtime in my stuff so I can build a shared library and now when I try to link asan it gives me duplicate symbol errors on malloc, free, etc. I will let you know if that was the issue once I get my stuff working again.

@agudbrand
Copy link
Author

It seems that its impossible for me to get asan to link when dynamically linking the crt under windows, so I cannot properly test if it works now, but I will assume that the issue was just that I was unknowingly building an outdated llvm, so I'll close this issue.

@EugeneZelenko EugeneZelenko added the question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead! label Feb 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler-rt:asan Address sanitizer platform:windows question A question, not bug report. Check out https://llvm.org/docs/GettingInvolved.html instead!
Projects
None yet
Development

No branches or pull requests

4 participants