This is an archive of the discontinued LLVM Phabricator instance.

[compiler-rt][asan] Define MemToShadowSize for sparc64
ClosedPublic

Authored by ro on Jul 17 2020, 12:57 AM.

Details

Summary

[[ https://reviews.llvm.org/D83247 | [compiler-rt][asan][hwasan] Refactor shadow setup into sanitizer_common (NFCI) ]]
broke the | Solaris/sparcv9 build:

FAILED: projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.sparcv9.dir/asan_linux.cpp.o 
/opt/llvm-buildbot/bin/c++  -D_DEBUG -D_FILE_OFFSET_BITS=64 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Iprojects/compiler-rt/lib/asan -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan -Iinclude -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/include -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/llvm/include/llvm/Support/Solaris -I/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan/.. -fPIC -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wno-comment -fdiagnostics-color -ffunction-sections -fdata-sections -Wall -std=c++14 -Wno-unused-parameter -O3     -m64 -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fno-stack-protector -fvisibility=hidden -fno-lto -O3 -g -Wno-variadic-macros -Wno-non-virtual-dtor -fno-rtti -UNDEBUG -std=c++14 -MD -MT projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.sparcv9.dir/asan_linux.cpp.o -MF projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.sparcv9.dir/asan_linux.cpp.o.d -o projects/compiler-rt/lib/asan/CMakeFiles/RTAsan.sparcv9.dir/asan_linux.cpp.o -c /opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan/asan_linux.cpp
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan/asan_linux.cpp: In function ‘__sanitizer::uptr __asan::FindDynamicShadowStart()’:
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan/asan_linux.cpp:103:28: error: ‘MemToShadowSize’ was not declared in this scope
   uptr shadow_size_bytes = MemToShadowSize(kHighMemEnd);
                            ^~~~~~~~~~~~~~~
/opt/llvm-buildbot/home/solaris11-sparcv9/clang-solaris11-sparcv9/llvm/compiler-rt/lib/asan/asan_linux.cpp:103:28: note: suggested alternative: ‘MemToShadow’
   uptr shadow_size_bytes = MemToShadowSize(kHighMemEnd);
                            ^~~~~~~~~~~~~~~
                            MemToShadow

Fixed by also definining MemToShadowSize in compiler-rt/lib/asan/asan_mapping_sparc64.h.

Tested on sparcv9-sun-solaris2.11.

Will commit as obvious shortly: it unbreaks the buildbot and can only affect sparc64.
Should a different solution without the duplication be desired, that can be added later.

Diff Detail

Event Timeline

ro created this revision.Jul 17 2020, 12:57 AM
Herald added subscribers: Restricted Project, dexonsmith, jrtc27 and 3 others. · View Herald TranscriptJul 17 2020, 12:57 AM
This revision was not accepted when it landed; it landed in state Needs Review.Jul 17 2020, 1:05 AM
This revision was automatically updated to reflect the committed changes.
vitalybuka reopened this revision.Jul 17 2020, 2:37 AM
vitalybuka accepted this revision.
This revision is now accepted and ready to land.Jul 17 2020, 2:37 AM
vitalybuka closed this revision.Jul 17 2020, 2:38 AM

Oddly, I didn't get a bot failure notification for this one - do you know if it was it hidden behind another failure that showed up earlier?

I'll send another patch to simply move MemToShadowSize up earlier in asan_mapping.h to cover all the cases.

Nevermind, I see Vitaly beat me to this in e412cc402e84444ff13cc4e4ae4c2c5830f9d9da. Thanks all!

ro added a comment.Jul 20 2020, 4:39 AM

Oddly, I didn't get a bot failure notification for this one - do you know if it was it hidden behind another failure that showed up earlier?

You didn't miss anything: the Solaris buildbots are driven by the silent buildmaster, so there are no build breakage notifications.
There are a couple of test failures that I haven't been able to tackle in some time, so the buildbots had to be moved away from the regular
buildmaster.

I consider the current system (no failures -> green, any kind of failure -> red) as far too simplistic: while I can get work done with an
additional testsuite failure or two, if the build is broken, nothing can be done before that is fixed. Treating both scenarios the same feels
very wrong to me.