All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwang@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] signal: add new testcase signal06.c
Date: Tue, 10 Nov 2015 17:19:52 +0800	[thread overview]
Message-ID: <CAEemH2f2sYe0t5F3Kh2Y7sYQkDW4uXoiHdvTv0gOHzWwWADXkg@mail.gmail.com> (raw)
In-Reply-To: <1677708720.5562278.1447075773714.JavaMail.zimbra@redhat.com>

Hi,

On Mon, Nov 9, 2015 at 9:29 PM, Jan Stancek <jstancek@redhat.com> wrote:

>
>
>
> Short summary what the problem is would be appreciated here.
>

ok, l will try.


>
> > +
> > +signal06: CFLAGS+=-O2 -lpthread
>
> just "-pthread"
>

ok.


>
> > + * Description:
> > + * These below commits fix the issue on v3.17-rc3-3 stable kernel:
>
> Here as well - short description what is the "issue".
>
ok.

>
> > + *
> > +#include "test.h"
> > +
> > +char *TCID = "signal06";
> > +int TST_TOTAL = 5;
> > +
> > +#if __x86_64__
> > +
> > +volatile double D;
> > +int FLAGE;
>
> FLAGE looks like it should be volatile too.
>

yeah, no problem.


>
> > +
> > +char altstack[4096 * 10] __attribute__((aligned(4096)));
> > +
> > +void test(double d)
> > +{
> > +     int loop = 1;
> > +     int pid = getpid();
> > +
> > +     D = d;
> > +     while (D == d && loop < 10000) {
>
> make "10000" DEFINE or at least a variable
>

yes.


>
> > +             /* sys_tkill(pid, SIGHUP); asm to avoid save/reload
> > +              * fp regs around c call */
> > +             asm ("" : : "a"(200), "D"(pid), "S"(1));
>
> If you include linux_syscall_numbers.h, you can be sure that __NR_tkill
> will be defined.
>

ok, sounds good.


> > +     } else {
> > +             tst_resm(TFAIL, "Bug Reproduced!");
> > +             exit(-1);
>
> Why not tst_exit()?
>

ok, good.


>
> > +             tst_count = 0;
> > +
> > +             for (i = 0; i < TST_TOTAL; i++) {
> > +
> > +                     sigaction(SIGSEGV, &sa, NULL);
> > +                     sigaltstack(&st, NULL);
> > +                     sa.sa_flags = SA_ONSTACK;
> > +                     sigaction(SIGHUP, &sa, NULL);
>
> Signal handler setup looks like it can be moved outside both loops.
>

yes, that's would be great.


>
> > +
> > +                     res = pthread_create(&pt, NULL, tfunc, NULL);
> > +                     if (res) {
> > +                             tst_brkm(TBROK, NULL, "pthread_create():
> %s",
> > +                                             tst_strerrno(res));
>
> If you use TEST(), then TRERRNO will print errno stored in TEST_RETURN.
>

yes.


>
> Regards,
> Jan
>
>
Thanks for reviewing this patch.  and then will sent V2.


-- 
Regards,
Li Wang
Email: liwang@redhat.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linux.it/pipermail/ltp/attachments/20151110/319d7071/attachment.html>

      reply	other threads:[~2015-11-10  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-07 12:28 [LTP] [PATCH] signal: add new testcase signal06.c Li Wang
2015-11-09 13:29 ` Jan Stancek
2015-11-10  9:19   ` Li Wang [this message]

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=CAEemH2f2sYe0t5F3Kh2Y7sYQkDW4uXoiHdvTv0gOHzWwWADXkg@mail.gmail.com \
    --to=liwang@redhat.com \
    --cc=ltp@lists.linux.it \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.