From owner-svn-src-head@freebsd.org Mon Oct 10 15:35:00 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF021C07E1D; Mon, 10 Oct 2016 15:35:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: from mail-io0-f175.google.com (mail-io0-f175.google.com [209.85.223.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 5CDD4AF1; Mon, 10 Oct 2016 15:35:00 +0000 (UTC) (envelope-from cse.cem@gmail.com) Received: by mail-io0-f175.google.com with SMTP id i202so114290809ioi.2; Mon, 10 Oct 2016 08:35:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:reply-to:in-reply-to:references :from:date:message-id:subject:to:cc; bh=+LDSNEmS0Ut98gJ0QU25qfYN8c4DnbRfO21d5AIXJY4=; b=QGpmVLLf98c+bbnxvyHlKnjS9zkHxAMIzB9+l4HxtbPbawVcw9EajRH4S7YL+nDInU ZNW3JDA6AsfSDGD9V8Oy9onm3KZbF9JdSst2qIQBjZ+dWkfF1ONlIgS+8pIHX9UaF0OG oGHl7e3maNedNZl6csh5Vh4Ia3VnLffeeuB8kJtUero8Z3ad7sFz0vNZQqcYPxxgXUMd 3B/Bd65j/Ty6v5eGNVJ39S0LNsPI+ER8m643qJ5q1X/53RFNurtxrLiAuGZ7W1FIvEOj x+nM1N+3RYEwN/U938jPT1vwP6gKotN37HGN2qRGQsOejuaLpHeN+dGcQCShZMcqkMlw DxIw== X-Gm-Message-State: AA6/9RmkQv6M0fj4OhdMRSjL6P3XOS45Gyg/QvaOw3wlmLBlrtTiNVzUD5iNfIL9u0naVQ== X-Received: by 10.107.29.21 with SMTP id d21mr18784589iod.10.1476111885721; Mon, 10 Oct 2016 08:04:45 -0700 (PDT) Received: from mail-io0-f177.google.com (mail-io0-f177.google.com. [209.85.223.177]) by smtp.gmail.com with ESMTPSA id a192sm6897434itc.8.2016.10.10.08.04.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 08:04:45 -0700 (PDT) Received: by mail-io0-f177.google.com with SMTP id i202so113270486ioi.2; Mon, 10 Oct 2016 08:04:45 -0700 (PDT) X-Received: by 10.107.168.96 with SMTP id r93mr31796675ioe.31.1476111884796; Mon, 10 Oct 2016 08:04:44 -0700 (PDT) MIME-Version: 1.0 Reply-To: cem@freebsd.org Received: by 10.36.220.129 with HTTP; Mon, 10 Oct 2016 08:04:44 -0700 (PDT) In-Reply-To: <201610101340.u9ADe5XW093068@repo.freebsd.org> References: <201610101340.u9ADe5XW093068@repo.freebsd.org> From: Conrad Meyer Date: Mon, 10 Oct 2016 08:04:44 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: svn commit: r306962 - head/tests/sys/kern/pipe To: Ruslan Bukin Cc: src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset=UTF-8 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 10 Oct 2016 15:35:00 -0000 We also observed this test was broken, but I think the right fix is much smaller: --- a/tests/sys/kern/pipe/pipe_fstat_bug_test.c +++ b/tests/sys/kern/pipe/pipe_fstat_bug_test.c @@ -108,7 +108,6 @@ main(void) SYNC_W(0, go2); SYNC_R(0, go); - SYNC_W(0, go2); /* XXX: why is this required? */ WRITE(8192); SYNC_W(0, go2); (That line breaks the synchronization mechanism that is the only guarantee the test passes.) Best, Conrad On Mon, Oct 10, 2016 at 6:40 AM, Ruslan Bukin wrote: > Author: br > Date: Mon Oct 10 13:40:05 2016 > New Revision: 306962 > URL: https://svnweb.freebsd.org/changeset/base/306962 > > Log: > Ensure data in pipe is available to read. > Useful for latest (5th, direct mode) test only. > > Sponsored by: DARPA, AFRL > Sponsored by: HEIF5 > > Modified: > head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > > Modified: head/tests/sys/kern/pipe/pipe_fstat_bug_test.c > ============================================================================== > --- head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 11:53:54 2016 (r306961) > +++ head/tests/sys/kern/pipe/pipe_fstat_bug_test.c Mon Oct 10 13:40:05 2016 (r306962) > @@ -26,6 +26,7 @@ SUCH DAMAGE. > #include > #include > #include > +#include > #include > #include > #include > @@ -49,10 +50,12 @@ main(void) > { > char buffer[32768], buffer2[32768], go[] = "go", go2[] = "go2"; > int desc[2], ipc_coord[2]; > + struct kevent event, ke; > ssize_t error; > int successes = 0; > struct stat status; > pid_t new_pid; > + int kq; > > error = pipe(desc); > if (error == -1) > @@ -118,9 +121,24 @@ main(void) > _exit(0); > } > > + kq = kqueue(); > + if (kq == -1) > + _exit(1); > + > + EV_SET(&ke, desc[0], EVFILT_READ, EV_ADD, 0, 0, NULL); > + > + /* Attach event to the kqueue. */ > + if (kevent(kq, &ke, 1, NULL, 0, NULL) != 0) > + _exit(2); > + > while (successes < 5) { > SYNC_W(1, go); > SYNC_R(1, go2); > + > + /* Ensure data is available to read */ > + if (kevent(kq, NULL, 0, &event, 1, NULL) != 1) > + _exit(3); > + > fstat(desc[0], &status); > error = read(desc[0], &buffer2, sizeof(buffer2)); > >