Skip to content

Commit e205929

Browse files
authored
[asan] Flush stderr in test (#114084)
This is the ASan equivalent of #114083. The x86_64_lam_qemu buildbots started failing (https://lab.llvm.org/buildbot/#/builders/139/builds/5462/steps/2/logs/stdio). Based on the logs, it appears the ASan check is correct but it did not match the stderr/stdout output. This patch attempts to fix the issue by flushing stderr as appropriate.
1 parent 3a1228a commit e205929

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,17 @@ bool ignore_free = false;
2626

2727
extern "C" {
2828
WEAK_ON_APPLE void __sanitizer_free_hook(const volatile void *ptr) {
29-
if (ptr == glob_ptr)
29+
if (ptr == glob_ptr) {
3030
fprintf(stderr, "Free Hook\n");
31+
fflush(stderr);
32+
}
3133
}
3234

3335
WEAK_ON_APPLE int __sanitizer_ignore_free_hook(const volatile void *ptr) {
3436
if (ptr != glob_ptr)
3537
return 0;
3638
fprintf(stderr, ignore_free ? "Free Ignored\n" : "Free Respected\n");
39+
fflush(stderr);
3740
return ignore_free;
3841
}
3942
} // extern "C"

0 commit comments

Comments
 (0)