Skip to content
Tcl Source Code Artifact [a183910f7d]
Login

Artifact [a183910f7d]

Artifact a183910f7d82a8276df808bd6f51370b3722b688:

Ticket change [a183910f7d] - Ticket [3545365fffffffff|3545365fff] <i>Crash in io-29.33b (no implicit flush of nonblocking on exit</i> status still Open with 4 other changes by twylite on 2012-07-24 22:48:04.
D 2012-07-24T22:48:04
J icomment Intermittent\sfailures\sin\sio-29.33b\sconfirmed.\s\sCause\snot\sknown.\s\sAbout\s1\sin\s5\stimes\sI\srun\sio-29.33b\son\sits\sown\sit\swill\sfail.\s\sI've\smade\sa\sio-29.33c\sthat\sreports\sthe\sactual\stime\sdelta\s(and\salways\sfails),\sand\sI\sget\sresults\slike:\s29,\s28,\s35,\s29,\s2032,\s29,\s...\n\nI've\salso\stried\sa\scompletely\sdifferent\sapproach,\swhich\sis\sto\ssignal\sthe\sPipeWriterThread\sto\sstop,\sand\sallow\sthe\sWriteFile()\sloop\sin\sthat\sthread\sto\sbe\sinterrupted\sby\sthe\ssignal.\s\sI\sstill\sget\sthe\sintermittent\sfailures\sin\sio-29.33b.\s\sChanging\sthe\sWriteFile()\sto\swrite\sat\smost\s4096\sbytes\sat\sa\stime\s(as\sin\sthe\sdiff\sbelow)\sdoesn't\shelp\s(although\sit\sdoes\sseem\sto\smake\sthe\sfailures\sless\sfrequent,\smaybe).\n\n\n---\stclWinPipe.c\n+++\stclWinPipe.c\n@@\s-1872,10\s+1872,17\s@@\n\s\s\s\s\s\s\s\spipePtr->readFile\s=\sNULL;\n\s\s\s\s\s}\n\s\s\s\s\sif\s((!flags\s||\sflags\s&\sTCL_CLOSE_WRITE)\n\s\s\s\s\s\s\s\s\s\s\s\s&&\s(pipePtr->writeFile\s!=\sNULL))\s{\n\s\s\s\s\s\s\s\sif\s(pipePtr->writeThread)\s{\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s/*\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sSet\sthe\sstop\sevent\sso\sthat\sif\sthe\swriter\sthread\sis\sblocked\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sin\sPipeWriterThread\sit\swill\sexit\scleanly.\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n+\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sSetEvent(pipePtr->stopWriter);\n+\n\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\sWait\sfor\sthe\swriter\sthread\sto\sfinish\sthe\scurrent\sbuffer,\sthen\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\sterminate\sthe\sthread\sand\sclose\sthe\shandles.\sIf\sthe\schannel\sis\n\s\s\s\s\s\s\s\s\s\s\s\s\s*\snonblocking,\sthere\sshould\sbe\sno\spending\swrite\soperations.\n\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n@@\s-1888,17\s+1895,10\s@@\n\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n\n\s\s\s\s\s\s\s\s\s\s\s\sGetExitCodeThread(pipePtr->writeThread,\s&exitCode);\n\n\s\s\s\s\s\s\s\s\s\s\s\sif\s(exitCode\s==\sSTILL_ACTIVE)\s{\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s/*\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sSet\sthe\sstop\sevent\sso\sthat\sif\sthe\sreader\sthread\sis\sblocked\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sin\sPipeReaderThread\son\sWaitForMultipleEvents,\sit\swill\sexit\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\scleanly.\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n-\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sSetEvent(pipePtr->stopWriter);\n\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sWait\sat\smost\s20\smilliseconds\sfor\sthe\sreader\sthread\sto\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*\sclose.\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s*/\n@@\s-2953,12\s+2953,12\s@@\n\n\s\s\s\s\s\s\s\s/*\n\s\s\s\s\s\s\s\s\s*\sLoop\suntil\sall\sof\sthe\sbytes\sare\swritten\sor\san\serror\soccurs.\n\s\s\s\s\s\s\s\s\s*/\n\n-\s\s\s\s\s\s\swhile\s(toWrite\s>\s0)\s{\n-\s\s\s\s\s\s\s\s\s\s\sif\s(WriteFile(handle,\sbuf,\stoWrite,\s&count,\sNULL)\s==\sFALSE)\s{\n+\s\s\s\s\s\s\swhile\s(toWrite\s>\s0\s&&\s(WAIT_OBJECT_0\s!=\sWaitForMultipleObjects(1,\swEvents,\sFALSE,\s0))\s)\s{\n+\s\s\s\s\s\s\s\s\s\s\sif\s(WriteFile(handle,\sbuf,\smin(toWrite,\s4096),\s&count,\sNULL)\s==\sFALSE)\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sinfoPtr->writeError\s=\sGetLastError();\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sdone\s=\s1;\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sbreak;\n\s\s\s\s\s\s\s\s\s\s\s\s}\selse\s{\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\stoWrite\s-=\scount;\n\n
J login twylite
J mimetype text/plain
J username twylite
K 3545365fffffffffffffffffffffffffffffffff
U twylite
Z a10c836d3da19ed09f1aa3cbfbf9a26c