From owner-freebsd-standards@FreeBSD.ORG Mon Jul 9 11:07:21 2012 Return-Path: Delivered-To: freebsd-standards@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 2BC871065672 for ; Mon, 9 Jul 2012 11:07:21 +0000 (UTC) (envelope-from owner-bugmaster@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id EFE148FC2B for ; Mon, 9 Jul 2012 11:07:20 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q69B7Kdc075564 for ; Mon, 9 Jul 2012 11:07:20 GMT (envelope-from owner-bugmaster@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q69B7Kj2075562 for freebsd-standards@FreeBSD.org; Mon, 9 Jul 2012 11:07:20 GMT (envelope-from owner-bugmaster@FreeBSD.org) Date: Mon, 9 Jul 2012 11:07:20 GMT Message-Id: <201207091107.q69B7Kj2075562@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: gnats set sender to owner-bugmaster@FreeBSD.org using -f From: FreeBSD bugmaster To: freebsd-standards@FreeBSD.org Cc: Subject: Current problem reports assigned to freebsd-standards@FreeBSD.org X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Jul 2012 11:07:21 -0000 Note: to view an individual PR, use: http://www.freebsd.org/cgi/query-pr.cgi?pr=(number). The following is a listing of current problems submitted by FreeBSD users. These represent problem reports covering all versions including experimental development code and obsolete releases. S Tracker Resp. Description -------------------------------------------------------------------------------- o stand/169697 standards syslogd(8) is not BOM aware o stand/166349 standards Support the assignment-allocation character for fscanf o stand/165236 standards The NONE Wi-Fi regulatory restricts use of channels 12 o stand/164787 standards dirfd() function not available when _POSIX_C_SOURCE is o kern/164674 standards [patch] [libc] vfprintf/vfwprintf return error (EOF) o o stand/162434 standards getaddrinfo: addrinfo.ai_family is an address family, o stand/154842 standards invalid request authenticator in the second and subseq o stand/150093 standards C++ std::locale support is broken o stand/130067 standards Wrong numeric limits in system headers? o stand/124860 standards flockfile(3) doesn't work when the memory has been exh o stand/121921 standards [patch] Add leap second support to at(1), atrun(8) o stand/116477 standards rm(1): rm behaves unexpectedly when using -r and relat o bin/116413 standards incorrect getconf(1) handling of unsigned constants gi o stand/116081 standards make does not work with the directive sinclude p stand/107561 standards [libc] [patch] [request] Missing SUS function tcgetsid o stand/100017 standards [Patch] Add fuser(1) functionality to fstat(1) a stand/86484 standards [patch] mkfifo(1) uses wrong permissions o stand/82654 standards C99 long double math functions are missing o stand/81287 standards [patch] fingerd(8) might send a line not ending in CRL a stand/80293 standards sysconf() does not support well-defined unistd values o stand/79056 standards [feature request] [atch] regex(3) regression tests o stand/70813 standards [patch] ls(1) not Posix compliant o stand/66357 standards make POSIX conformance problem ('sh -e' & '+' command- s kern/64875 standards [libc] [patch] [request] add a system call: fdatasync( o stand/56476 standards [patch] cd9660 unicode support simple hack o stand/54410 standards one-true-awk not POSIX compliant (no extended REs) o stand/46119 standards Priority problems for SCHED_OTHER using pthreads o stand/44365 standards [headers] [patch] [request] introduce ulong and unchar a stand/41576 standards ln(1): replacing old dir-symlinks a docs/26003 standards getgroups(2) lists NGROUPS_MAX but not syslimits.h s stand/24590 standards timezone function not compatible witn Single Unix Spec o stand/21519 standards sys/dir.h should be deprecated some more s bin/14925 standards getsubopt isn't poisonous enough 33 problems total. From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 12:16:51 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 046841065670; Tue, 10 Jul 2012 12:16:51 +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 55C168FC0C; Tue, 10 Jul 2012 12:16:50 +0000 (UTC) Received: by bkcje9 with SMTP id je9so6285352bkc.13 for ; Tue, 10 Jul 2012 05:16:49 -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:subject :content-type:content-transfer-encoding; bh=GIdrdY0Z/ZpK93YsN0XogYGWXOwSPdI/0Nz0qA70IWc=; b=iFA4pVsHUC6IrLVK1avvgS6TtwQEj6Pv2efjvHYQseo/XTi4Rap1RC4EliJUsx+jM/ auIhuwF/17WfUaKyC8cEqnB1lJqDXSpMhZVXCHOwlUrrRjB4f92LPnULp8WsqsBYGPQW dLzdr6e3ouIvz/Fml3nwsj0O0VAkjl9K2EvipefvpmaDiCzCryH+Big7mSXPNQCU8cg7 0koJ7+tJAdNquiQBDd8jk4o2n5jzM5s838gMdW1E6BA1D1f90G0pABkXHfEBx11zliIh Q4bO5vr1Wd5W5ZvW8jXvoIeu1FbPWdC3LGlpUzA5WdNEymfU0A8Vk4lZNsiHAVuDeGnt uehg== Received: by 10.204.157.18 with SMTP id z18mr21065836bkw.16.1341922609398; Tue, 10 Jul 2012 05:16:49 -0700 (PDT) Received: from green.tandem.local (utwig.xim.bz. [91.216.237.46]) by mx.google.com with ESMTPS id t23sm20389050bks.4.2012.07.10.05.16.46 (version=SSLv3 cipher=OTHER); Tue, 10 Jul 2012 05:16:47 -0700 (PDT) Message-ID: <4FFC1D2D.4020405@gmail.com> Date: Tue, 10 Jul 2012 15:16:45 +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: freebsd-hackers@freebsd.org, freebsd-standards@FreeBSD.org Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: kern/149857: [kqueue] kqueue not reporting EOF under certain circumstances X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 12:16:51 -0000 Hi all. http://www.freebsd.org/cgi/query-pr.cgi?pr=kern/149857 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]. -- Sphinx of black quartz judge my vow. From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 14:03:17 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B185110656D2; Tue, 10 Jul 2012 14:03:17 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 2A3F98FC16; Tue, 10 Jul 2012 14:03:16 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6AE2Gud020232; Tue, 10 Jul 2012 17:02:16 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6AE23Z7053140; Tue, 10 Jul 2012 17:02:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6AE23tg053139; Tue, 10 Jul 2012 17:02:03 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jul 2012 17:02:03 +0300 From: Konstantin Belousov To: Volodymyr Kostyrko Message-ID: <20120710140203.GA2338@deviant.kiev.zoral.com.ua> References: <4FFC1D2D.4020405@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="dfOvyYudzT1RPUKx" Content-Disposition: inline In-Reply-To: <4FFC1D2D.4020405@gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: freebsd-hackers@freebsd.org, freebsd-standards@freebsd.org Subject: Re: kern/149857: [kqueue] kqueue not reporting EOF under certain circumstances X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 14:03:17 -0000 --dfOvyYudzT1RPUKx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 10, 2012 at 03:16:45PM +0300, Volodymyr Kostyrko wrote: > Hi all. >=20 > http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/149857 >=20 > This PR is rather old. I just had submitted new test case, now in plain c. >=20 > It doesn't work exactly like python version, but the result is the same: >=20 > > 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 unmoun= t. 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 =3D=3D 1) { test. --dfOvyYudzT1RPUKx Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/8NdsACgkQC3+MBN1Mb4iTxACgjIyAmfQzKZ1YJhjVqpcDeRtq cggAn1rOw71APAlZ1oyP+vvEyODsPtd2 =2fEs -----END PGP SIGNATURE----- --dfOvyYudzT1RPUKx-- From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 14:19:12 2012 Return-Path: Delivered-To: freebsd-standards@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-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance 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. From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 14:27:54 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DE070106564A; Tue, 10 Jul 2012 14:27:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id 603488FC15; Tue, 10 Jul 2012 14:27:53 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6AERxKN021974; Tue, 10 Jul 2012 17:27:59 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6AERkmh053337; Tue, 10 Jul 2012 17:27:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6AERk6p053336; Tue, 10 Jul 2012 17:27:46 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jul 2012 17:27:46 +0300 From: Konstantin Belousov To: Volodymyr Kostyrko Message-ID: <20120710142746.GD2338@deviant.kiev.zoral.com.ua> References: <4FFC1D2D.4020405@gmail.com> <20120710140203.GA2338@deviant.kiev.zoral.com.ua> <4FFC39D9.6080809@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="YTqNa7If1bmePjLb" Content-Disposition: inline In-Reply-To: <4FFC39D9.6080809@gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "freebsd-hackers@freebsd.org" , freebsd-standards@freebsd.org Subject: Re: kern/149857: [kqueue] kqueue not reporting EOF under certain circumstances X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 14:27:54 -0000 --YTqNa7If1bmePjLb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 10, 2012 at 05:19:05PM +0300, Volodymyr Kostyrko wrote: > 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 n= ot > >at the end of file, thats all. In fact, EV_EOF is returned on forced=20 > >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 =3D=3D 1) { > >test. >=20 > EV_EOF on line 19 actually slipped by my fault, original source omits=20 > that one. It doesn't change anything. Yes. >=20 > EV_EOF =3D 1 << 15 =3D 32768. And it _is_ returned when file is feed with= =20 > the pipe. >=20 > So you mean this is just my false assumption that EOF _should_ occur on= =20 > stdin? And it actually occurs only if source is a process which can send= =20 > EOF? 'Source' cannot be a process. Read filter on pipes can return EV_EOF. Read filter on vnodes (read: regular files) does not return EV_EOF, except in situation that is created by manual intervention of administrator. It should have been clear from my previous response. --YTqNa7If1bmePjLb Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/8O+IACgkQC3+MBN1Mb4ia3gCdFAvD2rv3oCQuQQJ+PyM7H4my YhQAoPKslmosOliJkgVQUOu1TgIJfULV =0aSI -----END PGP SIGNATURE----- --YTqNa7If1bmePjLb-- From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 15:02:56 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 22EFB1065781; Tue, 10 Jul 2012 15:02:56 +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 6A1058FC14; Tue, 10 Jul 2012 15:02:55 +0000 (UTC) Received: by bkcje9 with SMTP id je9so85958bkc.13 for ; Tue, 10 Jul 2012 08:02:54 -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=RZRfuKFOwkFeC+V3NRXnWkIWY8zwesP6dII6YQlflVQ=; b=pfOLyD2FV8tpn6Ye4y0Yx4Wz0zn/iJ1g3UtmGCc1Ag1aBTXebaNvJ7bo6BRaXa8bVX 7S3E84knOCv8OcEz/4GsDsInlllEGiZa0TrJiD7jol341WPRRSzokcygbk/PGK4mrHwq IhiW+zbLlDhz8O0TZP5F951M4O+TCXa7t2nr1t/ikN6SfzLHCtbHWStsSVSOJcRiftRl 8FPlknSWZI25GPBk9gjKfw8tGE9DuMnt1R7r0kceLwCFEyr6TPmyUQbhrK/TGyrDC1mj RWPjqLxRuT5i0BU97i0UKtNZ6wMHJQLJWteXoeMyqxdZHh71e/RZxl5V1HZu2UymZgxk /DTA== Received: by 10.205.128.141 with SMTP id he13mr15452938bkc.112.1341932574438; Tue, 10 Jul 2012 08:02:54 -0700 (PDT) Received: from green.tandem.local (utwig.xim.bz. [91.216.237.46]) by mx.google.com with ESMTPS id t23sm20751813bks.4.2012.07.10.08.02.51 (version=SSLv3 cipher=OTHER); Tue, 10 Jul 2012 08:02:53 -0700 (PDT) Message-ID: <4FFC441A.2010500@gmail.com> Date: Tue, 10 Jul 2012 18:02:50 +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> <4FFC39D9.6080809@gmail.com> <20120710142746.GD2338@deviant.kiev.zoral.com.ua> In-Reply-To: <20120710142746.GD2338@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-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 15:02:56 -0000 Konstantin Belousov wrote: >> 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? > > 'Source' cannot be a process. Read filter on pipes can return EV_EOF. > Read filter on vnodes (read: regular files) does not return EV_EOF, > except in situation that is created by manual intervention of > administrator. This keeps me puzzled. How then I can tell that file at stdin is already at EOF? You mean I should treat stdin like normal vnode-backed file? off_t pos = 0, endpos; lseek(fileno(stdin), 0, SEEK_END); endpos = ftell(stdin); lseek(fileno(stdin), 0, SEEK_SET); ... and then later check it with: if(endpos != -1) { pos += kev.data; if(pos >= endpos) { printf("end reached\n"); return(0); } } Is this a correct way to detect EOF? I'm letting besides that I should also detect vnode changes and update max file size accordingly. > It should have been clear from my previous response. Please excuse me, I'm a bit new to this things... -- Sphinx of black quartz judge my vow. From owner-freebsd-standards@FreeBSD.ORG Tue Jul 10 15:22:15 2012 Return-Path: Delivered-To: freebsd-standards@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 562B9106566C; Tue, 10 Jul 2012 15:22:15 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (mx0.zoral.com.ua [91.193.166.200]) by mx1.freebsd.org (Postfix) with ESMTP id CD1A48FC14; Tue, 10 Jul 2012 15:22:14 +0000 (UTC) Received: from skuns.kiev.zoral.com.ua (localhost [127.0.0.1]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id q6AFMLXA027827; Tue, 10 Jul 2012 18:22:21 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5) with ESMTP id q6AFM8r7053679; Tue, 10 Jul 2012 18:22:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.5/8.14.5/Submit) id q6AFM8Hn053678; Tue, 10 Jul 2012 18:22:08 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 10 Jul 2012 18:22:08 +0300 From: Konstantin Belousov To: Volodymyr Kostyrko Message-ID: <20120710152208.GF2338@deviant.kiev.zoral.com.ua> References: <4FFC1D2D.4020405@gmail.com> <20120710140203.GA2338@deviant.kiev.zoral.com.ua> <4FFC39D9.6080809@gmail.com> <20120710142746.GD2338@deviant.kiev.zoral.com.ua> <4FFC441A.2010500@gmail.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="ZSoWtPk5XaIUnOQI" Content-Disposition: inline In-Reply-To: <4FFC441A.2010500@gmail.com> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: clamav-milter 0.95.2 at skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.0 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: "freebsd-hackers@freebsd.org" , freebsd-standards@freebsd.org Subject: Re: kern/149857: [kqueue] kqueue not reporting EOF under certain circumstances X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jul 2012 15:22:15 -0000 --ZSoWtPk5XaIUnOQI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Jul 10, 2012 at 06:02:50PM +0300, Volodymyr Kostyrko wrote: > Konstantin Belousov wrote: > >>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? > > > >'Source' cannot be a process. Read filter on pipes can return EV_EOF. > >Read filter on vnodes (read: regular files) does not return EV_EOF, > >except in situation that is created by manual intervention of > >administrator. >=20 > This keeps me puzzled. How then I can tell that file at stdin is already= =20 > at EOF? You mean I should treat stdin like normal vnode-backed file? >=20 > off_t pos =3D 0, endpos; >=20 > lseek(fileno(stdin), 0, SEEK_END); > endpos =3D ftell(stdin); > lseek(fileno(stdin), 0, SEEK_SET); >=20 > ... and then later check it with: >=20 > if(endpos !=3D -1) { > pos +=3D kev.data; > if(pos >=3D endpos) { > printf("end reached\n"); > return(0); > } > } >=20 > Is this a correct way to detect EOF? I'm letting besides that I should=20 > also detect vnode changes and update max file size accordingly. >=20 > >It should have been clear from my previous response. >=20 > Please excuse me, I'm a bit new to this things... Why do you use kqueue there at all ? Just read from stdin, and decide that you hit EOF when read returned 0 bytes. If insisting on using kqueue, which may be ligitimate if you process other sources besides stdin, you should first investigate the nature of the fd 0 using fstat, and then use appropriate code for regular file, pipe and probably socket (e.g. for the case if code allows to run under inetd(8)). --ZSoWtPk5XaIUnOQI Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (FreeBSD) iEYEARECAAYFAk/8SJwACgkQC3+MBN1Mb4jqSgCdHgVPqhHwmfHo6xP3bSVIj7LU OoIAnRa30uNLPclEEcXgk17m6VXbU7JG =c8s9 -----END PGP SIGNATURE----- --ZSoWtPk5XaIUnOQI-- From owner-freebsd-standards@FreeBSD.ORG Thu Jul 12 03:42:15 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 935D7106566B; Thu, 12 Jul 2012 03:42:15 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 6632F8FC15; Thu, 12 Jul 2012 03:42:15 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6C3gFYq031352; Thu, 12 Jul 2012 03:42:15 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6C3gFFT031348; Thu, 12 Jul 2012 03:42:15 GMT (envelope-from linimon) Date: Thu, 12 Jul 2012 03:42:15 GMT Message-Id: <201207120342.q6C3gFFT031348@freefall.freebsd.org> To: dfilter@FreeBSD.ORG, linimon@FreeBSD.org, gnats-admin@FreeBSD.org, freebsd-standards@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: standards/169756: Re: standards/168719: commit references a PR X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 03:42:15 -0000 Old Synopsis: Re: standard/168719: commit references a PR New Synopsis: Re: standards/168719: commit references a PR State-Changed-From-To: open->closed State-Changed-By: linimon State-Changed-When: Thu Jul 12 03:41:39 UTC 2012 State-Changed-Why: Misfiled followup to standards/168719; content migrated. Responsible-Changed-From-To: gnats-admin->freebsd-standards Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jul 12 03:41:39 UTC 2012 Responsible-Changed-Why: http://www.freebsd.org/cgi/query-pr.cgi?pr=169756 From owner-freebsd-standards@FreeBSD.ORG Thu Jul 12 03:46:26 2012 Return-Path: Delivered-To: freebsd-standards@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5DC54106567B; Thu, 12 Jul 2012 03:46:26 +0000 (UTC) (envelope-from linimon@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 3178F8FC1E; Thu, 12 Jul 2012 03:46:26 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.5/8.14.5) with ESMTP id q6C3kQ8E031728; Thu, 12 Jul 2012 03:46:26 GMT (envelope-from linimon@freefall.freebsd.org) Received: (from linimon@localhost) by freefall.freebsd.org (8.14.5/8.14.5/Submit) id q6C3kQAs031723; Thu, 12 Jul 2012 03:46:26 GMT (envelope-from linimon) Date: Thu, 12 Jul 2012 03:46:26 GMT Message-Id: <201207120346.q6C3kQAs031723@freefall.freebsd.org> To: linimon@FreeBSD.org, freebsd-standards@FreeBSD.org, freebsd-ports-bugs@FreeBSD.org From: linimon@FreeBSD.org Cc: Subject: Re: ports/169756: Re: ports/169718: commit references a PR X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 12 Jul 2012 03:46:26 -0000 Old Synopsis: Re: standards/168719: commit references a PR New Synopsis: Re: ports/169718: commit references a PR Responsible-Changed-From-To: freebsd-standards->freebsd-ports-bugs Responsible-Changed-By: linimon Responsible-Changed-When: Thu Jul 12 03:45:35 UTC 2012 Responsible-Changed-Why: sigh. Correct the PR that this was a misfiled followup to. http://www.freebsd.org/cgi/query-pr.cgi?pr=169756