Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jan 2005 13:55:39 GMT
From:      Roman Nikitchenko <roman@trifle.net>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   threads/75795: applications linked with -lc_r can't close() fd opened by kqueue().
Message-ID:  <200501041355.j04DtdPf037598@www.freebsd.org>
Resent-Message-ID: <200501041400.j04E0jjp034332@freefall.freebsd.org>

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

>Number:         75795
>Category:       threads
>Synopsis:       applications linked with -lc_r can't close() fd opened by kqueue().
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    freebsd-threads
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 04 14:00:45 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Roman Nikitchenko
>Release:        RELENG_5
>Organization:
Trifle Co. Ltd.
>Environment:
FreeBSD hc.apex.dp.ua 5.3-STABLE FreeBSD 5.3-STABLE #0: Fri Dec 24 14:26:40 EET 2004     root@hc.apex.dp.ua:/usr/obj/usr/src/sys/HC  i386
>Description:
Any application that uses kqueue() can't close() obtained descriptors if linked with libc_r. It is FREEBSD-5.3 related problem. The errno is set to 6 (device not configured) after close.
Applications which uses signals need to be linked against libc_r as KSE has some problems with signals (kse_thr_interrupt).

>How-To-Repeat:
Do "g++ -lc_r" for source like this:

/* --- begin --- */
#include <sys/time.h>
#include <sys/event.h>
#include <stdio.h>
#include <unistd.h>

int main()
{
    int poller = kqueue();
    printf( "poller: %d\n", poller );
    int r = close( poller );
    if ( r<0 ) perror( "kqueue" );
}
/* --- end --- */

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



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