Ben Boeckel
2014-Oct-06 18:33 UTC
[LLVMdev] [PATCH] ubsan: label messages as coming from ubsan
I've been working on adding UBSan support to CMake (so that errors found by it can be uploaded to CDash for viewing). One problem is that the message is very generic. The patch here addes 'UndefinedBehaviorSanitizer' to the message so that they may be detected more easily. If something else is wanted (such as the '===' lines from ASan or TSan to cope with things like printing the backtrace, that would be possible as well. It would also be nice if there were a blurb on what the error was rather than just freeform text (similar to heap-use-after-free and heap-buffer-overflow) to categorize messages. Thanks, --Ben Ben Boeckel (1): ubsan: add 'UndefinedBehaviorSanitizer' to messages lib/ubsan/ubsan_diag.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 2.1.0
Ben Boeckel
2014-Oct-06 18:33 UTC
[LLVMdev] [PATCH] ubsan: add 'UndefinedBehaviorSanitizer' to messages
This allows detection of them to be much more accurate since 'runtime error:' and 'note:' are fairly generic. Signed-off-by: Ben Boeckel <ben.boeckel at kitware.com> --- lib/ubsan/ubsan_diag.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ubsan/ubsan_diag.cc b/lib/ubsan/ubsan_diag.cc index fa23521..ba4d9b8 100644 --- a/lib/ubsan/ubsan_diag.cc +++ b/lib/ubsan/ubsan_diag.cc @@ -313,12 +313,12 @@ Diag::~Diag() { switch (Level) { case DL_Error: - Printf("%s runtime error: %s%s", + Printf("%s UndefinedBehaviorSanitizer runtime error: %s%s", Decor.Warning(), Decor.EndWarning(), Decor.Bold()); break; case DL_Note: - Printf("%s note: %s", Decor.Note(), Decor.EndNote()); + Printf("%s UndefinedBehaviorSanitizer note: %s", Decor.Note(), Decor.EndNote()); break; } -- 2.1.0
Kostya Serebryany
2014-Oct-06 18:41 UTC
[LLVMdev] [PATCH] ubsan: label messages as coming from ubsan
+samsonov Ben, you've forgot to add the patch. I encourage you to use llvm.org/docs/Phabricator.html for code reviews --kcc On Mon, Oct 6, 2014 at 11:33 AM, Ben Boeckel <mathstuf at gmail.com> wrote:> I've been working on adding UBSan support to CMake (so that errors found > by it can be uploaded to CDash for viewing). One problem is that the > message is very generic. The patch here addes > 'UndefinedBehaviorSanitizer' to the message so that they may be detected > more easily. > > If something else is wanted (such as the '===' lines from ASan or TSan > to cope with things like printing the backtrace, that would be possible > as well. It would also be nice if there were a blurb on what the error > was rather than just freeform text (similar to heap-use-after-free and > heap-buffer-overflow) to categorize messages. > > Thanks, > > --Ben > > Ben Boeckel (1): > ubsan: add 'UndefinedBehaviorSanitizer' to messages > > lib/ubsan/ubsan_diag.cc | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > -- > 2.1.0 > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20141006/0346115a/attachment.html>
Ben Boeckel
2014-Oct-06 18:45 UTC
[LLVMdev] [PATCH] ubsan: label messages as coming from ubsan
On Mon, Oct 06, 2014 at 11:41:56 -0700, Kostya Serebryany wrote:> +samsonov > > Ben, you've forgot to add the patch. > I encourage you to use llvm.org/docs/Phabricator.html for code reviewsIt's there; both got held up in moderation (I split this single patch into a cover and the patch since I imagine there's discussion to be had about messages outside my patch). (Seems I messed up git send-email anyways since it still put my personal email on this.) I'll look at Phabricator. Thanks, --Ben