如何让 MemorySanitizer 在一个错误后不停止

How to make MemorySanitizer not stop after one error

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

有人知道如何让 MemorySanitizer 不因错误而停止吗? 上面这句话暗示有办法,但是我在文档中没有找到任何东西。

似乎 -fsanitize-recover=memory 选项应该合适。

来自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.

使用-fsanitize-recover=all 应该使所有错误都不是致命的。

还有一些关于此的 Google 文档(搜索 continue-after-error):

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