This is an archive of the discontinued LLVM Phabricator instance.

[llvm-symbolizer] Add architecture fallback from x86_64h to x86_64
AbandonedPublic

Authored by kubamracek on Nov 18 2015, 6:13 AM.

Details

Summary

On OS X, x86_64h architecture can be mixed with x86_64 in a single process. When we try to symbolicate addresss from a sanitizer, llvm-symbolizer is called with --default-arch=x86_64h (when running on a Haswell+ machine). However, if a binary/library contains only the x86_64 slice, llvm-symbolizer simply fails. We should fallback from x86_64h to x86_64 if the x86_64h slice is not present.

Diff Detail

Event Timeline

kubamracek updated this revision to Diff 40498.Nov 18 2015, 6:13 AM
kubamracek retitled this revision from to [llvm-symbolizer] Add architecture fallback from x86_64h to x86_64.
kubamracek updated this object.
kubamracek added reviewers: samsonov, rafael, friss.
samsonov edited edge metadata.Nov 18 2015, 3:44 PM

I don't see why this is correct place to fix it. If we can treat x86_64h as x86_64, then getOrCreateObjects should work correctly for it. Which means that getObjectFileFromBinary should work correctly for it. Which probably means that you need to teach MachOUniversalBinary::getObjectForArch() to return you slice for x86_64, if x86_64h is unavailable.

kubamracek abandoned this revision.Jan 6 2017, 2:14 PM

llvm-symbolizer already supports specifying the arch with a colon ("mymodule.dylib:x86_64h").