Skip to content
Tcl Source Code Artifact [92fff95689]
Login

Artifact [92fff95689]

Artifact 92fff956899b8c4e52599da4dcb7159ec241c046:

Ticket change [92fff95689] - New ticket [1847064fffffffff|1847064fff] <i>Event loop goes CPU bound when select() invalid fd</i>. by dnew on 2007-12-09 00:01:39.
D 2007-12-09T00:01:39
J assignee nijtmans
J cmimetype text/plain
J comment I\shad\sa\sbug\sin\sa\sprogram\sthat\screated\soutgoing\ssockets\sand\sdidn't\sclose\sthem\swhen\sthey\sfailed.\sBasically\n\s\sset\sx\s[socket\s-async\smachine.next.door\s12345]\n\s\sputs\s$x\s$somedata\n\s\sflush\s$x\s;\s#This\sthrew,\scaught\sby\sbgerror\n\s\sclose\s$x\n\nEventually,\showever,\sI\swound\sup\swith\sa\slarge\snumber\sof\ssocket\schannels\sthat\swere\sopen\sbut\sdisconnected.\n\nNow,\shere's\sthe\sfunny\spart:\sAfter\sa\swhile,\sthe\sprocess\swould\sgo\scompute\sbound.\sUsing\sthe\slovely\sadvice\sfrom\sCLT,\sI\scould\s"strace\s-p\s$pid"\sand\ssee\swhat\sit's\sdoing.\n\nIt's\sstuck\sin\sa\stight\sloop\swith\sselect()\sthrowing\serrors\sbecause\sthe\ssocket\snumber\sis\sout\sof\srange.\s\n\nI\scan't\sseem\sto\sreproduce\sit\sin\sa\strivial\sprogram.\sThe\scode\sI\sactually\suse\sdoes\sset\sand\sunset\sthe\sblocking\sflag\sat\sdifferent\sparts\sof\sthe\sprotocol,\swhich\smay\shave\ssomething\sto\sdo\swith\sit.\n\nI\swrote\sa\slittle\sprogram\sthat\sjust\sopens\sa\snew\sasync\ssocket\severy\ssecond\swith\s[after],\sand\sit\sworked\sfine\sup\spast\s256\ssockets,\swhereas\sthe\sbig\scode\swas\sbombing\sout\safter\s32\sor\s64,\sso\sI'm\snot\ssure\swhat's\sdifferent\sthere.\sIt\smight\sbe\sa\slittle\sharder\sto\sfind\sthan\sI\sthought.\s\n\ninfo\spatchlevel\sgive\s8.4.14,\sand\sthis\sis\sSuSE\sLinux\s10.2\srunning\sthe\spenultimate\skernel\s(blah\sblah.5)\s\n\nFeel\sfree\sto\scontact\sme\sif\sI\scan\shelp\strack\sthis\sfurther.\n\n
J foundin obsolete:\s8.4.14
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter dnew
J subsystem 02.\sEvent\sLoops
J title Event\sloop\sgoes\sCPU\sbound\swhen\sselect()\sinvalid\sfd
J type Bug
K 1847064fffffffffffffffffffffffffffffffff
U dnew
Z 3cdf23cca1407628d33f9770e4351150