-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[asan] Flush stderr in test #114084
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[asan] Flush stderr in test #114084
Conversation
This is the ASan equivalent of llvm#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 HWASan check is correct but it did not match the stderr/stdout output. This patch attempts to fix the issue by flushing stderr/stdout as appropriate.
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Thurston Dang (thurstond) ChangesThis is the ASan equivalent of #114083. The x86_64_lam_qemu buildbots started failing Full diff: https://github.com/llvm/llvm-project/pull/114084.diff 1 Files Affected:
diff --git a/compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp b/compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp
index 87be90014d56e8..dfeb8ad5c7b53f 100644
--- a/compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp
+++ b/compiler-rt/test/asan/TestCases/Posix/ignore_free_hook.cpp
@@ -26,14 +26,17 @@ bool ignore_free = false;
extern "C" {
WEAK_ON_APPLE void __sanitizer_free_hook(const volatile void *ptr) {
- if (ptr == glob_ptr)
+ if (ptr == glob_ptr) {
fprintf(stderr, "Free Hook\n");
+ fflush(stderr);
+ }
}
WEAK_ON_APPLE int __sanitizer_ignore_free_hook(const volatile void *ptr) {
if (ptr != glob_ptr)
return 0;
fprintf(stderr, ignore_free ? "Free Ignored\n" : "Free Respected\n");
+ fflush(stderr);
return ignore_free;
}
} // extern "C"
|
Shouldn't stderr be unbuffered? |
Hmm, that's a good point. Should I still merge to see if it works around the QEMU issue? |
I'm not opposed. Could this be a qemu bug? |
Looks like this patch did not solve the QEMU bot issues: https://lab.llvm.org/buildbot/#/builders/139/builds/5552/steps/30/logs/stdio "A bug? In QEMU code? |
Let's revert then? |
This reverts commit e205929. Reason: did not solve the QEMU bot issues (https://lab.llvm.org/buildbot/#/builders/139/builds/5552/steps/30/logs/stdio) and it shouldn't have been necessary anyway (#114084 (comment))
Done. Big Corporate strikes again. |
This is the ASan equivalent of llvm#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.
This reverts commit e205929. Reason: did not solve the QEMU bot issues (https://lab.llvm.org/buildbot/#/builders/139/builds/5552/steps/30/logs/stdio) and it shouldn't have been necessary anyway (llvm#114084 (comment))
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.