.
D 2008-05-16T23:36:03
J assignee vasiljevic
J cmimetype text/plain
J comment I\shave\swritten\sa\stclscript\sthat\suses\sthe\spackages\slisted\sbelow.\sAfter\sbetween\sa\sfew\shours\sand\sup\sto\sa\sweek\s(approximately)\sit\scrashes\swith\s"alloc:\sinvalid\sblock"\serror.\sI\scompiled\stcl\sand\spackages\swith\ssymbols,\strace\sfollows\sbelow.\n\nIn\smainthread\sI\sam\susing:\ntcl:\s8.5.2\nThread:\s2.6.5\ntls:\s1.6\nudp:\s1.0.9\n\nIn\sthreadpool\sthreads\sI\sam\susing:\ntcl:\s8.5.2\nThread:\s2.6.5\nmysqltcl:\s3.05\n\nTpoolWorker()\sis\strying\sto\sTcl_Free()\sa\s(TpoolResult\s*rPtr)\sthat\s\n(a)\swhen\scast\sas\sa\s(char\s*)\scontains\s"replacedThisPrivateInfo\s26\s360969"\n(b)\sis\sdifferent\sfrom\sthe\sclientData\sit\sreceived\n(c)\sis\snot\srecognised\sas\shaving\sbeen\sTcl_Alloc'ed\nThis\shints\sat\smem\scorruption?\n\n(gdb)\sbt\s40\n#0\s\s0xb7f70410\sin\s??\s()\n#1\s\s0xad79c19c\sin\s??\s()\n#2\s\s0x00000006\sin\s??\s()\n#3\s\s0x00003117\sin\s??\s()\n#4\s\s0xb7cfd811\sin\sraise\s()\sfrom\s/lib/tls/i686/cmov/libc.so.6\n#5\s\s0xb7cfefb9\sin\sabort\s()\sfrom\s/lib/tls/i686/cmov/libc.so.6\n#6\s\s0xb7f0d4d6\sin\sTcl_PanicVA\s(format=0xb7f60fc4\s"alloc:\sinvalid\sblock:\s%p:\s%x\s%x",\sargList=0xad79c384\s"\\033\\226í·¸ÃyY¢ò·\\bø\\212\\t")\sat\s/root/tcl8.5.2/unix/../generic/tclPanic.c:103\n#7\s\s0xb7f0d506\sin\sTcl_Panic\s(format=0xb7f60fc4\s"alloc:\sinvalid\sblock:\s%p:\s%x\s%x")\sat\s/root/tcl8.5.2/unix/../generic/tclPanic.c:132\n#8\s\s0xb7f2ab35\sin\sPtr2Block\s(ptr=0x98af808\s"replacedThisPrivateInfo\s26\s360969")\sat\s/root/tcl8.5.2/unix/../generic/tclThreadAlloc.c:735\n#9\s\s0xb7f2a259\sin\sTclpFree\s(ptr=0x98af808\s"replacedThisPrivateInfo\s26\s360969")\sat\s/root/tcl8.5.2/unix/../generic/tclThreadAlloc.c:376\n#10\s0xb7e7499d\sin\sTcl_Free\s(ptr=0x98af808\s"replacedThisPrivateInfo\s26\s360969")\sat\s/root/tcl8.5.2/unix/../generic/tclCkalloc.c:1182\n#11\s0xb736e8cb\sin\sTpoolWorker\s(clientData=0xbfb7c31c)\sat\s../generic/threadPoolCmd.c:1108\n#12\s0xb7ec13cb\sin\sNewThreadProc\s(clientData=0x8223d80)\sat\s/root/tcl8.5.2/unix/../generic/tclEvent.c:1386\n#13\s0xb7e30240\sin\sstart_thread\s()\sfrom\s/lib/tls/i686/cmov/libpthread.so.0\n#14\s0xb7da049e\sin\sclone\s()\sfrom\s/lib/tls/i686/cmov/libc.so.6\n\nThe\s"replacedThisPrivateInfo"\sis\sprivate\sinformation\sthat\sI've\sstripped\sout,\sit's\sa\s41\scharacters\slong\sword.\n\nThe\sstring\sis\sread\sfrom\sa\stls\schannel\sinside\sa\sfileevent.\sFrom\sthere\sit's\spassed\sto\sa\sproc\susing\sthis\scommand:\s\ncatch\s{$command\s$sock\s$id\s[lrange\s$data\s2\send]}\serror\n\nthe\sproc\slooks\slike\sthis:\nproc\sSIZES\s{\ssock\sid\sline\s}\s{\nif\s{\s[llength\s[split\s[join\s$line]]]\s==\s3\s}\s{\nforeach\s{\sdir\sfiles\sbytes\s}\s[split\s[join\s$line]]\s{\s}\ntpool::post\s-nowait\s$::pool\s"SIZES\s$sock\s$dir\s$files\s$bytes"\nlog\sSIZES\s$dir\s$files\s$bytes\s($::sockets($sock,user))\n}\selse\s{\nputs\s$sock\s[list\s$id\sSIZES\susage\s[list\s{SIZES\s<dir>\s<files>\s<bytes>}]]\n}\n}\n\nIn\sthe\sthreadpool\sthe\sexact\sstring\sis\snever\sfound.\n\nThe\sstring\sis\sfound\sagain\swhen\sthe\sthreadpool\sreturns\sto\sthe\smainthread,\swhere\sit\ssends\sit\sover\sa\snormal\stcl\s(non\stls)\ssocket.\n\nThe\sthreadpool\sis\sstarted\swith\sthe\sfollowing\scommand:\nset\s::pool\s[tpool::create\s-minworkers\s$min\s-maxworkers\s$max\s-initcmd\s"source\sworkers.tcl"\s-exitcmd\s{catch\s{mysql::close\s$::sql}}]\n\nWhere\sboth\s$min\sand\s$max\sis\sset\sto\s20\sso\sthread\sshould\sonly\sbe\screated\swhen\sscript\sstarts\s(had\sproblems\swith\sthreads\snot\sbeing\screated\swhen\sneeded).\n\nI'm\safraid\sthat\sI've\sbeen\sunable\sto\smake\ssmall\ssimple\sscript\sthat\shas\sthese\sresults,\sthe\sserver\salso\slasted\smuch\slonger\swhen\sit\swas\sin\stesting\sphase\swith\sjust\s10\sor\sso\sclients\son\sit,\snow\sit\shas\sabout\s120-150\sconcurrent\sclients.\n\nI\suse\stpool::wait\sin\sa\snon\sstandard\sway.\sIn\smy\sprocess\sthat\sread\sresults,\sI\swait\sfor\sfuture\sjob\sids.\sI\sissue\sthe\stpool::wait\scommand\swith\sa\slist\sof\sany\sincompleted\sjobs\s+\sfuture\sjob\sids\sup\sto\s50\sin\stotal.
J foundin obsolete:\s8.5.2
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter rudenstam
J subsystem 80.\sThread\sPackage
J title memory\scorruption\sin\sthread\spool\s?
J type Bug
K 1965721fffffffffffffffffffffffffffffffff
U rudenstam
Z 240006ca29134381027ef22d4643a04c