<i>tcl crash on channel thread transfer and fileevent writable in place</i> status still Pending with 3 other changes
by
.
D 2018-06-08T20:35:44.941
J icomment Too\scomplex\sto\sport\smy\stcl-thread-module\sback\s(too\smany\sdependencies\sto\sresolve)...\r\n\r\nBut\sjust\stried\sto\sprotect\sthe\srefCount\sof\schannel\swith\satomic\soperations\sand\sit\ssolves\sthe\scrashes\sfor\swindows\s(8.5/8.6),\sbut\son\sunix\sit\srefuses\sfor\ssome\sreasons\sfor\s8.6\s(but\swork\sin\s8.5).\r\n\r\nSo\stried\sto\sadd\sassert\swithin\sTclChannelEventScriptInvoker\sto\scheck\r\nTcl_GetCurrentThread()\s==\sTcl_GetChannelThread(chanPtr),\sand\sit\sfails,\sas\sexpected,\swith:\r\n<pre><code>\r\n\s\s\s\s[8F63700]/[AC79700]\sinvoke\s[0x55cd0c822df0]:\shandle\sfile5\r\n</code></pre>\r\nfor\s\r\n<pre><code>\r\n\s\s\s\sif\s(Tcl_GetCurrentThread()\s!=\sTcl_GetChannelThread(chanPtr))\s{\r\n\tfprintf(stderr,"\s[%X]/[%X]\sinvoke\s[%p]:\s%s\\n",\s\r\n\t\t(int)Tcl_GetCurrentThread(),\r\n\t\t(int)Tcl_GetChannelThread(chanPtr),\schanPtr,\r\n\t\tTcl_GetString(esPtr->scriptPtr));\r\n\s\s\s\s}\r\n</code></pre>\r\nSo\sindeed\sit\shangs\sstill\ssomewhere\sin\snotifier/event-handler\sduring\sthe\stransfer-process\s(but\sthread-module\swait\sfor\stransmit-confirmation\sfrom\sother\sthread!).\r\n\r\nStill\sworse\sis,\sthat\sif\sI\sreplace\sthe\stransfer\swith\sattach/detach\spair\slike\sbelow,\sit\schanges\snothing\sat\sall:\r\n<pre><code>\r\n\s\s\s\sif\s0\s{\r\n\tthread::transfer\s$other\s$chan\r\n\s\s\s\s}\selse\s{\r\n\tthread::detach\s$chan\r\n\tthread::send\s$other\s[list\sthread::attach\s$chan]\r\n\s\s\s\s}\r\n</code></pre>\r\n\r\nThis\simplies\sthe\s"detach"\sdoes\snot\swork\sproperly\s(I\smean\safter\sdetach\sTclChannelEventScriptInvoker\swill\sbe\scalled\sagain\sinside\sthe\sOLD\sthread).\r\n\r\nStrange\sis\salso,\sthat\sit's\sabsolutely\snot\sreproducible\swith\smy\sown\sthread-module\s(but\sstill\sthe\ssame\stcl-version)...
J login sebres
J mimetype text/x-fossil-wiki
K 815e2468064b4324bc4b303b9bafd3ef92803c32
U sebres
Z d5164a79687eb1e504f7d49bf68aae19