This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix interception of multiple defined symbols.
ClosedPublic

Authored by etienneb on Sep 27 2016, 1:13 PM.

Details

Summary

The MSVC compiler is generating multiple instance of the exception handler
when compiling on win64 with /MD.

see: https://msdn.microsoft.com/en-us/library/2kzt1wy3.aspx

Two tests were failing when running:

ninja check-asan-dynamic.

The tests were failing because only the first occurence of the function was patched.
The function __C_specific_handler is defined in ntdll and vcruntime140.

After this patch, there is still two remaining tests failing.

********************
Testing: 0 .. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90..
Testing Time: 87.81s
********************
Failing Tests (2):
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memchr.cc
    AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc

  Expected Passes    : 342
  Passes With Retry  : 2
  Expected Failures  : 16
  Unsupported Tests  : 152
  Unexpected Failures: 2

Diff Detail

Event Timeline

etienneb updated this revision to Diff 72699.Sep 27 2016, 1:13 PM
etienneb retitled this revision from to [compiler-rt] Fix interception of multiple defined symbols..
etienneb updated this object.
etienneb added a reviewer: rnk.
etienneb added subscribers: chrisha, llvm-commits.
etienneb updated this revision to Diff 72701.Sep 27 2016, 1:20 PM

fix coding style

vitalybuka accepted this revision.Sep 28 2016, 10:49 AM
vitalybuka added a reviewer: vitalybuka.
vitalybuka added a subscriber: vitalybuka.
vitalybuka added inline comments.
lib/interception/interception_win.cc
925

if (func_addr &&

This revision is now accepted and ready to land.Sep 28 2016, 10:49 AM

maybe explicit test for this case can be useful

etienneb marked an inline comment as done.Sep 28 2016, 11:02 AM

maybe explicit test for this case can be useful

There is already two tests for it. They were broken on windows 64-bits.
Windows 64-bits is not yet officially supported by Asan and there is no build bots testing it (yet).

etienneb updated this revision to Diff 72864.Sep 28 2016, 11:03 AM
etienneb edited edge metadata.

fix bubak comments

etienneb closed this revision.Sep 28 2016, 11:12 AM