From: Ben Mansell <ben@zeus.com>
To: linux-kernel@vger.kernel.org
Subject: epoll gives broken results when interrupted with a signal
Date: Wed, 29 Oct 2003 15:00:58 +0000 (GMT) [thread overview]
Message-ID: <Pine.LNX.4.58.0310291439110.2982@stones.cam.zeus.com> (raw)
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?
Unfortunately, I've no simple test case code to demonstrate this -
but if there's any other information I can provide to help track this
down then let me know.
(Please CC: me on replies to the list)
Cheers,
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
next reply other threads:[~2003-10-29 15:01 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-29 15:00 Ben Mansell [this message]
2003-10-29 17:26 ` epoll gives broken results when interrupted with a signal Davide Libenzi
2003-10-29 17:38 ` Ben Mansell
2003-10-29 19:23 ` Davide Libenzi
2003-10-30 11:22 ` Ben Mansell
2003-10-30 14:48 ` Ben Mansell
2003-10-30 23:36 ` Davide Libenzi
2003-11-03 11:07 ` Ben Mansell
2003-10-31 23:00 ` Davide Libenzi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.58.0310291439110.2982@stones.cam.zeus.com \
--to=ben@zeus.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).