[compiler-rt] [compiler-rt][asan] _aligned_malloc/_aligned_free interception. (PR #82049)

via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 18 04:26:59 PST 2024


zmodem wrote:

The latest version of the test fails for me:

```
--

********************
Testing:  0.. 10.. 20.. 30.. 40
FAIL: AddressSanitizer-x86_64-windows :: TestCases/Windows/aligned_mallocs.cpp (511 of 2773)
******************** TEST 'AddressSanitizer-x86_64-windows :: TestCases/Windows/aligned_mallocs.cpp' FAILED ********************
Exit Code: 1169

Command Output (stdout):
--
# RUN: at line 1
C:/src/llvm-project/build/./bin/clang-cl.exe  -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0 -gline-tables-only -gcodeview -gcolumn-info      -Od C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp -FeC:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp
# executed command: C:/src/llvm-project/build/./bin/clang-cl.exe -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0 -gline-tables-only -gcodeview -gcolumn-info -Od 'C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp' '-FeC:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp'
# .---command stdout------------
# | libucrt.lib(align.obj) : error LNK2005: _aligned_free already defined in clang_rt.asan_static_runtime_thunk-x86_64.lib(asan_malloc_win_thunk.cpp.obj)
# | libucrt.lib(align.obj) : error LNK2005: _aligned_malloc already defined in clang_rt.asan_static_runtime_thunk-x86_64.lib(asan_malloc_win_thunk.cpp.obj)
# | libucrt.lib(align.obj) : error LNK2005: _aligned_msize already defined in clang_rt.asan_static_runtime_thunk-x86_64.lib(asan_malloc_win_thunk.cpp.obj)
# | libucrt.lib(align.obj) : error LNK2005: _aligned_realloc already defined in clang_rt.asan_static_runtime_thunk-x86_64.lib(asan_malloc_win_thunk.cpp.obj)
# | C:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp : fatal error LNK1169: one or more multiply defined symbols found
# `-----------------------------
# .---command stderr------------
# | clang-cl: error: linker command failed with exit code 1169 (use -v to see invocation)
# `-----------------------------
# error: command failed with exit status: 0x491

--

********************
Testing:  0.. 10.. 20.. 30.. 40
FAIL: AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/aligned_mallocs.cpp (528 of 2773)
******************** TEST 'AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/aligned_mallocs.cpp' FAILED ********************
Exit Code: 1

Command Output (stdout):
--
# RUN: at line 1
C:/src/llvm-project/build/./bin/clang-cl.exe  -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0 -gline-tables-only -gcodeview -gcolumn-info      -MD -Od C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp -FeC:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsDynamicConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp
# executed command: C:/src/llvm-project/build/./bin/clang-cl.exe -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0 -gline-tables-only -gcodeview -gcolumn-info -MD -Od 'C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp' '-FeC:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsDynamicConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp'
# RUN: at line 2
not  C:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsDynamicConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp 2>&1 | FileCheck C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp
# executed command: not 'C:\src\llvm-project\build\projects\compiler-rt\test\asan\X86_64WindowsDynamicConfig\TestCases\Windows\Output\aligned_mallocs.cpp.tmp'
# executed command: FileCheck 'C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp'
# .---command stderr------------
# | C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp:43:12: error: CHECK: expected string not found in input
# |  // CHECK: AddressSanitizer: heap-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
# |            ^
# | <stdin>:1:1: note: scanning from here
# | =================================================================
# | ^
# | <stdin>:2:12: note: possible intended match here
# | ==13304==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x118669aa058e in thread T0
# |            ^
# |
# | Input file: <stdin>
# | Check file: C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# |             1: =================================================================
# | check:43'0     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
# |             2: ==13304==ERROR: AddressSanitizer: attempting free on address which was not malloc()-ed: 0x118669aa058e in thread T0
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# | check:43'1                ?                                                                                                         possible intended match
# |             3:  #0 0x7ffde9be6e36 in free C:\src\llvm-project\compiler-rt\lib\asan\asan_malloc_win.cpp:71
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             4:  #1 0x7ff6936f1295 in main C:\src\llvm-project\compiler-rt\test\asan\TestCases\Windows\aligned_mallocs.cpp:39:3
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             5:  #2 0x7ff6936f2653 in invoke_main D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:78
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             6:  #3 0x7ff6936f2653 in __scrt_common_main_seh D:\a\_work\1\s\src\vctools\crt\vcstartup\src\startup\exe_common.inl:288
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             7:  #4 0x7ffe45857373 (C:\Windows\System32\KERNEL32.DLL+0x180017373)
# | check:43'0     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# |             .
# |             .
# |             .
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1

--
```

https://github.com/llvm/llvm-project/pull/82049


More information about the llvm-commits mailing list