robert
robert

Reputation: 3726

How to make MemorySanitizer not stop after one error

Clang's documentation says that "By default, MemorySanitizer exits on the first detected error."

Does somebody know how to make MemorySanitizer not to stop on errors? The above sentence suggests that there is a way, but I do not find anything in the documentation.

Upvotes: 4

Views: 3425

Answers (1)

valiano
valiano

Reputation: 18631

It seems the -fsanitize-recover=memory option should fit.

From clang documentation:

Controls which checks enabled by -fsanitize= flag are non-fatal. If the check is fatal, program will halt after the first error of this kind is detected and error report is printed.

Using-fsanitize-recover=all should make all errors non fatal.

There's also some Google documentation about this (search for continue-after-error):

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

Upvotes: 8

Related Questions