Skip to content
Snippets Groups Projects
Commit a72c7cf2 authored by Alexey Samsonov's avatar Alexey Samsonov
Browse files

[ASan] If ASan finds second error report, wait for some time and die (instead...

[ASan] If ASan finds second error report, wait for some time and die (instead of running in a busy loop) to make sure ASan won't hang if it finds error while reporting an error in the same thread

llvm-svn: 161749
parent 5aaa7fde
No related branches found
No related tags found
No related merge requests found
......@@ -213,11 +213,11 @@ class ScopedInErrorReport {
// they are defined as no-return.
AsanReport("AddressSanitizer: while reporting a bug found another one."
"Ignoring.\n");
// We can't use infinite busy loop here, as ASan may try to report an
// error while another error report is being printed (e.g. if the code
// that prints error report for buffer overflow results in SEGV).
SleepForSeconds(Max(5, flags()->sleep_before_dying + 1));
// Try to prevent substituting infinite busy loop with _exit or smth
// like that.
volatile int x = 1;
while (x) { }
Die();
}
AsanPrintf("===================================================="
"=============\n");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment