Bugs in glibc 2.2

H . J . Lu hjl@lucon.org
Sat May 20 16:46:00 GMT 2000


Hi,

I am working on several bugs in glibc 2.2. I had an impression that
glibc 2.2 was very unstable. I was wondering how many people were
using glibc 2.2. To start,

There are

struct __res_state _res;

and

void
res_close(void) {
        res_nclose(&_res);
}

void
res_nclose(res_state statp) {
        if (statp->_sock >= 0) {
                (void) close(statp->_sock);
                statp->_sock = -1;
                statp->_flags &= ~(RES_F_VC | RES_F_CONN);
        }
}

since _res._sock is 0, close (0) is called. It is very bad
when 0 may be a valid fd for something else. There are other
bugs I am trying to do down. For example,

# man read 

no longer works.


H.J.



More information about the Libc-hacker mailing list