This is the mail archive of the libc-hacker@cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Bad resolver, poll() emulation, and Linux 2.0 interaction


> 
> I've got a bad case of program indigestion by the verified (with GDB) fact
> that sometimes, poll() is called with POLLIN set in a file descriptor, but
> it returns with POLLOUT set. Needless to say, that causes programs to hang,
> among them anything which uses the DNS resolver (since the thing blindly,
> but correctly, expects POLLIN to be set when poll() returns 1).
> 
> I don't understand how that might happen, though. The kernel explicitly
> checks if the write bit in the input mask is set before it sets the bit in
> the output mask. The __emulate_poll() code sets the bit in the write mask
> only if it sees POLLOUT, then it calls select() and then it sets POLLOUT
> only if it sees the bit in the write mask.
> 
> This is a 2.0.34 kernel, by the way. Everything else (i.e., egcs and glibc) is
> reasonably current.
> 
> Any ideas?
> 

Get gdb 4.17.0.11 and use hardware watchpoint to see when/where it get
changed.


-- 
H.J. Lu (hjl@gnu.org)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]