Tcl Source Code

Artifact [aa94e38ef8]
Login

Artifact aa94e38ef8aa017895aa1a2fc2be3c19ee3f194f:

Ticket change [aa94e38ef8] - Ticket [3493120fff] Thread extension, memory leak after thread exit status still Pending with 5 other changes by sebres 2014-04-22 17:44:30.
D 2014-04-22T17:44:30.039
J comment Version:\s8.5.11\s(original\sand\scurrent\score-8-5-branch)\r\nPlatform:\sWindows\s(linux\snot\syet\stested)\r\n\r\nAfter\sexiting\sof\sthreads,\sthey\sleave\sa\smemory\sleak.\s\r\nConsequence\sof\sthat:\swe\scannot\suse\stechniques\ssuch\sas\s'idletime'\s(to\srelease\ssome\ssystem\sresources,\sfor\sexample\slarge\stcl\scodes\sare\sno\smore\sused,\setc,\setc.).\r\n\r\nAfter\srun\sof\sfollowing\sscript\sI\shave\slost\s100MB\sof\smemory.\sIn\sfact,\snothing\swill\sbe\sdone\shere,\sexcept\sthreads\sare\screated\sand\sexited.\r\n\r\nTest\sscript:\r\n\r\nputs\s[thread::names]\r\ntime\s{\r\n\s\sthread::create\s{::thread::release}\r\n}\s500\r\nputs\s[thread::names]
J icomment I\scan't\stest\sCentOS\sright\snow,\sbut\sit\swork\son\sall\smy\slinux\ssystems,\sfor\sex.:\sdebian\s/\skernel\s3.13.0-23-generic.\s\r\nI\sthink,\spossible\sin\stclUnixThrd.c\sTclpFreeAllocCache\smay\smiss\sa\ssomething\slike\s"pthread_setspecific(key,\sNULL);"\safter\scall\sof\s"TclFreeAllocCache(ptr);"\s(in\scomparison\sto\stclWinThrd.c).\sBut\s[c251d61424]\salone,\swithout\sthis,\sworks\sfine\son\smy\slinux\smashines.\s\r\n<pre>\r\nvoid\r\nTclpFreeAllocCache(\r\n\s\s\s\svoid\s*ptr)\r\n{\r\n\s\s\s\sif\s(ptr\s!=\sNULL)\s{\r\n\t/*\r\n\t\s*\sCalled\sby\sthe\spthread\slib\swhen\sa\sthread\sexits\r\n\t\s*/\r\n\r\n\tTclFreeAllocCache(ptr);\r\n\t<b\sstyle="color:red">pthread_setspecific(key,\sNULL);</b>\r\n\r\n\s\s\s\s}\selse\sif\s(initialized)\s{\r\n\t/*\r\n\t\s*\sCalled\sby\sus\sin\sTclFinalizeThreadAlloc()\sduring\sthe\slibrary\r\n\t\s*\sfinalization\sinitiated\sfrom\sTcl_Finalize()\r\n\t\s*/\r\n\r\n\tpthread_key_delete(key);\r\n\tinitialized\s=\s0;\r\n\s\s\s\s}\r\n}\r\n</pre>\r\n\r\n@Don:\scould\syou\stell\sme\splease\swhere\sexactly\syou\shave\ssegfaulting\son\scentos\s(some\stcl-tests?\sor\ssomething\selse?),\sbecause\sI\scan't\sreproduce\sit\son\smy\slinux\ssystems.
J login sebres
J mimetype text/html
J username sebres
K 3493120fffffffffffffffffffffffffffffffff
U sebres
Z 2d1c6c27bd3386d1b55d17de56f00a4f