public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Jan Stancek <jstancek@redhat.com>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH] testcases: cve-2014-0196: Set attempts according	to nb of cpus
Date: Tue, 19 Jun 2018 07:29:32 -0400 (EDT)	[thread overview]
Message-ID: <448349350.27477876.1529407772302.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <877en0i4zz.fsf@rpws.prws.suse.cz>



----- Original Message -----
> Hello,
> 
> Mylène Josserand writes:
> 
> > This test tries to cause a buffer overflow by doing 0x7000
> > attempts. In a slow system platform, it leads to a failure
> > because of the timeout even when it is configured with
> > LTP_TIMEOUT_MUL=10.
> >
> > This commit adds a way to configure the number of attempts
> > according to the number of CPUs.
> > In case of 1 CPU and a slow platform, using 0x2000 attempts
> > with a LTP_TIMEOUT_MUL=2 make the test pass.
> >
> > Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
> > ---
> >
> > Hello,
> >
> > This is a way to fix the issue I got but let me know
> > what you think of it. There is maybe a better way to
> > handle that.
> 
> Another way would be to measure the time a few iterations take and limit
> the number of attempts based on that.

Or measure total time and break the loop early if we come close to TESTTIME:

#define THRESHOLD 5000

tst_timer_start(CLOCK_MONOTONIC);
while (i < attempts) {
  tst_timer_stop();
  elapsed_ms = tst_timer_elapsed_ms();
  if (elapsed_ms + THRESHOLD > TESTTIME)
    break;
}

Regards,
Jan

> We should perhaps add that as a
> feature to the fuzzy sync library.
> >
> > Thank you,
> > Mylène
> >

      reply	other threads:[~2018-06-19 11:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-15  8:08 [LTP] [PATCH] testcases: cve-2014-0196: Set attempts according to nb of cpus =?unknown-8bit?q?Myl=C3=A8ne?= Josserand
2018-06-15 12:55 ` Richard Palethorpe
2018-06-19 11:29   ` Jan Stancek [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=448349350.27477876.1529407772302.JavaMail.zimbra@redhat.com \
    --to=jstancek@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox