public inbox for ltp@lists.linux.it
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH 2/2] sched/autogroup01: Add new regression test
Date: Thu, 15 Jun 2017 16:31:13 +0200	[thread overview]
Message-ID: <20170615143113.GD2832@rei.lan> (raw)
In-Reply-To: <1497520655-12426-2-git-send-email-fenggw-fnst@cn.fujitsu.com>

Hi!
> +static void do_test(void)
> +{
> +	int i;
> +
> +	if (!SAFE_FORK()) {
> +		SAFE_FILE_PRINTF(PATH_AUTOGROUP, "%d", 1);
> +		SAFE_SETSID();
> +
> +		if (SAFE_FORK()) {
> +			pause();
> +			exit(0);

                     Do we really reach this exit(0)?

		     We are sending SIGKILL to this process after all...

> +		}
> +
> +		SAFE_KILL(getppid(), SIGKILL);
> +		usleep(1000);
> +
> +		SAFE_FILE_PRINTF(PATH_AUTOGROUP, "%d", 0);
> +		SAFE_SETSID();
> +
> +		for (i = 0; i < LOOPS; i++)
> +			usleep(10);
> +
> +		TST_CHECKPOINT_WAKE(0);
> +
> +		exit(0);
> +	}
> +
> +	SAFE_WAIT(NULL);
> +
> +	TST_CHECKPOINT_WAIT(0);
> +
> +	tst_res(TPASS, "Bug not reproduced");
> +}

Otherwise it looks fine. We may as well include the comments that were
present in the original reproducer as that makes the code a bit easier
to understand.

-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2017-06-15 14:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-15  9:57 [LTP] [PATCH 1/2] SAFE_MACROS: Add SAFE_SETSID() Guangwen Feng
2017-06-15  9:57 ` [LTP] [PATCH 2/2] sched/autogroup01: Add new regression test Guangwen Feng
2017-06-15 14:31   ` Cyril Hrubis [this message]
2017-06-16  1:43     ` [LTP] [PATCH v2] " Guangwen Feng
2017-06-19 17:45       ` Cyril Hrubis

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=20170615143113.GD2832@rei.lan \
    --to=chrubis@suse.cz \
    --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