poll crashes with > 1200 fds

Dan Kegel dkegel@ixiacom.com
Fri Jun 6 21:25:00 GMT 2003


It looks like poll() is implemented on top of select() in cygwin.
This is fine unless you try to use it in a program with
more than 1024 fd's or so.  Here's the result of running a test app
that goes beyond that limit:

Program received signal SIGSEGV, Segmentation fault.
0x6106fe3a in select () from /usr/bin/cygwin1.dll
(gdb) bt
#0  0x6106fe3a in select () from /usr/bin/cygwin1.dll
#1  0x61610790 in ?? ()
#2  0x6106ca1d in select () from /usr/bin/cygwin1.dll
#3  0x6106c223 in select () from /usr/bin/cygwin1.dll
#4  0x61059e7d in poll () from /usr/bin/cygwin1.dll
#5  0x004012d3 in count_connects (ipadr=16777343, portnum=80, want=1200) at pollbug.c:120
#6  0x0040175d in main (argc=2, argv=0xa0418c8) at pollbug.c:211

And here's the test code.  To reproduce the bug, just run with argument 1500 or so.
- Dan

-------------- next part --------------
A non-text attachment was scrubbed...
Name: pollbug.c
Type: text/x-csrc
Size: 5492 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin/attachments/20030606/e5cf1e4b/attachment.bin>
-------------- next part --------------
--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


More information about the Cygwin mailing list