Artifact
ae6cd57e67131fd64a418da5db3d655d8d402e1d:
Ticket change
[ae6cd57e67]
- New ticket
[1958930fffffffff|1958930fff] <i>exec with pipes and fileevents leaks ~2Mb everytime</i>.
by
mgammon on
2008-05-06 17:45:08.
D 2008-05-06T17:45:08
J assignee andreas_kupries
J cmimetype text/plain
J comment I'm\srunning\sTcl8.3.5\son\sWindows\sXP/SP2\s&\sVC8.\n\nI\sthink\sI've\sseen\sthis\sreported\sas\sa\sbug\sbefore,\smany\syears\sback,\sbut\slooking\sat\sthe\slatest\s8.5.2\stclWinPipe.c\scode\sit\slooks\slike\sits\sstill\sthere.\n\nI\sneed\sto\sspawn\sthe\ssame\schild\sprocess\s100s\sof\stimes.\nAfter\seach\schild\sprocess\sdies\sa\sfew\sseconds\spass\sand\sthen\sit\sis\sspawned\sagain.\sWhen\sI\sdo\sthis\sI\ssee\sthe\sVirtual\sSize\sof\sthe\stcl\sinterpreter\sprocess\sslowly\sgrowing\seach\stime\sby\sabout\s8Mb.\sWith\sthe\s2Gb\slimit\sfor\s32bit\sexecs\sthis\sallows\sme\sto\smake\sabout\s250\slaunches\sbefore\severything\sstops.\n\nI've\scut\sit\sdown\sto\sa\ssimple\stcl\sscript\sthat\sdemonstrates\sa\s2Mb\sleak\seach\stime.\sIt\swould\sbe\s4Mb\sif\sI\sattach\sa\spipe\sto\sthe\sstderr\schannel\stoo.\n\n...................................................\nproc\scallback\s{chan\sfid}\s{\n\s\s\sread\s$fid\n}\n\npipe\sin_r\s\sin_w\npipe\sout_r\sout_w\n\nfconfigure\s$out_r\s-blocking\s0\s-buffering\snone\n\nset\spid\s[exec\sls\s<@$in_r\s>@$out_w\s&]\n\nfileevent\s$out_r\sreadable\s"callback\sstdout\s$out_r"\n\n#\swait\sfor\s"ls"\sto\sdie\nsleep\s1\n#\sMUST\sforce\sthe\sevent\sloop\sto\sbe\sprocessed\nupdate\n\nclose\s$in_r\nclose\s$in_w\nclose\s$out_r\nclose\s$out_w\n...................................................\n\nrun\sthe\sabove\sscript\srepeatedly\sin\sthe\ssame\sinterpreter\ssession\sand\swatch\sthe\sVirtual\sSize\sgrow\sin\sProcessExplorer.\n\nI've\sdug\sdown\sinto\sthe\scode\sin\stclWinPipe.c\sand\sI'm\spretty\ssure\sits\shappening\sbecause\sof\sthe\sTerminateThread\scalls\sused\sto\skill\sthe\spipe\sread\sthread.\s\n\nIt\shas\sto\sresort\sto\sa\sTerminateThread\sbecause\sthe\sReadFile\scall\sin\sthe\sread\sthread\sis\sblocked.\sWhat\sI\sdon't\squite\sunderstand\sis\swhy\sit\sstays\sblocked\seven\safter\sthe\schild\sprocess\sit\sis\sreading\sfrom\sis\slong\sdead.\n\nI've\sseen\ssuggestions\selsewhere\sthat\sto\sget\sround\sthe\sblocking\sproblem\sof\sReadFile\sit\sshould\sbe\sused\sin\sasynchronous\smode.\n\nThis\sbug\sis\sreally\scrippling\smy\sapp.\sI'd\sreally\slike\sto\ssee\sa\sfix\sfor\sit\ssoon.\n\n\n\n\n
J foundin final:\s8.3.5
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter mgammon
J subsystem 24.\sChannel\sCommands
J title exec\swith\spipes\sand\sfileevents\sleaks\s~2Mb\severytime
J type Bug
K 1958930fffffffffffffffffffffffffffffffff
U mgammon
Z c062b2150006634db19b4c16f9d7ba25