This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt] Fix Sanitizer-common Unittests on win64
ClosedPublic

Authored by etienneb on Jun 28 2016, 3:21 PM.

Details

Summary

This patch is fixing unittests that are broken on windows (64-bits).

Tests under 'SANITIZER_CAN_USE_ALLOCATOR64' are disabled.
A custom allocator for windows based on WinHeap API will replace these tests.

Tested on Win32/Win64 (Ninja and MSVC).
Tested on Linux 32-bit/64-bit clang.

C:\src\llvm\build64\projects\compiler-rt>lib\sanitizer_common\tests\Release\Sanitizer-x86_64-Test.exe
[==========] Running 101 tests from 12 test cases.
[----------] Global test environment set-up.
[----------] 51 tests from SanitizerCommon
[ RUN      ] SanitizerCommon.DefaultSizeClassMap
[       OK ] SanitizerCommon.DefaultSizeClassMap (1 ms)
[ RUN      ] SanitizerCommon.CompactSizeClassMap
[       OK ] SanitizerCommon.CompactSizeClassMap (1 ms)
[ RUN      ] SanitizerCommon.InternalSizeClassMap
[       OK ] SanitizerCommon.InternalSizeClassMap (1 ms)
[ RUN      ] SanitizerCommon.SizeClassAllocator32Compact
[       OK ] SanitizerCommon.SizeClassAllocator32Compact (828 ms)
[ RUN      ] SanitizerCommon.SizeClassAllocator32CompactMetadataStress
[       OK ] SanitizerCommon.SizeClassAllocator32CompactMetadataStress (914 ms)
[ RUN      ] SanitizerCommon.SizeClassAllocator32MapUnmapCallback

[...]

[----------] 4 tests from Symbolizer
[ RUN      ] Symbolizer.ExtractToken
[       OK ] Symbolizer.ExtractToken (0 ms)
[ RUN      ] Symbolizer.ExtractInt
[       OK ] Symbolizer.ExtractInt (0 ms)
[ RUN      ] Symbolizer.ExtractUptr
[       OK ] Symbolizer.ExtractUptr (0 ms)
[ RUN      ] Symbolizer.ExtractTokenUpToDelimiter
[       OK ] Symbolizer.ExtractTokenUpToDelimiter (0 ms)
[----------] 4 tests from Symbolizer (24 ms total)

[----------] Global test environment tear-down
[==========] 101 tests from 12 test cases ran. (5090 ms total)
[  PASSED  ] 101 tests.

Diff Detail

Event Timeline

etienneb updated this revision to Diff 62140.Jun 28 2016, 3:21 PM
etienneb retitled this revision from to [compiler-rt] Fix Sanitizer-common Unittests on win64.
etienneb updated this object.
etienneb added a reviewer: rnk.
etienneb updated this object.Jun 28 2016, 3:23 PM
etienneb updated this revision to Diff 62224.Jun 29 2016, 8:29 AM

increase stack

rnk added inline comments.Jun 29 2016, 11:04 AM
lib/sanitizer_common/sanitizer_platform.h
171

|| SANITIZER_WINDOWS instead. Can you add comments about why we can't use the 64-bit allocator on win64 yet?

lib/sanitizer_common/tests/sanitizer_printf_test.cc
27–28

Should be (uptr)5 and (uptr)11, right? Not that it matters a lot.

lib/sanitizer_common/tests/sanitizer_test_main.cc
17

Which tests fail without this? 20MB seems like too much.

etienneb updated this revision to Diff 62266.Jun 29 2016, 12:39 PM
etienneb marked 2 inline comments as done.

fix comments

lib/sanitizer_common/sanitizer_platform.h
171

I'll remove this fix for now.
The unittests are still broken on windows, but I better fix is coming.

lib/sanitizer_common/tests/sanitizer_test_main.cc
17
TEST(BVGraph, BasicTest) {
  BasicTest<BV1>();
  BasicTest<BV2>();
  BasicTest<BV3>();
  BasicTest<BV4>();
}

It's only failing on 64-bits.

rnk accepted this revision.Jun 29 2016, 12:58 PM
rnk edited edge metadata.

lgtm

lib/sanitizer_common/tests/sanitizer_test_main.cc
17

FIXME for it?

This revision is now accepted and ready to land.Jun 29 2016, 12:58 PM
etienneb closed this revision.Jun 29 2016, 3:04 PM