<i>Crash in io-29.33b (no implicit flush of nonblocking on exit</i> status still Open with 4 other changes
by
.
D 2012-07-24T21:20:52
J icomment Okay,\ssources\sreverted,\sfull\srebuild,\sand\sfull\sretest\s(32-bit\sTcl\son\sWindows\s7\s64-bit,\sbuilt\swith\sMSVC10).\n\nI\shave\smade\s3\schanges\sto\strunk:\n(1)\sMerge\sbug-3545363\sand\sapply\smy\sdiff\s(attached\sto\sthat\sbug).\s\sTesters\son\sWin7\sor\sWinXP+IPv6\sare\snot\sgoing\sto\sbe\sable\sto\srun\sthe\sfull\sio.test\swithout\sdoing\sthis.\n(2)\sTclpCloseFile()\s_before_\sshutting\sdown\sthe\sPipeWriterThread\n(3)\sClose\sstdio\schannels\sif\sTclInExit()\sin\sTclpCloseFile().\n\nResult:\sindeterminate.\s\sio-29.33b\spasses\son\sits\sown,\sio.test\spasses\son\sits\sown,\sio-29.33b\soccasionally\sfails\swhen\sthe\sentire\stest\ssuite\sis\sexecuted.\n\nI\sdon't\shave\smore\sclarity\son\sthe\s"occasionally"\sat\sthe\smoment\s-\strying\sto\sreproduce\sthe\sproblem.\n\nCaution:\swith\sthis\schange\sPipeClose2Proc\sbecomes\snon-blocking\son\sexit,\seven\son\sa\sblocking\schannel.\s\sIf\sa\sblocking\swrite\sis\shappening\sin\sone\sinterp,\sa\sdifferent\sthread\sthat\sis\sexiting\sas\spart\sof\sthe\sTcl\sshutdown\srip\sthe\schannel\saway\sand\sclose\sit.\n\n\n---\stclWinPipe.c\n+++\stclWinPipe.c\n@@\s-820,11\s+820,11\s@@\n\s\s\s\s\s\s\s\s\s*\sDon't\sclose\sthe\sWin32\shandle\sif\sthe\shandle\sis\sa\sstandard\schannel\n\s\s\s\s\s\s\s\s\s*\sduring\sthe\sthread\sexit\sprocess.\sOtherwise,\sone\sthread\smay\skill\sthe\n\s\s\s\s\s\s\s\s\s*\sstdio\sof\sanother.\n\s\s\s\s\s\s\s\s\s*/\n\n-\s\s\s\s\s\s\sif\s(!TclInThreadExit()\n+\s\s\s\s\s\s\sif\s(TclInExit()\s||\s!TclInThreadExit()\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s||\s((GetStdHandle(STD_INPUT_HANDLE)\s!=\sfilePtr->handle)\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s&&\s(GetStdHandle(STD_OUTPUT_HANDLE)\s!=\sfilePtr->handle)\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s&&\s(GetStdHandle(STD_ERROR_HANDLE)\s!=\sfilePtr->handle)))\s{\n\s\s\s\s\s\s\s\s\s\s\s\sif\s(filePtr->handle\s!=\sNULL\s&&\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\sCloseHandle(filePtr->handle)\s==\sFALSE)\s{\n@@\s-1871,10\s+1871,15\s@@\n\s\s\s\s\s\s\s\spipePtr->validMask\s&=\s~TCL_READABLE;\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\sif\s(TclpCloseFile(pipePtr->writeFile)\s!=\s0)\s{\n+\s\s\s\s\s\s\s\s\s\s\sif\s(errorCode\s==\s0)\s{\n+\s\s\s\s\s\s\s\s\s\s\s\s\s\s\serrorCode\s=\serrno;\n+\s\s\s\s\s\s\s\s\s\s\s}\n+\s\s\s\s\s\s\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/*\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-1931,15\s+1936,10\s@@\n\s\s\s\s\s\s\s\s\s\s\s\sCloseHandle(pipePtr->writable);\n\s\s\s\s\s\s\s\s\s\s\s\sCloseHandle(pipePtr->startWriter);\n\s\s\s\s\s\s\s\s\s\s\s\sCloseHandle(pipePtr->stopWriter);\n\s\s\s\s\s\s\s\s\s\s\s\spipePtr->writeThread\s=\sNULL;\n\s\s\s\s\s\s\s\s}\n-\s\s\s\s\s\s\sif\s(TclpCloseFile(pipePtr->writeFile)\s!=\s0)\s{\n-\s\s\s\s\s\s\s\s\s\s\sif\s(errorCode\s==\s0)\s{\n-\s\s\s\s\s\s\s\s\s\s\s\s\s\s\serrorCode\s=\serrno;\n-\s\s\s\s\s\s\s\s\s\s\s}\n-\s\s\s\s\s\s\s}\n\s\s\s\s\s\s\s\spipePtr->validMask\s&=\s~TCL_WRITABLE;\n\s\s\s\s\s\s\s\spipePtr->writeFile\s=\sNULL;\n\s\s\s\s\s}\n\n\s\s\s\s\spipePtr->watchMask\s&=\spipePtr->validMask;\n\n\n
J login twylite
J mimetype text/plain
J username twylite
K 3545365fffffffffffffffffffffffffffffffff
U twylite
Z 15810a478d1f33cee685c1183cd71c58