Similar to __asan_set_error_report_callback, pass the entire report to a
user provided callback function.
Details
- Reviewers
pcc hctim - Commits
- rG08d90f72cebd: [hwasan] Implement error report callback.
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
You can notice that this change is moving SetAbortMessage call out from under error_message_lock_.
I'm not sure why exactly I'm doing this, other than the fact that ASan does it this way.
This will allow Printf() from within the callback, which is quite unlikely to happen, but I guess possible in verbose mode or something like that.
All of this is still under the wider error_report_lock_, so a hwasan error in the callback will result in the "nested bug" message and an immediate exit.
It's actually not necessary to copy the error message as long as error_message_ptr_ is reset under the lock.
Isn't that why ASan is doing it? HWASan error in the cb if it's still locked would result in deadlock.
Possible to add a test just to double check this? Seems like a plausible scenario to tag-mismatch in the callback.