From owner-freebsd-bugs Mon Aug 13 16:10: 7 2001 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by hub.freebsd.org (Postfix) with ESMTP id 08CAE37B40D for ; Mon, 13 Aug 2001 16:10:02 -0700 (PDT) (envelope-from gnats@FreeBSD.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.11.4/8.11.4) id f7DNA2t05272; Mon, 13 Aug 2001 16:10:02 -0700 (PDT) (envelope-from gnats) Received: from torb.pix.net (torb.pix.net [192.135.81.20]) by hub.freebsd.org (Postfix) with ESMTP id 5102A37B406 for ; Mon, 13 Aug 2001 16:01:59 -0700 (PDT) (envelope-from stripes@torb.pix.net) Received: (from stripes@localhost) by torb.pix.net (8.11.4/8.11.4) id f7DN1w805346; Mon, 13 Aug 2001 19:01:58 -0400 (EDT) (envelope-from stripes) Message-Id: <200108132301.f7DN1w805346@torb.pix.net> Date: Mon, 13 Aug 2001 19:01:58 -0400 (EDT) From: stripes@iamsofired.com Reply-To: stripes@iamsofired.com To: FreeBSD-gnats-submit@freebsd.org Cc: stripes@iamsofired.com X-Send-Pr-Version: 3.113 Subject: kern/29686: kevent EV_ADD EVFILT_WRITE does the wrong thing on a closed fd Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 29686 >Category: kern >Synopsis: kevent EV_ADD EVFILT_WRITE does the wrong thing on a closed fd >Confidential: no >Severity: serious >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Aug 13 16:10:01 PDT 2001 >Closed-Date: >Last-Modified: >Originator: jmo >Release: FreeBSD 4.3-RELEASE i386 >Organization: Not relivant >Environment: System: FreeBSD -noname- 4.3-RELEASE FreeBSD 4.3-RELEASE #1: Thu Jun 21 08:44:59 EDT 2001 stripes@torb.pix.net:/usr/src/sys/compile/PLASTIC i386 P-III, 4.3-RELEASE, libc >Description: I have a one shot EVFILT_WRITE filter on fd#7, it fires, and I close fd#7. My code (incorrectly) asks for the filter to be added again without opening the file descriptor again (fd#7 is a TCP stream, when open). kevent does not return with EBADF as I think it should. This might be a documentation issue, maybe someone really does want to be told about events on fd#7 after they open it. I would rather the EBADF though. kevent does return telling me I can write some data down the CLOSED fd#7. That's just wrong. Since we are trying to promote kevent as the new bestest way to do event driven I/O and stuff, having it be harder to use then needed seems like a bad idea. That's why I said the bug is "serious" even though the work around is "don't write the user land code to do The Wrong Thing". >How-To-Repeat: I can't submit the code, it was done for work. This pr isn't even from the same machine (I did put the problem machine's info in, not my own machine's info). >Fix: None, but as a work around, be careful not to ask for events on closed files. I admit I did the wrong thing there, but it will be easier to spot that if the kernel tells you right away... >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message