[GHC] #4362: error in multithreaded program "epollControl: does not exist (No such file or directory)"
GHC
cvs-ghc at haskell.org
Fri Dec 3 17:33:45 CET 2010
#4362: error in multithreaded program "epollControl: does not exist (No such file
or directory)"
------------------------------------------+---------------------------------
Reporter: guest | Owner:
Type: bug | Status: new
Priority: normal | Milestone: 7.0.2
Component: libraries/base | Version: 7.1
Resolution: | Keywords:
Testcase: | Blockedby:
Difficulty: | Os: Linux
Blocking: | Architecture: x86
Failure: Incorrect result at runtime |
------------------------------------------+---------------------------------
Comment(by dleuschner):
I can't really say anything about epoll because I just looked at it today
but I noticed a thing while looking at the strace output of the program
Stefan posted. I seems that epoll discards watched file descriptors when
they are closed but the IO manager seems to think that the file descriptor
is still registered with epoll. I extracted the following sequence
concerning file descriptors with index 7:
{{{
[pid 27110] accept(12, {sa_family=AF_INET, sin_port=htons(39725),
sin_addr=inet_addr("127.0.0.1")}, [16]) = 7
[pid 27112] epoll_ctl(3, EPOLL_CTL_ADD, 7, {EPOLLIN, {u32=7,
u64=2392000568567529479}}) = 0
[pid 27112] close(7) = 0
[pid 27111] socket(PF_INET, SOCK_STREAM, IPPROTO_IP) = 7
[pid 27111] <... read resumed> "127.0.0.1\tlocalhost\n178.63.197.6"...,
4096) = 70
[pid 27111] epoll_ctl(3, EPOLL_CTL_MOD, 7, {EPOLLIN|EPOLLOUT, {u32=7,
u64=21500846801944583}}) = -1 ENOENT (No such file or directory)
}}}
In the last line the IO manager seems to assume that file descriptor 7 is
still registered with epoll because it was added in line 2 but probably
the close in line 3 invalidate or removed the file descriptor. I have
written a tiny C testprogram that demonstrates that the "socket -> N",
"epoll_ctl add N", "close N", "socket -> N", "epoll_ctl modify N" sequence
doesn't work. Maybe that bit of information is helpful. You can find the
full strace and Haskell log for the run in ~/ghc-bug/server.trace on our
system.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4362#comment:14>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
More information about the Glasgow-haskell-bugs
mailing list