This is an archive of the discontinued LLVM Phabricator instance.

[NFC][compiler-rt][hwasan] Move __hwasan_tag_mismatch4 to hwasan.cpp
ClosedPublic

Authored by leonardchan on Jul 8 2021, 3:48 PM.

Details

Summary

This can be moved out of hwasan_linux.cpp because it can be re-used in the fuchsia port.

Diff Detail

Event Timeline

leonardchan created this revision.Jul 8 2021, 3:48 PM
leonardchan requested review of this revision.Jul 8 2021, 3:48 PM
vitalybuka accepted this revision.Jul 8 2021, 3:51 PM
This revision is now accepted and ready to land.Jul 8 2021, 3:51 PM

@leonardchan Sorry for the late report, took us some time to get to this but - this caused a test failure on Linaro's AArch64 bots.

I've fixed this with https://reviews.llvm.org/rGbb4f7b916661d2517fb8dfadfc8629e6bed56ce4

What happened is that we now see frame 0 as a tag mismatch function and frame 1 is main. With my limited knowledge of sanitizers I think this is fine and the test is just ensuring that there is some main frame shown. So allowing it to be frame 0 or 1 is what I did.

If that's not the case let me know. If, for instance, the __hwasan_tag_mismatch functions are supposed to be hidden from the backtrace somehow.

@leonardchan Sorry for the late report, took us some time to get to this but - this caused a test failure on Linaro's AArch64 bots.

I've fixed this with https://reviews.llvm.org/rGbb4f7b916661d2517fb8dfadfc8629e6bed56ce4

What happened is that we now see frame 0 as a tag mismatch function and frame 1 is main. With my limited knowledge of sanitizers I think this is fine and the test is just ensuring that there is some main frame shown. So allowing it to be frame 0 or 1 is what I did.

If that's not the case let me know. If, for instance, the __hwasan_tag_mismatch functions are supposed to be hidden from the backtrace somehow.

Thanks for catching this! And sorry I didn't notice it earlier. I *think* __hwasan_tag_mismatch appearing in the backtrace might not be too important. It looks like the purpose of that test is more to check that hwasan hits those errors. @eugenis or @vitalybuka may be able to correct me on this.

If that's not the case let me know. If, for instance, the __hwasan_tag_mismatch functions are supposed to be hidden from the backtrace somehow.

Thanks for catching this! And sorry I didn't notice it earlier. I *think* __hwasan_tag_mismatch appearing in the backtrace might not be too important. It looks like the purpose of that test is more to check that hwasan hits those errors. @eugenis or @vitalybuka may be able to correct me on this.

Yes this should be fine.