[PATCH] D98903: [SanitizerCoverage] Make __start_/__stop_ symbols extern_weak

Vitaly Buka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 22 22:58:07 PDT 2021


vitalybuka added a comment.

LGTM, I assume problem the patch is solving is not an issues on Windows?

In D98903#2643603 <https://reviews.llvm.org/D98903#2643603>, @MaskRay wrote:

> In D98903#2643589 <https://reviews.llvm.org/D98903#2643589>, @vitalybuka wrote:
>
>> https://lab.llvm.org/buildbot/#/builders/127/builds/8015 fails like this
>>
>>   ******************** TEST 'AddressSanitizer-x86_64-windows :: TestCases/Window
>>   coverage-dll-stdio.cpp' FAILED ********************
>>   Script:
>>   --
>>   : 'RUN: at line 4';   rm -rf C:\b\slave\sanitizer-windows\build\stage1\project
>>   compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Windows\Output\coverage-dl
>>   stdio.cpp.tmp && mkdir C:\b\slave\sanitizer-windows\build\stage1\projects\comp
>>   er-rt\test\asan\X86_64WindowsConfig\TestCases\Windows\Output\coverage-dll-stdi
>>   cpp.tmp && cd C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\t
>>   t\asan\X86_64WindowsConfig\TestCases\Windows\Output\coverage-dll-stdio.cpp.tmp
>>   : 'RUN: at line 5';      C:/b/slave/sanitizer-windows/build/stage1/./bin/clang
>>   l.exe  -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0
>>   Zi     -fsanitize-coverage=func,trace-pc-guard -Od C:\b\slave\sanitizer-window
>>   llvm-project\compiler-rt\test\asan\TestCases\Windows/dll_host.cpp -Fet.exe
>>   : 'RUN: at line 6';      C:/b/slave/sanitizer-windows/build/stage1/./bin/clang
>>   l.exe  -fsanitize=address -Wno-deprecated-declarations -WX -D_HAS_EXCEPTIONS=0
>>   Zi     -fsanitize-coverage=func,trace-pc-guard -LD -Od C:\b\slave\sanitizer-wi
>>   ows\llvm-project\compiler-rt\test\asan\TestCases\Windows\coverage-dll-stdio.cp
>>   -Fet.dll
>>   : 'RUN: at line 7';    ./t.exe t.dll 2>&1 | FileCheck C:\b\slave\sanitizer-win
>>   ws\llvm-project\compiler-rt\test\asan\TestCases\Windows\coverage-dll-stdio.cpp
>>   --
>>   Exit Code: 1
>>   
>>   Command Output (stdout):
>>   --
>>   $ ":" "RUN: at line 4"
>>   $ "rm" "-rf" "C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\t
>>   t\asan\X86_64WindowsConfig\TestCases\Windows\Output\coverage-dll-stdio.cpp.tmp
>>   $ "mkdir" "C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test
>>   san\X86_64WindowsConfig\TestCases\Windows\Output\coverage-dll-stdio.cpp.tmp"
>>   $ "cd" "C:\b\slave\sanitizer-windows\build\stage1\projects\compiler-rt\test\as
>>   \X86_64WindowsConfig\TestCases\Windows\Output\coverage-dll-stdio.cpp.tmp"
>>   $ ":" "RUN: at line 5"
>>   $ "C:/b/slave/sanitizer-windows/build/stage1/./bin/clang-cl.exe" "-fsanitize=a
>>   ress" "-Wno-deprecated-declarations" "-WX" "-D_HAS_EXCEPTIONS=0" "-Zi" "-fsani
>>   ze-coverage=func,trace-pc-guard" "-Od" "C:\b\slave\sanitizer-windows\llvm-proj
>>   t\compiler-rt\test\asan\TestCases\Windows/dll_host.cpp" "-Fet.exe"
>>   # command output:
>>      Creating library t.lib and object t.exp
>>   
>>   $ ":" "RUN: at line 6"
>>   $ "C:/b/slave/sanitizer-windows/build/stage1/./bin/clang-cl.exe" "-fsanitize=a
>>   ress" "-Wno-deprecated-declarations" "-WX" "-D_HAS_EXCEPTIONS=0" "-Zi" "-fsani
>>   ze-coverage=func,trace-pc-guard" "-LD" "-Od" "C:\b\slave\sanitizer-windows\llv
>>   project\compiler-rt\test\asan\TestCases\Windows\coverage-dll-stdio.cpp" "-Fet.
>>   l"
>>   # command output:
>>      Creating library t.lib and object t.exp
>>   
>>   $ ":" "RUN: at line 7"
>>   $ "./t.exe" "t.dll"
>>   note: command had no output on stdout or stderr
>>   error: command failed with exit status: 1
>>   $ "FileCheck" "C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\test\asan
>>   estCases\Windows\coverage-dll-stdio.cpp"
>>   # command stderr:
>>   C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\test\asan\TestCases\Wind
>>   s\coverage-dll-stdio.cpp:14:12: error: CHECK: expected string not found in inp
>>   
>>    // CHECK: hello world
>>              ^
>>   <stdin>:1:1: note: scanning from here
>>   Could not load DLL: t.dll (code: 1114)!
>>   ^
>>   
>>   Input file: <stdin>
>>   Check file: C:\b\slave\sanitizer-windows\llvm-project\compiler-rt\test\asan\Te
>>   Cases\Windows\coverage-dll-stdio.cpp
>>   
>>   -dump-input=help explains the following input dump.
>>   
>>   Input was:
>>   <<<<<<
>>             1: Could not load DLL: t.dll (code: 1114)!
>>   check:14     X~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ error: no match found
>>             2: =================================================================
>>   check:14     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>             3: ==6276==ERROR: AddressSanitizer: access-violation on unknown addr
>>   s 0x7ffb669b458c (pc 0x7ffb669b458c bp 0x000000000002 sp 0x002d80a8f458 T0)
>>   check:14     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>             4: ==6276==The signal is caused by a UNKNOWN memory access.
>>   check:14     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>             5:  #0 0x7ffb669b458b (<unknown module>)
>>   check:14     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>             6:  #1 0x7ffb84aed596 (C:\windows\SYSTEM32\ntdll.dll+0x18001d596)
>>   check:14     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>>             .
>>             .
>>             .
>>   >>>>>>
>>   
>>   error: command failed with exit status: 1
>>   
>>   --
>>   
>>   ********************
>>   Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
>>   ********************
>>   Failed Tests (1):
>>     AddressSanitizer-x86_64-windows :: TestCases/Windows/coverage-dll-stdio.cpp
>>
>> reverting change helps
>
> How about hacking Windows to not use `extern_weak`?




Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D98903/new/

https://reviews.llvm.org/D98903



More information about the llvm-commits mailing list