[GWP-ASan] Crash handler API returns sizeof(collected trace)
authorMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 27 Jul 2020 17:51:53 +0000 (10:51 -0700)
committerMitch Phillips <31459023+hctim@users.noreply.github.com>
Mon, 27 Jul 2020 17:51:55 +0000 (10:51 -0700)
commitd19af2f2476b5e13a65d5283cce9859e2c1ef763
tree3094c0b36813d8eae61011f7e254f80bc9c01537
parent902cbcd59e22ccd853f6b0c22acc772fd955dc46
[GWP-ASan] Crash handler API returns sizeof(collected trace)

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.

Reviewers: morehouse, eugenis

Reviewed By: eugenis

Subscribers: #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D84652
compiler-rt/lib/gwp_asan/common.cpp
compiler-rt/lib/gwp_asan/crash_handler.cpp
compiler-rt/lib/gwp_asan/tests/backtrace.cpp