From owner-freebsd-bugs@FreeBSD.ORG Thu Apr 24 16:46:42 2014 Return-Path: Delivered-To: freebsd-bugs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 726FF2FA; Thu, 24 Apr 2014 16:46:42 +0000 (UTC) Received: from mail110.syd.optusnet.com.au (mail110.syd.optusnet.com.au [211.29.132.97]) by mx1.freebsd.org (Postfix) with ESMTP id 368C2125C; Thu, 24 Apr 2014 16:46:41 +0000 (UTC) Received: from c122-106-147-133.carlnfd1.nsw.optusnet.com.au (c122-106-147-133.carlnfd1.nsw.optusnet.com.au [122.106.147.133]) by mail110.syd.optusnet.com.au (Postfix) with ESMTPS id 13C89785A25; Fri, 25 Apr 2014 02:46:33 +1000 (EST) Date: Fri, 25 Apr 2014 02:46:26 +1000 (EST) From: Bruce Evans X-X-Sender: bde@besplex.bde.org To: Justin Cormack Subject: Re: kern/188952: read after revoke giving error not eof In-Reply-To: <201404241134.s3OBYao3023589@cgiserv.freebsd.org> Message-ID: <20140425023117.L11071@besplex.bde.org> References: <201404241134.s3OBYao3023589@cgiserv.freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=QIpRGG7L c=1 sm=1 tr=0 a=7NqvjVvQucbO2RlWB8PEog==:117 a=PO7r1zJSAAAA:8 a=ho9ZteZpsF0A:10 a=kj9zAlcOel0A:10 a=JzwRw_2MAAAA:8 a=c85gEFGjHRjhLTd9V74A:9 a=CjuIK1q_8ugA:10 Cc: freebsd-bugs@freebsd.org, freebsd-gnats-submit@freebsd.org X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Apr 2014 16:46:42 -0000 On Thu, 24 Apr 2014, Justin Cormack wrote: >> Description: > I have this ktrace of revoking a pty device: > ... > 43214 luajit-2.0.2 CALL revoke(0xfebc8) > 43214 luajit-2.0.2 NAMI "/dev/pts/1" > 43214 luajit-2.0.2 RET revoke 0 > 43214 luajit-2.0.2 CALL read(0x4,0xa4170,0x1000) > 43214 luajit-2.0.2 RET read -1 errno 6 Device not configured > > As you can see the revoke succeeds but the read is an error. The man page says: > > The revoke() system call invalidates all current open file descriptors in > the system for the file named by path. Subsequent operations on any such > descriptors fail, with the exceptions that a read() from a character > device file which has been revoked returns a count of zero (end of file), > ... > > So the read should be giving a count of zero not an error according to the docs (this happens eg in NetBSD), although maybe the sentence after is trying to tell me something else. deadfs and devfs still try to return EOF for dead ttys, though devfs still has a comment saying that this is redundant for it (it is obviously not redundant for devfs, since devfs is the only place that sets the flag VV_ISTTY used by deadfs). Bruce