linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qian Cai <cai@lca.pw>
To: skhan@linuxfoundation.org, sfr@canb.auug.org.au
Cc: brendanhiggins@google.com, urielguajardo@google.com,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	kunit-dev@googlegroups.com, linux-next@vger.kernel.org
Subject: Re: [PATCH 2/2] kunit: ubsan integration
Date: Thu, 3 Sep 2020 08:38:25 -0400	[thread overview]
Message-ID: <20200903123824.GA4225@lca.pw> (raw)
In-Reply-To: <20200902125223.GA5676@lca.pw>

On Wed, Sep 02, 2020 at 08:52:24AM -0400, Qian Cai wrote:
> On Thu, Aug 06, 2020 at 05:43:26PM +0000, Uriel Guajardo wrote:
> > Integrates UBSAN into the KUnit testing framework. It fails KUnit tests
> > whenever it reports undefined behavior.
> > 
> > Signed-off-by: Uriel Guajardo <urielguajardo@google.com>
> 
> It looks like this patch had been merged into linux-next but the "[PATCH 1/2]
> kunit: support failure from dynamic analysis tools" did not. Hence, it caused a
> compiling failure.
> 
> lib/ubsan.c: In function ‘ubsan_prologue’:
> lib/ubsan.c:141:2: error: implicit declaration of function ‘kunit_fail_current_test’; did you mean ‘kunit_init_test’? [-Werror=implicit-function-declaration]
>   kunit_fail_current_test();
>   ^~~~~~~~~~~~~~~~~~~~~~~
>   kunit_init_test
> cc1: some warnings being treated as errors

Stephen, Shuah, can you revert this commit or pick up its dependency as well?

https://lore.kernel.org/linux-kselftest/20200813205722.1384108-1-urielguajardojr@gmail.com/

Still seeing this on today's linux-next build.

> 
> > ---
> >  lib/ubsan.c | 2 ++
> >  1 file changed, 2 insertions(+)
> > 
> > diff --git a/lib/ubsan.c b/lib/ubsan.c
> > index cb9af3f6b77e..1460e2c828c8 100644
> > --- a/lib/ubsan.c
> > +++ b/lib/ubsan.c
> > @@ -14,6 +14,7 @@
> >  #include <linux/types.h>
> >  #include <linux/sched.h>
> >  #include <linux/uaccess.h>
> > +#include <kunit/test.h>
> >  
> >  #include "ubsan.h"
> >  
> > @@ -137,6 +138,7 @@ static void ubsan_prologue(struct source_location *loc, const char *reason)
> >  {
> >  	current->in_ubsan++;
> >  
> > +	kunit_fail_current_test();
> >  	pr_err("========================================"
> >  		"========================================\n");
> >  	pr_err("UBSAN: %s in %s:%d:%d\n", reason, loc->file_name,
> > -- 
> > 2.28.0.163.g6104cc2f0b6-goog
> > 

  reply	other threads:[~2020-09-03 13:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-06 17:43 [PATCH 1/2] kunit: support failure from dynamic analysis tools Uriel Guajardo
2020-08-06 17:43 ` [PATCH 2/2] kunit: ubsan integration Uriel Guajardo
2020-08-10 20:42   ` Brendan Higgins
2020-08-13 20:49     ` Uriel Guajardo
2020-09-02 12:52   ` Qian Cai
2020-09-03 12:38     ` Qian Cai [this message]
2020-09-09  3:00       ` Stephen Rothwell
2020-08-07 14:15 ` [PATCH 1/2] kunit: support failure from dynamic analysis tools Alan Maguire
2020-08-07 22:40   ` Uriel Guajardo
2020-08-10 20:37 ` Brendan Higgins
2020-08-13 20:57 Uriel Guajardo
2020-08-13 20:57 ` [PATCH 2/2] kunit: ubsan integration Uriel Guajardo
2020-08-31 21:29   ` Shuah Khan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200903123824.GA4225@lca.pw \
    --to=cai@lca.pw \
    --cc=brendanhiggins@google.com \
    --cc=kunit-dev@googlegroups.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=sfr@canb.auug.org.au \
    --cc=skhan@linuxfoundation.org \
    --cc=urielguajardo@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).