This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type
ClosedPublic

Authored by vitalybuka on Apr 26 2019, 10:18 AM.

Diff Detail

Event Timeline

vitalybuka created this revision.Apr 26 2019, 10:18 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 26 2019, 10:18 AM
Herald added subscribers: llvm-commits, Restricted Project, kubamracek. · View Herald Transcript
This revision is now accepted and ready to land.Apr 26 2019, 11:15 AM
This revision was automatically updated to reflect the committed changes.
phosek added a subscriber: phosek.Apr 26 2019, 3:06 PM

This seems to be failing on our Mac bots with this error:

FAILED: compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.ios.dir/sanitizer_allocator.cc.o 
/b/s/w/ir/k/recipe_cleanup/clangK3gGtn/llvm_build_dir/./bin/clang++ --target=x86_64-apple-darwin17.7.0  -DHAVE_RPC_XDR_H=0 -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/.. -stdlib=libc++ -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Wall -std=c++11 -Wno-unused-parameter -O2 -g  -arch armv7 -arch armv7s -arch arm64   -UNDEBUG  -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot /b/s/w/ir/cache/macos_sdk/XCode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk -fPIC -fno-builtin -fno-exceptions -funwind-tables -fno-stack-protector -fno-sanitize=safe-stack -fvisibility=hidden -fno-lto -O3 -gline-tables-only -Wno-gnu -Wno-variadic-macros -Wno-c99-extensions -Wno-non-virtual-dtor -fno-rtti -Wframe-larger-than=570 -Wglobal-constructors -DSANITIZER_SUPPORTS_WEAK_HOOKS=0 -MD -MT compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.ios.dir/sanitizer_allocator.cc.o -MF compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.ios.dir/sanitizer_allocator.cc.o.d -o compiler-rt/lib/sanitizer_common/CMakeFiles/RTSanitizerCommonNoHooks.ios.dir/sanitizer_allocator.cc.o -c /b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc
In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:14:
In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h:74:
/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h:69:3: error: static_assert failed due to requirement 'TwoLevelByteMapSize1 > 128' "TwoLevelByteMap should be used"
  static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used");
  ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~
/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h:29:34: note: in instantiation of template class '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>' requested here
                        typename PrimaryAllocator::AddressSpaceView>::value,
                                 ^
/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:87:52: note: in instantiation of template class '__sanitizer::CombinedAllocator<__sanitizer::SizeClassAllocator32<__sanitizer::AP32>, __sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<__sanitizer::AP32> >, __sanitizer::LargeMmapAllocator<__sanitizer::NoOpMapUnmapCallback, __sanitizer::LargeMmapAllocatorPtrArrayStatic, __sanitizer::LocalAddressSpaceView>, __sanitizer::LocalAddressSpaceView>' requested here
static ALIGNED(64) char internal_alloc_placeholder[sizeof(InternalAllocator)];
                                                   ^
In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:14:
In file included from /b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h:75:
/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator_local_cache.h:21:27: error: no type named 'AllocatorCache' in '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>'
    : SizeClassAllocator::AllocatorCache {};
      ~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
/b/s/w/ir/k/llvm-project/compiler-rt/lib/sanitizer_common/sanitizer_allocator.cc:91:31: note: in instantiation of template class '__sanitizer::SizeClassAllocatorLocalCache<__sanitizer::SizeClassAllocator32<__sanitizer::AP32> >' requested here
static InternalAllocatorCache internal_allocator_cache;
                              ^
2 errors generated.
jfb added a subscriber: jfb.Apr 26 2019, 3:27 PM

Reverted in r359352.

vitalybuka reopened this revision.Apr 26 2019, 7:07 PM
This revision is now accepted and ready to land.Apr 26 2019, 7:07 PM

reduce threshold to fix mac and android

This revision was automatically updated to reflect the committed changes.