This is an archive of the discontinued LLVM Phabricator instance.

[GWP-ASan] Crash handler API returns sizeof(collected trace)
ClosedPublic

Authored by hctim on Jul 27 2020, 6:30 AM.

Details

Summary

Fix up a slight bug with the crash handler API, where we say that we
return the size of the collected trace (instead of the size of the trace
that's returned) when the return buffer is too small, and the result is
truncated.

Also, as a result, patch up a small uninitialized memory bug.

Diff Detail

Event Timeline

hctim created this revision.Jul 27 2020, 6:30 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 27 2020, 6:30 AM
Herald added a subscriber: Restricted Project. · View Herald Transcript
hctim updated this revision to Diff 280904.Jul 27 2020, 7:10 AM

Apparently static constexpr declarations and initializers go in headers,
but they still require declarations to avoid link-time undefined
reference complaints (except after c++17). Learn something new every day, I guess.

eugenis accepted this revision.Jul 27 2020, 10:14 AM

LGTM

compiler-rt/lib/gwp_asan/tests/backtrace.cpp
109

typo: Dealloc

This revision is now accepted and ready to land.Jul 27 2020, 10:14 AM
hctim marked an inline comment as done.Jul 27 2020, 10:51 AM
hctim updated this revision to Diff 280974.Jul 27 2020, 10:51 AM
  • Fix up 'dealloc' typo.
This revision was automatically updated to reflect the committed changes.