This is an archive of the discontinued LLVM Phabricator instance.

tsan: remove indirection when selecting the active mapping
ClosedPublic

Authored by dvyukov on Aug 9 2021, 12:53 AM.

Details

Summary

Currently there are 2 levels when selecting the active mapping:
the branchy ifdef tree + another ifdef tree in SelectMapping.
Moreover, there is an additional indirection for some platforms
via HAS_48_BIT_ADDRESS_SPACE define. This makes already complex
logic even more complex and almost impossible to read.
Remove one level of indirection and define the active mapping
in SelectMapping.

Depends on D107742.

Diff Detail

Event Timeline

dvyukov requested review of this revision.Aug 9 2021, 12:53 AM
dvyukov created this revision.
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2021, 12:53 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
melver accepted this revision.Aug 9 2021, 8:54 AM
This revision is now accepted and ready to land.Aug 9 2021, 8:54 AM
dvyukov updated this revision to Diff 365246.Aug 9 2021, 11:47 AM

changed SelectMapping to use template Arg and rebased

This has caused test failures on our AArch64 bots:
https://lab.llvm.org/buildbot/#/builders/179/builds/603

All along the lines of:

FATAL: ThreadSanitizer: unexpected memory mapping 0xfffff6200000-0xfffff6300000

Commenting on this change in particular because it's the most recent one a bisect thought might be the issue:

$ git bisect bad
There are only 'skip'ped commits left to test.
The first bad commit could be any of:
3830c93478d39f66ce3bdacaac600c43d90e8076
fd5060073390ea05ff52c8825681d2329b780ec9
62c340760c5a7c37c0c81aa4dd75583de13c8ef1
fda121a9cc7ecf9808efb26d8070a0c74060408b
0ebfe7c3126df8f6bc5b721053369065fa2d0c8c
a44a873e11de99a6e31609f8f6075e0c46eb7006
3cb4ed72e76df72af139744cf3215593004db674
959076c596c77999a4ca5fd1d0b2403ae43d0c29
5d106f16b972884fb81c7dac338eeeb09d6c35b9
We cannot bisect more!

Some of the individual commits don't build with clang-12 but looks like that's to be expected.

Hi David,

Thanks for reporting. I've mailed https://reviews.llvm.org/D107888. I don't have an aarch64 machine, but I hope it will fix it.