From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261226AbTJ2R0v (ORCPT ); Wed, 29 Oct 2003 12:26:51 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261299AbTJ2R0v (ORCPT ); Wed, 29 Oct 2003 12:26:51 -0500 Received: from x35.xmailserver.org ([69.30.125.51]:8613 "EHLO x35.xmailserver.org") by vger.kernel.org with ESMTP id S261226AbTJ2R0u (ORCPT ); Wed, 29 Oct 2003 12:26:50 -0500 X-AuthUser: davidel@xmailserver.org Date: Wed, 29 Oct 2003 09:26:49 -0800 (PST) From: Davide Libenzi X-X-Sender: davide@bigblue.dev.mdolabs.com To: Ben Mansell cc: linux-kernel@vger.kernel.org Subject: Re: epoll gives broken results when interrupted with a signal In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org 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? - Davide