From: Petr Vorel <pvorel@suse.cz>
To: Wei Gao <wegao@suse.com>
Cc: ltp@lists.linux.it
Subject: Re: [LTP] [PATCH 1/1] recvmmsg01: Workaround segfault on libc variant on 32 bit
Date: Mon, 11 Nov 2024 10:58:16 +0100 [thread overview]
Message-ID: <20241111095816.GA162243@pevik> (raw)
In-Reply-To: <ZzHAtb2Zqc7Ffpzi@wegao>
Hi Wei, all,
...
> > -static void do_test(unsigned int i)
> > +static void verify_recvmmsg(unsigned int i, void *timeout)
> > {
> > struct time64_variants *tv = &variants[tst_variant];
> > struct test_case *tc = &tcase[i];
> > - void *timeout;
> > ts.type = tv->ts_type;
> > tst_ts_set_sec(&ts, tc->tv_sec);
> > tst_ts_set_nsec(&ts, tc->tv_nsec);
> > + TST_EXP_FAIL2(tv->recvmmsg(*tc->fd, *tc->msg_vec, VLEN, 0, timeout),
> > + tc->exp_errno, "recvmmsg() %s", tc->desc);
> > +}
> > +
> > +static void test_bad_addr(unsigned int i)
> > +{
> > + struct time64_variants *tv = &variants[tst_variant];
> > + void *timeout = bad_addr;
> > + pid_t pid;
> > + int status;
> > +
> > + pid = SAFE_FORK();
> > + if (!pid) {
> > + verify_recvmmsg(i, timeout);
> > + _exit(!TST_PASS);
> > + }
> > +
> > + SAFE_WAITPID(pid, &status, 0);
> > +
> > + if (WIFEXITED(status))
> > + return;
> > +
> > + if (tv->ts_type == TST_LIBC_TIMESPEC &&
> > + WIFSIGNALED(status) && WTERMSIG(status) == SIGSEGV) {
> > + tst_res(TPASS, "Child killed by signal");
> very nit:
> 1) s/Child killed by signal/Child killed by SIGSEGV signal/
I copy pasted it. Maybe better would be to print "Child killed by expected
signal" because it's IMHO irrelevant which signal it is, right?
Signal name is important only when there is other signal on TFAIL.
> 2) suggest also print out tc->desc
Here in test_bad_addr()? This is only used for a single testcase,
tc->desc is printed for the main testing with TST_EXP_FAIL2(),
therefore I don't think it will help debugging.
> Thanks for create patch fix our current issue.
Thanks for review. I'll try to get to the other testcases this week.
> Reviewed-by: Wei Gao <wegao@suse.com>
Kind regards,
Petr
--
Mailing list info: https://lists.linux.it/listinfo/ltp
next prev parent reply other threads:[~2024-11-11 9:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-08 12:21 [LTP] [PATCH 1/1] recvmmsg01: Workaround segfault on libc variant on 32 bit Petr Vorel
2024-11-11 8:30 ` Wei Gao via ltp
2024-11-11 9:58 ` Petr Vorel [this message]
2024-11-11 10:37 ` Cyril Hrubis
2024-11-11 14:24 ` Petr Vorel
2024-11-25 21:32 ` Petr Vorel
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=20241111095816.GA162243@pevik \
--to=pvorel@suse.cz \
--cc=ltp@lists.linux.it \
--cc=wegao@suse.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