-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[compiler-rt][nsan] Make nsan output more user-friendly #98798
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
Conversation
Currently NSAN prints reports that are entirely red and the terminal prompt after the program exits is red too. With this change we make red only `WARNING` summary and the rest of the report isn't colored This behaviour is similar to the behavior of other sanitizers reports like asan, ubsan etc
@llvm/pr-subscribers-compiler-rt-sanitizer Author: Dmitriy Chestnykh (chestnykh) ChangesCurrently NSAN prints reports that are entirely red and the terminal prompt after the program exits is red too. With this change we make red only Full diff: https://github.com/llvm/llvm-project/pull/98798.diff 1 Files Affected:
diff --git a/compiler-rt/lib/nsan/nsan.cpp b/compiler-rt/lib/nsan/nsan.cpp
index 7a5f013579dfb..e5a9b7a036e0e 100644
--- a/compiler-rt/lib/nsan/nsan.cpp
+++ b/compiler-rt/lib/nsan/nsan.cpp
@@ -513,6 +513,8 @@ int32_t checkFT(const FT value, ShadowFT Shadow, CheckTypeT CheckType,
}
using ValuePrinter = FTPrinter<FT>;
using ShadowPrinter = FTPrinter<ShadowFT>;
+ Printf("%s", D.Default());
+
Printf("\n"
"%-12s precision (native): dec: %s hex: %s\n"
"%-12s precision (shadow): dec: %s hex: %s\n"
@@ -638,8 +640,9 @@ void fCmpFailFT(const FT Lhs, const FT Rhs, ShadowFT LhsShadow,
const char *const PredicateName = GetPredicateName(Predicate);
Printf("%s", D.Warning());
Printf("WARNING: NumericalStabilitySanitizer: floating-point comparison "
- "results depend on precision\n"
- "%-12s precision dec (native): %s %s %s (%s)\n"
+ "results depend on precision\n");
+ Printf("%s", D.Default());
+ Printf("%-12s precision dec (native): %s %s %s (%s)\n"
"%-12s precision dec (shadow): %s %s %s (%s)\n"
"%-12s precision hex (native): %s %s %s (%s)\n"
"%-12s precision hex (shadow): %s %s %s (%s)\n"
@@ -658,7 +661,6 @@ void fCmpFailFT(const FT Lhs, const FT Rhs, ShadowFT LhsShadow,
FTInfo<ShadowFT>::kCppTypeName, ShadowPrinter::hex(LhsShadow).Buffer,
PredicateName, ShadowPrinter::hex(RhsShadow).Buffer,
GetTruthValueName(ShadowResult), D.End());
- Printf("%s", D.Default());
stack.Print();
if (flags().halt_on_error) {
Printf("Exiting\n");
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/66/builds/1488 Here is the relevant piece of the build log for the reference:
|
Currently NSAN prints reports that are entirely red and the terminal prompt after the program exits is red too. With this change we make red only
WARNING
summary and the rest of the report isn't coloredThis behaviour is similar to the behavior of other sanitizers reports like asan, ubsan etc
Now:
