<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/126077>126077</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [asan][win] memcpy is not alias for memmove with dynamic setup on latest Windows
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          yingcong-wu
      </td>
    </tr>
</table>

<pre>
    I have seen the following error on some of our internal test machines
```
Failed Tests (5):
  AddressSanitizer-Unit :: ./Asan-x86_64-calls-Dynamic-Test.exe/AddressSanitizer/MemCpyOOBTest
 AddressSanitizer-Unit :: ./Asan-x86_64-inline-Dynamic-Test.exe/AddressSanitizer/MemCpyOOBTest
 AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cpp
 AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/intercept_memcpy.cpp
 AddressSanitizer-x86_64-windows-dynamic :: TestCases/memset_test.cpp
```

After some investigation, with the latest Windows setup(these failures only reproduced on those setup) and dynamic setup(the static test config does not have these failures), 
```
#elif SANITIZER_WINDOWS64
#define PLATFORM_HAS_DIFFERENT_MEMCPY_AND_MEMMOVE 0
```
is not true anymore. The `memcpy` is not the alias for `memmove`, and we will have to intercept them both. However, simply changing this to `1` for Windows, although it can fix the failures for latest Windows, would bring huge regression for not-so-update-to-date Windows.

I have no further idea how to solve this problem, but I think this would affect more users with time after users update their OS and runtime. And I don't sure which part of the environment is causing this difference.

System information:
```
OS: Microsoft Windows 11 Enterprise LTSC 24H2 10.0.26100
msvcrt.dll version: 7.0.26100.1882
vcruntime140.dll version: 14.42.34433.0
```
I don't know if this information is enough, and I am happy to provide other information if needed.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysVV2vozgM_TXpi1UEgX499IHpvdVUmns7mt7d0e5LlRID3gkJSkK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