Re: epoll gives broken results when interrupted with a signal

From: Ben Mansell (ben_at_zeus.com)
Date: 10/29/03

  • Next message: lkml-031028_at_amos.mailshell.com: "Re: 2.6.0test9 Reiserfs boot time "buffer layer error at fs/buffer.c:431""
    Date:	Wed, 29 Oct 2003 17:38:47 +0000 (GMT)
    To: Davide Libenzi <davidel@xmailserver.org>
    
    

    On Wed, 29 Oct 2003, Davide Libenzi wrote:

    > On Wed, 29 Oct 2003, Ben Mansell wrote:
    >
    > > I'm using the epoll system interface on a 2.6.0-test9 kernel, but I hit
    > > a problem if the process calling epoll_wait() gets interrupted. The
    > > epoll_wait() returns with several events, but the last event of which
    > > contains junk (e.g. typically reports that a file descriptor like
    > > -91534560 received an event)
    > >
    > > The epoll is being used to monitor only a handful of file descriptors.
    > > Some of these however are TCP network sockets that were bound to a port
    > > by a parent process, and then passed on to the process doing the epoll.
    > > Another file descriptor is that of a socket connected to the parent
    > > process. The epoll failure is brought about when the parent process
    > > tries to kill off the child with a SIGTERM. The parent then exits.
    > >
    > > The final (interrupted) epoll returns two events - the first is that of
    > > the socket to the dead parent, receiving EPOLLIN | EPOLLHUP, which seems
    > > reasonable. The next event is then random garbage. Perhaps epoll is just
    > > returning one too many results?
    >
    > Is it an UP or an SMP machine? The descriptor is passed how? fork? If I'll
    > send you a debug patch for epoll will you be able to run it?

    UP machine - x86_64 however, if that makes any difference (sorry, my
    initial message didn't contain much information, as I wasn't sure what
    was relevant and what was not). The descriptor is passed over the unix
    domain socket between the two processes.

    I'm willing to try any debug patch that might help track down the
    problem.

    Thanks,
    Ben

    -- 
    Ben Mansell, <ben@zeus.com>                       Zeus Technology Ltd
    Download the world's fastest webserver!   Universally Serving the Net
    T:+44(0)1223 525000 F:+44(0)1223 525100           http://www.zeus.com
    Zeus House, Cowley Road, Cambridge, CB4 0ZT, ENGLAND
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: lkml-031028_at_amos.mailshell.com: "Re: 2.6.0test9 Reiserfs boot time "buffer layer error at fs/buffer.c:431""

    Relevant Pages

    • Re: epoll and shared fds
      ... resulting file descriptors to P2 through a unix socket. ... P2 registers the received socket in his epollfd. ... Though the documentation says that if a process closes a file ... For epoll, a close is when the kernel file* is released (that is, when all ...
      (Linux-Kernel)
    • Re: epoll and shared fds
      ... resulting file descriptors to P2 through a unix socket. ... P2 registers the received socket in his epollfd. ... Though the documentation says that if a process closes a file ... For epoll, a close is when the kernel file* is released (that is, when all ...
      (Linux-Kernel)
    • Re: epoll and shared fds
      ... resulting file descriptors to P2 through a unix socket. ... P2 registers the received socket in his epollfd. ... Though the documentation says that if a process closes a file ... For epoll, a close is when the kernel file* is released (that is, when all ...
      (Linux-Kernel)
    • Re: Syslets, Threadlets, generic AIO support, v6
      ... kevent showed no significant advantage over epoll. ... yeah - this is a fundamental design question for Linus i guess :-) glibc ... 'hidden' file descriptors at the upper end of the fd space) so that it ...
      (Linux-Kernel)
    • Re: epoll and shared fds
      ... resulting file descriptors to P2 through a unix socket. ... P2 registers the received socket in his epollfd. ... Though the documentation says that if a process closes a file ... For epoll, a close is when the kernel file* is released (that is, when all ...
      (Linux-Kernel)