All of lore.kernel.org
 help / color / mirror / Atom feed
From: Li Wang <liwan@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v2] mtest06/mmap1: rewrite to newlib
Date: Tue, 27 Nov 2018 14:37:27 +0800	[thread overview]
Message-ID: <CAEemH2eOUxC+M17kagF=9fOPeEBHJFEFYYBO20LnhUtwa+qmNA@mail.gmail.com> (raw)
In-Reply-To: <0e62adebbb4e5c8e3aa28440f860234b937d3e56.1543219161.git.jstancek@redhat.com>

On Mon, Nov 26, 2018 at 4:21 PM Jan Stancek <jstancek@redhat.com> wrote:

> +static void sig_handler(int signal, siginfo_t *info,
> +       LTP_ATTRIBUTE_UNUSED void *ut)
> +{
> +       int ar_m, ar_u;
> +
> +       switch (signal) {
> +       case SIGSEGV:
> +               /* if we hit SIGSEGV between map/unmap, something is wrong */
> +               ar_u = tst_atomic_load(&unmapcnt);
> +               ar_m = tst_atomic_load(&mapcnt);
> +               if (was_area_mapped(br_map, br_unmap, ar_m, ar_u)) {
> +                       tst_res(TFAIL, "got sigsegv while mapped");
> +                       _exit(TFAIL);

why not use tst_brk() here?

> +               }
> +
> +               mapped_sigsegv_count++;
> +               longjmp(jmpbuf, 1);
> +               break;
> +       default:
> +               tst_res(TFAIL, "Unexpected signal - %d, addr: %p, exiting\n",
> +                       signal, info->si_addr);
> +               _exit(TBROK);

tst_brk() ?

> +       }
> +}
> +
> +void *map_write_unmap(void *ptr)
> +{
> +       long *args = ptr;
> +       void *tmp;

remove tmp pointer?

Beside these tiny issues, patch v2 looks good to me.

Reviewed-by: Li Wang <liwang@redhat.com>

--
Regards,
Li Wang

  reply	other threads:[~2018-11-27  6:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-26  8:21 [LTP] [PATCH v2] mtest06/mmap1: rewrite to newlib Jan Stancek
2018-11-27  6:37 ` Li Wang [this message]
2018-11-27  8:54   ` Jan Stancek
2018-11-29 13:44 ` Cyril Hrubis
2018-11-30  9:46   ` Jan Stancek
2019-02-04  8:34     ` Naresh Kamboju
2019-02-04  9:05       ` Jan Stancek
2019-02-05  6:46         ` Jan Stancek

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='CAEemH2eOUxC+M17kagF=9fOPeEBHJFEFYYBO20LnhUtwa+qmNA@mail.gmail.com' \
    --to=liwan@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.