Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Aug 2001 19:01:58 -0400 (EDT)
From:      stripes@iamsofired.com
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        stripes@iamsofired.com
Subject:   kern/29686: kevent EV_ADD EVFILT_WRITE does the wrong thing on a closed fd
Message-ID:  <200108132301.f7DN1w805346@torb.pix.net>

next in thread | raw e-mail | index | archive | help

>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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200108132301.f7DN1w805346>