Commit Graph

4 Commits

Author SHA1 Message Date
Evgeniy Stepanov 504f0987fe [msan] Fix MsanTest to pass in track_origins=2 mode.
llvm-svn: 230639
2015-02-26 15:19:33 +00:00
Evgeniy Stepanov 7395cae005 [msan] Change the way origin ids are built.
Previously, all origin ids were "chained" origins, i.e values of
ChainedOriginDepot. This added a level of indirection for simple
stack and heap allocation, which were represented as chains of
length 1. This costs both RAM and CPU, but provides a joined 2**29
origin id space. It also made function (any instrumented function)
entry non-async-signal-safe, but that does not really matter because
memory stores in track-origins=2 mode are not async-signal-safe anyway.

With this change, the type of the origin is encoded in origin id.
See comment in msan_origin.h for more details. This reduces chained and stack
origin id range to 2**28 each, but leaves extra 2**31 for heap origins.

This change should not have any user-visible effects.

llvm-svn: 223233
2014-12-03 13:58:40 +00:00
Evgeniy Stepanov 9438bf1f62 [msan] Better diagnostic for invalid origin id.
llvm-svn: 210331
2014-06-06 12:58:44 +00:00
Evgeniy Stepanov 208aae8ee0 [msan] Chained origins re-design.
Generalize StackDepot and create a new specialized instance of it to
efficiently (i.e. without duplicating stack trace data) store the
origin history tree.

This reduces memory usage for chained origins roughly by an order of
magnitude.

Most importantly, this new design allows us to put two limits on
stored history data (exposed in MSAN_OPTIONS) that help avoid
exponential growth in used memory on certain workloads.

See comments in lib/msan/msan_origin.h for more details.

llvm-svn: 209284
2014-05-21 09:02:13 +00:00