Skip to content
Tcl Source Code Artifact [1b6352f975]
Login

Artifact [1b6352f975]

Artifact 1b6352f975c15afd2cb8fccc4cfed488d36415cd:

Ticket change [1b6352f975] - Closed ticket [1457797fffffffff|1457797fff]: <i>io.test hangs in darwin threaded 64bit build</i> plus 8 other changes by das on 2006-08-21 08:39:09.
D 2006-08-21T08:39:09
J assignee das
J closedate 2006-08-21T01:39:09
J closer das
J icomment Logged\sIn:\sYES\s\nuser_id=90580\n\nIt\sseems\sthat\sthis\sis\sdue\sto\san\sOS\sbug\sin\spthread_cond_timedwait():\swhen\s\ngiving\sit\san\sexpiry\stime\sthat\shas\salready\spassed\s(or\smaybe\sis\sonly\sa\svery\sshort\s\ntime\sin\sthe\sfuture),\sit\swaits\sforever\sinstead\sof\sreturning\simmediately\slike\sin\s\n32-bit\smode\s(and\slike\son\sother\splatforms).\nThis\scauses\sintermittent\shangs\sin\s[vwait]\swhen\susing\sthe\sunix\snotifier\swhich\sis\s\ndefault\swith\s64-bit\s(it\sdoes\snot\saffect\sthe\sCF\snotifier\sand\sI\scannot\sreproduce\sit\s\non\sthe\ssame\smachine\sin\sa\s32-bit\sbuild\swith\sthe\sunix\snotifier\si.e.\sconfigured\s-\nwithout-corefoundation).\nI\shave\snow\sworked\saround\sthe\sissue\sby\snot\spassing\svery\ssmall\stimeouts\sto\s\nTcl_ConditionWait()\sand\sdoing\sa\spoll\sinstead\sin\sthose\scases.\sThe\scurrent\s10\s\nusec\sthreshold\sin\sthe\scode\sfor\sthe\sexpiry\stime\shas\sbeen\sempirically\s\ndetermined\son\sa\sdual\sG5,\sit\sseems\sto\savoid\sall\shangs\sin\sthe\stestsuite\son\sthat\s\nmachine,\sbut\sit\swould\sbe\suseful\sif\sothers\swith\s64-bit\scapable\smachines\scould\s\ncheck\sthat\sthis\sworks\sfor\sthem\sas\swell\s(just\stry\srunning\sio.test\smany\stimes,\s\nvarying\sthe\sload\son\sthe\smachine\sseems\sto\smake\sa\sdifference\sas\swell).\sIn\s\nparticular,\sI\sdon't\sknow\sif\sthis\sproblem\seven\sexists\son\sx86_64,\sbut\sto\sbe\ssafe\s\nI've\sturned\son\sthe\sworkaround\sfor\sapple\sLP64\sin\sgeneral:\n\nIndex:\sunix/tclUnixNotfy.c\n===============================================\n====================\nRCS\sfile:\s/cvsroot/tcl/tcl/unix/tclUnixNotfy.c,v\nretrieving\srevision\s1.31\ndiff\s-u\s-p\s-r1.31\stclUnixNotfy.c\n---\sunix/tclUnixNotfy.c10\sAug\s2006\s12:15:32\s-00001.31\n+++\sunix/tclUnixNotfy.c20\sAug\s2006\s22:13:15\s-0000\n@@\s-740,7\s+740,17\s@@\sTcl_WaitForEvent(\n\s\s\s\s\sTcl_MutexLock(&notifierMutex);\n\s\n\s\s\s\s\swaitForFiles\s=\s(tsdPtr->numFdBits\s>\s0);\n-\s\s\s\sif\s(myTimePtr\s!=\sNULL\s&&\smyTimePtr->sec\s==\s0\s&&\smyTimePtr->usec\s\n==\s0)\s{\n+\s\s\s\sif\s(myTimePtr\s!=\sNULL\s&&\smyTimePtr->sec\s==\s0\s&&\s(myTimePtr->usec\s\n==\s0\n+#if\sdefined(__APPLE__)\s&&\sdefined(__LP64__)\n+\s\s\s\s/*\n+\s\s\s\s\s*\sOn\s64-bit\sDarwin,\spthread_cond_timedwait()\sappears\sto\shave\sa\sbug\n+\s\s\s\s\s*\sthat\scauses\sit\sto\swait\sforever\swhen\spassed\san\sabsolute\stime\swhich\n+\s\s\s\s\s*\shas\salready\sbeen\sexceeded\sby\sthe\ssystem\stime;\sas\sa\sworkaround,\n+\s\s\s\s\s*\swhen\sgiven\sa\svery\sbrief\stimeout,\sjust\sdo\sa\spoll.\s[Bug\s1457797]\n+\s\s\s\s\s*/\n+\s\s\s\s||\smyTimePtr->usec\s<\s10\n+#endif\n+\s\s\s\s))\s{\n\s/*\n\s\s*\sCannot\semulate\sa\spolling\sselect\swith\sa\spolling\scondition\svariable.\n\s\s*\sInstead,\spretend\sto\swait\sfor\sfiles\sand\stell\sthe\snotifier\sthread\n\n
J login das
J mimetype text/plain
J resolution Fixed
J status Closed
J username das
K 1457797fffffffffffffffffffffffffffffffff
U das
Z 1870fc6893e8931b3360d6c27f7c3dba