Re: epoll gives broken results when interrupted with a signal

From: Davide Libenzi
Date: Thu Oct 30 2003 - 18:37:04 EST


On Thu, 30 Oct 2003, Ben Mansell wrote:

> On Thu, 30 Oct 2003, Ben Mansell wrote:
>
> > On Wed, 29 Oct 2003, Davide Libenzi wrote:
> >
> > > Can you try the patch below and show me a dmesg when this happen?
> >
> > Ok, patch applied. (I changed DEBUG_EPOLL to 10 however, otherwise
> > nothing would be printed). Now, epoll appears to behave perfectly and I
> > can't re-create the problem :(
>
> Got it! I was missing the problem because I had removed some debug
> messages in my own code. Here's another run, this time the
> final epoll_wait() call of the child process brings back 2 events:
> Event 0 fd: 7 events: 17
> Event 1 fd: -2095926561 events: 0
>
> I've added the debug to the end of this message.
>
> If I modify the code so there are several 'child' processes, all
> monitoring the same sockets with their own epolls, they all seem to get
> the same results from epoll_wait().
>
> > > Also, it shouldn't change a whit, but are you able to try on a x86 UP?
>
> On a UP x86, 2.6.0-test9, I can't reproduce the problem at all.

Could you try to poison the event buffer before an epoll_wait() to see how
many bytes are effectively written by the function?

memset(events, 'e', num * sizeof(epoll_event));




- Davide

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/