博客地址:http://home.cnblogs.com/u/zengjianrong/

未初始化内存检测(MSan)

https://github.com/google/sanitizers/wiki

https://github.com/google/sanitizers/wiki/MemorySanitizer

Introduction

MemorySanitizer (MSan) is a detector of uninitialized memory reads in C/C++ programs.

Uninitialized values occur when stack- or heap-allocated memory is read before it is written. MSan detects cases where such values affect program execution.

MSan is bit-exact: it can track uninitialized bits in a bitfield. It will tolerate copying of uninitialized memory, and also simple logic and arithmetic operations with it. In general, MSan silently tracks the spread of uninitialized data in memory, and reports a warning when a code branch is taken (or not taken) depending on an uninitialized value.

MSan implements a subset of functionality found in Valgrind (Memcheck tool). It is significantly faster than Memcheck (TODO:benchmark).

posted @ 2019-11-01 15:54  black_man  阅读(773)  评论(0)    收藏  举报