[clang] [compiler-rt] Reland [asan][windows] Eliminate the static asan runtime on windows (PR #107899)
via cfe-commits
cfe-commits at lists.llvm.org
Wed Sep 18 06:04:55 PDT 2024
zmodem wrote:
After this change we're running into #34485 ("ASan strtol interceptor breaks errno on Windows"):
```
C:\src\chromium\src>type a.cc
#include <stdio.h>
#include <stdlib.h>
int main() {
errno = 0;
long result = strtol("2147483648", nullptr, 10);
printf("errno: %d\n", errno);
printf("result: %ld\n", result);
return 0;
}
C:\src\chromium\src>"third_party\llvm-build\Release+Asserts\bin\clang-cl.exe" a.cc /Feout\Release\a.exe && out\Release\a.exe
errno: 34
result: 2147483647
C:\src\chromium\src>"third_party\llvm-build\Release+Asserts\bin\clang-cl.exe" -fsanitize=address a.cc /Feout\Release\a.exe && out\Release\a.exe
errno: 0
result: 2147483647
```
That's an old bug, but it wasn't a problem in Chromium until this runtime change.
It sounds like Visual Studio users also hit this before: https://developercommunity.visualstudio.com/t/Cannot-detect-strtol-range-errors-with-A/10412869 Do you know what the fix for that was?
https://github.com/llvm/llvm-project/pull/107899
More information about the cfe-commits
mailing list