Page MenuHomePhabricator

[asan] Teach asan_symbolize.py to use :arch with atos and llvm-symbolizer on Darwin
ClosedPublic

Authored by kubamracek on Dec 2 2016, 5:42 PM.

Details

Summary

On Darwin, there is an issue with llvm-symbolizer and atos, where we cannot properly symbolize when mixing x86_64 and x86_64h modules within one process. This is a very common case on macOS (x86_64h is backwards compatible, so when there is no x86_64h slice, a regular x86_64 is loaded instead). This currently makes some compiler-rt tests fail on Haswell+ Darwin machines.

This patch teaches asan_symbolize.py to read an architecture suffix on module names (e.g. ":x86_64") and pass that option to atos and llvm-symbolizer. Follow-up patches will fix the same problem when invoking llvm-symbolizer directly from sanitizers.

Diff Detail

Repository
rL LLVM

Event Timeline

kubamracek updated this revision to Diff 80160.Dec 2 2016, 5:42 PM
kubamracek retitled this revision from to [asan] Teach asan_symbolize.py to use :arch with atos and llvm-symbolizer on Darwin.
kubamracek updated this object.
kubamracek set the repository for this revision to rL LLVM.
kubamracek added a project: Restricted Project.
kubamracek added a subscriber: llvm-commits.
filcab edited edge metadata.Dec 7 2016, 1:19 PM

Please add an if force_system_symbolizer: assert(allow_system_symbolizer) or similar, to do a sanity check.

lib/asan/scripts/asan_symbolize.py
444 ↗(On Diff #80160)

Isn't : a valid filename character on most Linux fs?

kubamracek added inline comments.Dec 8 2016, 2:09 PM
lib/asan/scripts/asan_symbolize.py
444 ↗(On Diff #80160)

Ah, okay. Do you want me to restrict this to Darwin?

kubamracek updated this revision to Diff 81445.Dec 14 2016, 1:02 PM
kubamracek edited edge metadata.

Addressing review comments, updating patch. We will assume that the arch is part of the filename ("libabc.dylib:x86_64h") only if the last part is a known architecture. I'll update my other patch to add a comment into the .h file to point out that there's a list of known architectures in asan_symbolize.py.

This revision was automatically updated to reflect the committed changes.