Skip to content
Tcl Source Code Artifact [4c30ede62f]
Login

Artifact [4c30ede62f]

Artifact 4c30ede62f921cb1664d6cfaa26ce5cfc86d545e:

Ticket change [4c30ede62f] - New ticket [218466ffffffffff|218466ffff] <i>realloc bug -- somehow related to regsub?</i>. by nobody on 2000-10-26 01:00:48.
D 2000-10-26T01:00:48
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s627\sBug\nVersion:\s8.1a2\nSubmitDate:\s'1998-05-25'\nLastModified:\s'1999-08-13'\nSeverity:\sMED\nStatus:\sReleased\nSubmitter:\shershey\nChangedBy:\shobbs\nOS:\sAll\nOSVersion:\sNA\nMachine:\sNA\nFixedDate:\s'1999-08-13'\nFixedInVersion:\s8.2b3\nClosedDate:\s'2000-10-25'\n\n\nI\stoo\shave\sencountered\sthis\sproblem.\s\sI\shave\sa\s2,500\stcl/tk\sprog\nwhich\sgets\san\sexception\swith\sthe\snew\sregsub.\s\sIf\sI\sremove\sthe\ncall\sit\sworks\s(I'm\sactually\srunning\sit\sin\sproduction\swith\sversion\s8.0).\nI\sposted\sa\ssimilar\swarning\sto\sthe\sabove\sa\scouple\sof\smonths\sago\nto\sc.l.t.\n\nJust\sthought\sI'd\slet\syou\sknow\sI\sthink\sthe\sproblem\sis\sreal.\s\sWhen\sI\nhave\sthe\stime\sI'll\stry\sand\sget\sa\ssimple\sexample.\s\sI\sdid\stry\sto\nat\sfirst\sbut\sfailed.\n\nPS\sI\sthink\sthe\snew\sregexp\sstuff\sshould\shave\sbeen\smade\sa\s"package".\n--------\nTcl\s8.1a2\sis\sblowing\sup\swith\sthe\smessage\s"unable\sto\srealloc\sxxx\sbytes"\nwhen\sI\srun\smy\sprogram.\s\sMy\scode\sbasically\sreads\sHTML\sfiles\sand\sparses\sthem.\nIt\sreads\sthe\sentire\sfile\sinto\sa\svariable,\sthen\sparses\sthe\sdata\sfrom\sthat.\nThe\sproblem\socurrs\sfor\slarge\sfiles,\se.g.\sa\sfile\s"myfile"\sthat\sis\n971\slines,\s15383\scharacters\sgives\sthe\serror.\s\sSmall\sfiles\swork\sfine.\n\nBelow\sis\sthe\ssmallest\scode\sfragment\sthat\sreproduces\sthe\sproblem\n(you\sneed\sto\ssupply\san\sinput\sfile\s"mtfile"\sof\ssufficient\ssize).\nI'm\susing\s"wish81",\snot\stclsh81.\s\s"wish80"\sfrom\sthe\s8.0\sTcl\srelease\sworks\sfine.\n\nHopefully\ssomeone\swill\suse\sthis\sto\sverify\sthat\sthe\snext\srelease\scorrects\nthe\sproblem.\s\sIn\sthe\smeantime,\sdoes\sanyone\sknow\swhether\sthere\sis\scurrently\na\spatch\sthat\swill\sfix\sthis?\n\nThanks\s...\n\n--\[email protected]\n\n#\sSTART\sOF\sTCL\sCODE\nproc\sgetdata\s{file}\s{\n\s\s\s\s\s\s\s\sset\sfd\s[open\s$file]\n\s\s\s\s\s\s\s\sset\srs\s[read\s$fd]\n\s\s\s\s\s\s\s\sclose\s$fd\n\s\s\s\s\s\s\s\sreturn\s$rs\n}\n\nproc\sparse\s{html\s{cmd\sxtk_HMtest_parse}\s{start\shmstart}}\s{\n\s\s\s\s\s\s\s\sregsub\s-all\s\\{\s$html\s{\\&ob;}\shtml\n\s\s\s\s\s\s\s\sregsub\s-all\s\\}\s$html\s{\\&cb;}\shtml\n\s\s\s\s\s\s\s\sset\sw\s"\s\\t\\r\\n"\s;#\swhite\sspace\n\s\s\s\s\s\s\s\sproc\sxtk_HMcl\sx\s{return\s"\\[$x\\]"}\n\s\s\s\s\s\s\s\sset\sexp\s<(/?)([xtk_HMcl\s^$w>]+)[xtk_HMcl\s$w]*([xtk_HMcl\s^>]*)>\n\s\s\s\s\s\s\s\sset\ssub\s"\\}\\n$cmd\s{\\\\2}\s{\\\\1}\s{\\\\3}\s\\{"\n\s\s\s\s\s\s\s\sregsub\s-all\s$exp\s$html\s$sub\shtml\n\s\s\s\s\s\s\s\seval\s"$cmd\s{$start}\s{}\s{}\s\\{\s$html\s\\}"\n\s\s\s\s\s\s\s\seval\s"$cmd\s{$start}\s/\s{}\s{}"\n}\n\nproc\sxtk_HMtest_parse\s{command\stag\sslash\stext_after_tag}\s{\n\s\s\s\sputs\s-nonewline\s"."\n\s\s\s\s#puts\s"==>\s$command\s$tag\s$slash\s$text_after_tag"\n}\n\nproc\sdoit\s{file}\s{\n\s\s\s\s\s\s\s\sset\sdata\s[getdata\s$file]\n\s\s\s\s\s\s\s\sputs\s"size=[string\slength\s$data]"\n\s\s\s\s\s\s\s\sparse\s"$data"\n}\n\ndoit\smyfile\n\n----------\n\nMore\sinfo:\nFirst,\sI\sforgot\sto\smention\sthat\sI'm\srunning\sTcl\s8.1a2\son\sWindow\sNT\s4.0.\nSecond,\sI've\sdiscovered\sthat\sthis\sprogram\sonly\sfails\swhen\sthe\sinput\sfile\ncontains\sparticular\sdata.\s\sIn\sother\swords,\syou\scan't\sreproduce\sthe\sproblem\nwith\sany\saritrary\slarge\sfile\s...\smy\sfile\scontains\sHTML,\sand\ssome\sof\sthe\n"regsub"\scommands\sprocess\sit.\s\sSo\sthe\s"regsub"\scommand\smust\sbe\sinvolved\sin\nthe\sproblem\ssomehow.\nIf\ssomeone\swants\sit,\sI'll\sgladly\sprovide\smy\sdata\sfile\swhich\sis\sneeded\sto\nreproduce\sthe\sproblem\s(but\sis\sanyone\sreally\sfixing\sbugs\snow?)\n\n--\[email protected]\n\nSome\sworst\scase\sregexp\sbugs\swere\sfixed\sin\sthe\s8.2b3\srelease.\s\n--\s08/13/1999\shobbs
J foundin obsolete:\s8.1a2
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 69.\sOther
J title realloc\sbug\s--\ssomehow\srelated\sto\sregsub?
J type Bug
K 218466ffffffffffffffffffffffffffffffffff
U nobody
Z d5150fdf2598f112e5621ccaa026b90e