threads/75795: applications linked with -lc_r can't close() fd opened by kqueue().

Roman Nikitchenko roman at trifle.net
Tue Jan 4 14:00:45 GMT 2005


>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 at 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:


More information about the freebsd-threads mailing list