This is an archive of the discontinued LLVM Phabricator instance.

tsan: fix active mapping selection
ClosedPublic

Authored by dvyukov on Aug 11 2021, 3:43 AM.

Details

Summary

Fix bug introduced by commit 5d106f16b972.
SANITIZER_IOSSIM is always defined,
it's the value 0/1 that's meaningful.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 11 2021, 3:43 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 11 2021, 3:43 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
DavidSpickett accepted this revision.Aug 11 2021, 3:56 AM

LGTM

I was looking at the # elif defined(__aarch64__) && !defined(__APPLE__) bit and wondering what went wrong there but this explains it.

(if it doesn't fix the issue I can get you the maps file for one of the failing tests)

This revision is now accepted and ready to land.Aug 11 2021, 3:56 AM

(if it doesn't fix the issue I can get you the maps file for one of the failing tests)

Thanks for the offer.
However, the actual on the machine hasn't changed and the tsan mapping haven't changed, but the selection of the active mapping has changed. So what I did for another similar case is:

  • a/compiler-rt/lib/tsan/rtl/tsan_platform.h

+++ b/compiler-rt/lib/tsan/rtl/tsan_platform.h
@@ -723,6 +723,7 @@ enum MappingType {
struct MappingField {

template <typename Mapping>
static uptr Apply(MappingType type) {

+ Printf("%s\n", PRETTY_FUNCTION);

switch (type) {
  case kLoAppMemBeg:
    return Mapping::kLoAppMemBeg;

This gave me name of the actual selected mapping and it was clear it's wrong.
So figuring out which mapping is selected now and which was selected before the change may be more useful.

This revision was landed with ongoing or failed builds.Aug 11 2021, 4:03 AM
This revision was automatically updated to reflect the committed changes.