HomePhabricator

[GWP-ASan] Implement stack frame compression.

Description

[GWP-ASan] Implement stack frame compression.

Summary:
This patch introduces stack frame compression to GWP-ASan. Each stack frame is
variable-length integer encoded as the difference between frame[i] and
frame[i - 1]. Furthermore, we use zig-zag encoding on the difference to ensure
that negative differences are also encoded into a relatively small number of
bytes.

Examples of what the compression looks like can be seen in
gwp_asan/tests/compression.cpp.

This compression can reduce the memory consumption cost of stack traces by
~50%.

Reviewers: vlad.tsyrklevich

Reviewed By: vlad.tsyrklevich

Subscribers: mgorny, #sanitizers, llvm-commits, eugenis, morehouse

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D66189

Details

Committed
hctimAug 15 2019, 2:09 PM
Reviewer
vlad.tsyrklevich
Differential Revision
D66189: [GWP-ASan] Implement stack frame compression.
Parents
rL369047: gn build: Merge r369039
Branches
Unknown
Tags
Unknown