From owner-freebsd-bugs@freebsd.org Thu Sep 17 09:33:08 2015 Return-Path: Delivered-To: freebsd-bugs@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 923259CE30E for ; Thu, 17 Sep 2015 09:33:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7785217ED for ; Thu, 17 Sep 2015 09:33:08 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t8H9X8Ks018486 for ; Thu, 17 Sep 2015 09:33:08 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-bugs@FreeBSD.org Subject: [Bug 203162] when close(fd) on a fifo fails with EINTR, the file descriptor is not really closed Date: Thu, 17 Sep 2015 09:33:08 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.1-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: victor.stinner@gmail.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-bugs@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Sep 2015 09:33:08 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D203162 --- Comment #5 from Victor Stinner --- "The patch would prefer to return success over the EINTR when signal is delivered while other end of fifo becomes ready simultaneously." Do you mean that the signal will be delivered later to the application? Ignoring completly a signal doesn't sound like a good idea :-) "Note that the patch still does not fix the fundamental underground issue of the troubles, which is in the test structure itself." I'm not sure that I understand: do you mean that the test has a race condit= ion? FYI the Python test suite is executed on a wide range of architectures and platforms: http://buildbot.python.org/all/waterfall?category=3D3.x.stable&category=3D3= .x.unstable The test_eintr test is executed and pass on Linux, Mac OS X, Solaris (and OpenIndiana), OpenBSD, etc. For FreeBSD, test_eintr hangs 50% of the time (= raw estimation). For OpenBSD, I'm not sure, the buildbot is currently disabled. For Mac OS X, I'm surprised, I thaught that Mac OS X stole a large part of FreeBSD code := -) Well... I had a lot of trouble to write a reliable C program to reproduce t= he issue, so the test may hangs on any platform, but I didn't notice hang (I d= on't check _each_ build of each platforms, it would take too much time). But at least, I can say that the bug fails frequently on FreeBSD, whereas I never saw it failing on Linux. "If child reader manages to close fifo before the parent writer sleeping in open has a chance to run, parent would deadlock, since nothing else would o= pen the fifo for read." On Linux, the open(O_RDONLY) in the child blocks until the open(O_WRONLY) succeed. The Linux kernel looks to ensure that both open succeed "at the ti= me same". Short test in Python. Parent: $ python3 Python 3.4.2 (default, Jul 9 2015, 17:24:30)=20 [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux >>> import os >>> os.mkfifo("fifo") >>> f=3Dopen("fifo", "wb") ^Z [1]+ Stopp=C3=A9 python3 -q Child: haypo@smithers$ python3=20 Python 3.4.2 (default, Jul 9 2015, 17:24:30)=20 [GCC 5.1.1 20150618 (Red Hat 5.1.1-4)] on linux >>> f=3Dopen("fifo", "rb") I used CTRL+z to stop the parent process: the child process hangs until I restart the parent process (using "fg"). --=20 You are receiving this mail because: You are the assignee for the bug.=