Skip to content
Tcl Source Code Artifact [722ca69b51]
Login

Artifact [722ca69b51]

Artifact 722ca69b51ec961f8ba1f6d71f3d32ebc0bc1ae3:

Ticket change [722ca69b51] - New ticket [30c5d37cfa0028c9|30c5d37cfa] <i>Expect eof occurring before end of output from spawned process</i>. by tld on 2013-08-02 19:39:53.
D 2013-08-02T19:39:53.408
J assignee nobody
J closer nobody
J cmimetype text/plain
J comment I've\snever\slogged\sa\sticket\shere.\s\sApologies\sif\sI\sget\ssomething\swrong.\r\n\r\nWe\sinitially\snoticed\sthis\sbehavior\sin\sexpect\sscripts\sthat\swere\sgetting\sdata\sfrom\scommands\srun\son\sremote\ssystems\svia\sssh,\sbut\sI've\sbeen\sable\sto\sduplicate\sthe\sbehavior\sin\svery\ssimple\sexpect\sscripts\sthat\ssimply\sspawn\sa\sprocess\sthat\suses\scat\sto\soutput\sa\sfile.\r\n\r\nThe\sbehavior\sis\ssomewhat\sunpredictable\sbut\smy\stests\sreproduce\sit\smuch\smore\soften\sthen\snot.\s\sWhat\shappens\sis\sthat\swithin\san\sexpect\sblock,\sonly\sin\scases\swhere\sthe\sexpect\sblock\sdoes\spattern\smatching\sof\sany\skind,\san\seof\scan\soccur\sbefore\sall\sthe\sdata\sis\soutput\sby\sthe\sspawned\scommand,\sthus\struncating\sthe\soutput.\r\n\r\nI\scannot\sreproduce\sthis\son\san\solder\sCentOS\s5\ssystem\srunning\stcl-8.4.13\s(and\sexpect-5.43.0-8).\s\sI\scan\showever\sreproduce\sit\son\sany\ssystem\sI've\stried\susing\stcl\s8.5,\sincluding\sCentOS\s6\s(tcl-8.5.7-6.el6.x86_64,\sexpect-5.44.1.15-4.el6.x86_64)\sand\son\san\sx86\sGentoo\ssystem\s(dev-lang/tcl-8.5.13-r1\sand\sdev-tcltk/expect-5.44.1.15).\r\n\r\nAs\smentioned\sabove,\sthis\sonly\soccurs\sif\sthe\sexpect\sblock\shas\spatterns\sin\saddition\sto\sthe\seof.\s\sI've\spasted\sa\stest\sscript\sbelow\sthat\sspawns\s"cat\s./in.txt".\s\sI've\sbeen\stesting\swith\sthat\susing:\r\n\r\nexpect\stest.expect\s>\sout.txt\r\n\r\n...and\sthen...\r\n\r\ndiff\s-w\sin.txt\sout.txt\r\n\r\n...which\swill\sshow\sthat\sthe\soutput\swas\struncated.\s\sI\scan\sreproduce\sthis\son\sfiles\sas\ssmall\sas\s1000\slines\sand\saround\s40-50k,\swith\sno\stext\sthat\swould\smatch\sany\sof\sthe\spatters,\sand\sit\sappears\sthat\sit's\smore\slikely\sto\soccur\sif\smatch_max\sis\sreduced.\r\n\r\nHere\sis\sthe\stest\sscript.\s\sNote\sthat\ssome\sthe\soriginal\spatterns\shave\sbeen\sleft\sin,\sbut\sdon't\sactually\sneed\sto\smatch\sany\stext:\r\n\r\nset\stimeout\s30\r\n\r\nproc\sexitspawnstat\sargs\s{\r\n\s\s\scatch\swait\sresult\r\n\s\s\sset\srtn\s[lindex\s$result\s2]\r\n\s\s\sif\s{\s!$rtn\s}\s{\r\n\s\s\s\s\s\sset\srtn\s[lindex\s$result\s3]\r\n\s\s\s}\r\n\s\s\sexit\s$rtn\r\n}\r\n\r\nlog_user\s1\r\nspawn\s-noecho\scat\s./in.txt\r\nexpect\s{\r\n\s\s\seof\s{\r\n\s\s\s\s\s\sexitspawnstat\r\n\s\s\s}\r\n\s\s\stimeout\s{\r\n\s\s\s\s\s\slog_user\s1\r\n\s\s\s\s\s\ssend_user\s"Timeout.\\n"\r\n\s\s\s\s\s\sexit\s253\r\n\s\s\s}\r\n\s\s\s-nocase\s-re\s"password:"\s{\s\r\n\s\s\s\s\s\sexp_continue\r\n\s\s\s}\r\n\s\s\s"(yes/no)?\s"\s{\s\r\n\s\s\s\s\s\sexp_continue\r\n\s\s\s}\r\n\s\s\s-nocase\s-re\s"Enter\spassphrase"\s{\r\n\s\s\s\s\s\sexp_continue\r\n\s\s\s}\r\n\s\s\s"arx-sudo-pwd:"\s{\r\n\s\s\s\s\s\sexp_continue\r\n\s\s\s}\r\n}
J foundin tcl-8.5.7
J is_private 0
J login tld
J priority 5\sMedium
J private_contact 1b4acbf8a1b26ad481e69c77816a02d377bac5a2
J resolution None
J severity Severe
J status Open
J submitter tld
J subsystem 16.\sCommands\sA-H
J title Expect\seof\soccurring\sbefore\send\sof\soutput\sfrom\sspawned\sprocess
J type Bug
K 30c5d37cfa0028c9ef83fa9efc490f4bc28b64ff
U tld
Z 60d7ab79d344a63816a7ab4057ea495b