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

Artifact [1ebd475111]

Artifact 1ebd47511132dff043d7f65e2e4594e31862ca07:

Ticket change [1ebd475111] - Closed ticket [1036064fffffffff|1036064fff]: <i>TCL crashes if the application runs for a long time</i> plus 8 other changes by kennykb on 2004-09-28 21:08:26.
D 2004-09-28T21:08:26
J closedate 2004-09-28T14:08:26
J closer kennykb
J icomment Logged\sIn:\sYES\s\nuser_id=99768\n\nThere\sare\smultiple\ssources\sof\sconfusion\sin\sthis\sbug\sreport;\nlet\sme\stry\sto\suntangle\sa\sfew\sof\sthem,\sor\selse\sthe\nexplanation\swill\sappear\swholly\sunrelated.\n\nFirst,\sdespite\sthe\sindications\sin\sDrWatson.log,\sthe\scrash\ndid\s*not*\soccur\sin\sor\saround\sTclpStrftime.\sRather,\nTclpStrftime\swas\sthe\slast\sexported\sname\sbefore\sthe\scode\sin\nquestion.\s(This\sfact\sis\snot\ssurprising;\sit's\sthe\slast\nexported\sname\sin\sthe\sTcl\slibrary.)\n\nThe\scode\sthat\sfaulted\swas,\sin\sactuality,\sa\sbit\sof\ngenerated\scode,\sin\sanother\ssegment,\sthat\shandles\sprobing\sthe\nlarge\sactivation\srecord\sof\sTclRegExec\s(the\s'exec'\sfunction\nin\sgeneric/regexec.c).\s\sThe\sstack\sprobes\swent\sbelow\sthe\sbase\nof\sthe\sstack\ssegment\sat\s0x34000\sand\sfaulted.\s\sThis\sis\sa\nusual\sbehaviour\sof\smost\ssoftware\sconfronted\swith\sa\sstack\noverflow.\n\nTcl\scontains\slogic\sto\smake\sstack\soverflows\smore\sbenign,\sin\nthe\sfunction\sTclpCheckStackSpace\sin\sTclWin32Dll.c.\nUnfortunately,\sin\sthe\srelease\syou're\susing,\sthe\sstack\ncommitment\sthat\sTclpCheckStackSpace\simposes\sis\snot\senough\sto\nhandle\sthe\sdemands\sof\sTclRegExec\s(whose\sactivation\srecord\sis\nextremely\slarge).\s\sThis\sproblem\sis\sfixed\sin\srelease\s8.4.7;\nsee\n\s\s\s\nhttp://sourceforge.net/tracker/index.php?func=detail&aid=947070&group_id=10894&atid=110894\nand\n\s\s\s\nhttp://cvs.sourceforge.net/viewcvs.py/tcl/tcl/win/tclWinInt.h?r1=1.20.2.2&r2=1.20.2.3\nfor\sthe\sdetails.\n\nThe\sbad\snews\sis\sthat\sthis\schange\swill,\sin\sthe\slog\sthat\sI'm\nseeing,\sapparently\sjust\sconvert\sa\scrash\sto\sa\sTcl\serror;\sthe\nstack\swill\sstill\shave\soverflowed.\s\sUnlike\sthe\scase\swith\smost\nstack\soverflows,\sI'm\snot\sseeing\stremendously\sdeep\srecursive\ninvocations\sof\sTcl\scode.\s\sRather,\sI'm\sobserving\sthat\sthere's\nan\sunusually\slarge\samount\sof\sstack\sin\suse\sprior\sto\sa\scall\sto\nTcl_DoOneEvent\sin\sor\snear\sa\sprocedure\snamed\sQ_Init\s(which\sis\nnot\spart\sof\sTcl,\sso\sI\scan't\scomment\son\sit).\s\sI\ssuspect\nseveral\spossibilities\shere:\n\n(1)\sIt's\spossible\sthat\sQ_Init\s(or\ssomething\scalled\sfrom\sit)\n\s\s\s\sis\sleaking\smemory\sthat\sis\sallocated\swith\sthe\s'alloca'\n\s\s\s\slibrary\scall;\s'alloca'\sallocates\smemory\sby\sexpanding\sthe\n\s\s\s\sactivation\srecord.\s\sEventually,\sthere\sisn't\senough\sstack\n\s\s\s\sspace\sleft\sto\srun\sthe\sevent\shandler,\sand\sthe\sprocess\n\s\s\s\scrashes.\n\n(2)\sAnother\spossibility\sis\sthat\sQ_Init\scalls\sa\sdeeply\n\s\s\s\srecursive\snest\sof\sfunctions,\seach\sof\swhich\sis\scompiled\n\s\s\s\swith\sframe\spointers\somitted.\s\sSince\sthe\sDLL\sin\squestion\n\s\s\s\shas\sno\ssymbol\sinformation,\sDrWtsn32\scan't\strace\scalls\n\s\s\s\sthrough\sit.\n\n(3)\sYet\sanother\spossibility\sis\sthat\san\sevent\shandler\sin\sC\n\s\s\s\s(again,\scompiled\swith\sframe\spointers\somitted)\sis\n\s\s\s\sinvoking\sTcl_DoOneEvent\s(or\sinvoking\sTcl\scode\sthat\scalls\n\s\s\s\s[update]\sor\s[vwait])\sand\sTcl_DoOneEvent\sfinds\sanother\n\s\s\s\sevent\spending.\s\sThe\ssecond\sevent\sin\sturn\salso\sdoes\n\s\s\s\sTcl_DoOneEvent\sin\sits\sevent\shandler,\sand\sso\son.\n\s\s\s\sEventually,\sthere\sare\senough\sunfinished\sevent\shandlers\n\s\s\s\sstacked\sthat\sthe\sprocess\scrashes.\s\sIf\sthis\sis\sthe\scase,\n\s\s\s\sthe\smost\slikely\scause\sis\sthat\ssomething\sdoes\s[after\n\s\s\s\sidle]\sor\sTcl_DoWhenIdle\sfrom\san\sidle\shandler\s-\sthe\n\s\s\s\sdocumentation\sremarks\sthat\sdoing\sso\sis\snot\ssafe.\n\nSince\sthe\sstack\sexhaustion\sappears\sto\sbe\sthe\sresult\sof\nTcl_DoOneEvent\sbeing\sentered\swith\sinadequate\sstack\sspace\nremaining,\srather\sthan\sany\sinherent\sfault\sin\sthe\sTcl\slibrary\nitself,\sI'm\sclosing\sthis\sbug.\s\sIf\syou\sneed\sfurther\shelp\ntracking\sthings\sdown,\sI'd\ssuggest\svisiting\n\s\s\s\shttp://mini.net/cgi-bin/chat.cgi\nand\stalking\sto\sthe\sTcl\sdevelopers\sthere.\n
J login kennykb
J mimetype text/plain
J resolution Invalid
J status Closed
J subsystem 01.\sNotifier
J username kennykb
K 1036064fffffffffffffffffffffffffffffffff
U kennykb
Z 8bdaa61661b12c286ccd7454ebcd7181