Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 29 Jul 2003 12:57:55 +0300 (EEST)
From:      Roman Nikitchenko <hc@www.trifle.net>
To:        FreeBSD-gnats-submit@FreeBSD.org
Subject:   kern/55007: btoken close() on kqueue filter descriptors.
Message-ID:  <200307290957.h6T9vtbt082701@www.trifle.net>
Resent-Message-ID: <200307291000.h6TA0XTB007201@freefall.freebsd.org>

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

>Number:         55007
>Category:       kern
>Synopsis:       btoken close() on kqueue filter descriptors.
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jul 29 03:00:32 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Roman Nikitchenko
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
Trifle Co. Ltd.
>Environment:
System: FreeBSD hc.apex.dp.ua 4.8-STABLE FreeBSD 4.8-STABLE #0: Mon Jul 28 18:51:32 EEST 2003 hc@hc.apex.dp.ua:/usr/src/sys/compile/HC i386
>Description:
    File descriptors obtained through kqueue() call can't be closed using
    uthread_close() because of non-libc_r kqueue() implementation and
    _thread_fd_table checks on uthread_close(). I see this behaviour after
    checks in /usr/src/lib/libc_r/uthread/uthread_close.c in the
    following branches:
    MAIN: after revision 1.14, RELENG_4_8_BP after revision 1.10.2.4.
>How-To-Repeat:
    Link against libc_r anything like this:

	int poller = kqueue();
	if ( close( poller ) < 0 )
	    perror( "close" );
>Fix:
    Write uthread_kqueue() function inserting new kqueue() descriptor into
    _thread_fd_table (maybe better way exists, but this is all i found).

    As workaround: syscall( SYS_close, fd ), but this is too dirty.

>Release-Note:
>Audit-Trail:
>Unformatted:



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