From owner-freebsd-hackers@FreeBSD.ORG Tue Jul 10 14:19:12 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 442991065673; Tue, 10 Jul 2012 14:19:12 +0000 (UTC) (envelope-from c.kworr@gmail.com) Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by mx1.freebsd.org (Postfix) with ESMTP id 8929D8FC08; Tue, 10 Jul 2012 14:19:11 +0000 (UTC) Received: by bkcje9 with SMTP id je9so27130bkc.13 for ; Tue, 10 Jul 2012 07:19:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=7cl94lUV0C9EuGhkijqh6yxKuWV1HeaAx6GeJ2VLgZA=; b=r81FAZIXoHlVFT7bsuDxwRMf9WEV7G0LfTJY5bQ3xx4jDwUnAZYsxGY9p5NfvdXjun slztlJGxMMkQK2KxscmzjNjepEf3i5x0bNmjGBqqDOjxjGZH42Mkx/dPUw81oT/YP4Xd uK4wAS78YUAsAhilHH8HroE/vwD2h+KrYccU37P/9SLKLmKM8cBlvA/sWTx3LCi3iqkI 513xxT8LQsOjLmRPMFXiSQCYSp59g8itfwkxZb1BvAnrXYR345XfOax/PdX7rQSELiGh OxcubGbCI4mD2KDYCob6cHq5X4VwUXQPsb9MdoXumjqia0ckqcYaQ72zoBkwBX50dl5p Kd2w== Received: by 10.204.154.85 with SMTP id n21mr2982912bkw.48.1341929950342; Tue, 10 Jul 2012 07:19:10 -0700 (PDT) Received: from green.tandem.local (utwig.xim.bz. [91.216.237.46]) by mx.google.com with ESMTPS id hs2sm28383879bkc.1.2012.07.10.07.19.07 (version=SSLv3 cipher=OTHER); Tue, 10 Jul 2012 07:19:08 -0700 (PDT) Message-ID: <4FFC39D9.6080809@gmail.com> Date: Tue, 10 Jul 2012 17:19:05 +0300 From: Volodymyr Kostyrko User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120605 Firefox/12.0 SeaMonkey/2.9.1 MIME-Version: 1.0 To: Konstantin Belousov References: <4FFC1D2D.4020405@gmail.com> <20120710140203.GA2338@deviant.kiev.zoral.com.ua> In-Reply-To: <20120710140203.GA2338@deviant.kiev.zoral.com.ua> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: "freebsd-hackers@freebsd.org" , freebsd-standards@FreeBSD.org Subject: Re: kern/149857: [kqueue] kqueue not reporting EOF under certain circumstances X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 14:19:12 -0000 Konstantin Belousov wrote: >> This PR is rather old. I just had submitted new test case, now in plain c. >> >> It doesn't work exactly like python version, but the result is the same: >> >>> clang test.c >>> cat test.c | ./a.out >> -1 916 0 0 0 >> -1 0 32768 0 0 >>> ./a.out< test.c >> -1 916 0 0 0 >> <- and here we have a complete hang in [kqread]. > > And what is your expectation ? > > The vnode filter never returns EOF when current file position at the end > of file. It is documented that read filter returns when file offset if not > at the end of file, thats all. In fact, EV_EOF is returned on forced unmount. > I do not see a bug in kqueue. > > On the other hand, your C code has at least two things that I cannot > understand. First, EV_EOF is output flag, it makes absolutely no sense > to set it in command.Second, it is mistery for me what do you check with > if (kev.flags>> 15 == 1) { > test. EV_EOF on line 19 actually slipped by my fault, original source omits that one. It doesn't change anything. EV_EOF = 1 << 15 = 32768. And it _is_ returned when file is feed with the pipe. So you mean this is just my false assumption that EOF _should_ occur on stdin? And it actually occurs only if source is a process which can send EOF? -- Sphinx of black quartz judge my vow.