Tcl Source Code

Artifact [9e53786782]
Login

Artifact 9e53786782b3da4bc11166c0c190672f935cb9cf:

Ticket change [9e53786782] - Ticket [c31f72813b] Tcl crashes when calculating the string representation of deep nested lists status still Open with 6 other changes by JKU 2013-11-08 19:21:06.
D 2013-11-08T19:21:06.112
J assignee dkf
J comment Tcl\scrashes\swith\sa\sSEGFAULT\swhen\scalculating\sthe\sstring\srepresentation\sof\sa\sdeeply\snested\slist.\r\n\r\nCode\sto\sreproduce:\r\n<code><verbatim>set\sa\sa\r\nfor\s{set\si\s0}\s{$i\s<\s100000}\s{incr\si}\s{\r\n\s\s\s\sset\sa\s[list\s$a]\r\n}\r\nputs\s$a</verbatim></code>\r\n\r\nIf\sit\sdoes\snot\scrash,\suse\sa\shigher\snumber.
J icomment Relevant\sTcler\sChat:\r\n\r\n<verbatim><Johannes13>\sset\sa\sa;\sfor\s{set\si\s0}\s{$i\s<\s10000}\s{incr\si}\s{set\sa\s[list\s$a]};\sset\sa\r\n<suchenwi>\sShould\sbe\sidempotent,\son\s1-word\slists\swithout\sspaces:\r\n<suchenwi>\s(Videos)\s1\s%\sset\sa\sa\r\n<suchenwi>\sa\r\n<suchenwi>\s(Videos)\s2\s%\sset\sa\s[list\s$a]\r\n<suchenwi>\sa\r\n<suchenwi>\s(Videos)\s3\s%\sset\sa\s[list\s$a]\r\n<suchenwi>\sa\r\n<Johannes13>\ssuchenwi:\son\smy\smachine\sTcl\scrashes.\r\n<suchenwi>\sjohannes13:\slet\sme\stry\shere...\r\n<suchenwi>\ssuchenwi@suchenwi-NC10:~$\stclsh\r\n<suchenwi>\s%\sset\sa\sa;for\s{set\si\s0}\s{$i<10000}\s{incr\si}\s{set\sa\s[list\s$a]};\sset\sa\r\n<suchenwi>\sa\r\n<suchenwi>\s%\sinfo\spatch\r\n<suchenwi>\s8.5.13\r\n<Johannes13>\sincrease\sthe\sinterations..\r\n<suchenwi>\sjohannes13:\sworks\shere\sas\sexpected,\sLubuntu\s13.04\r\n<suchenwi>\sjohannes13:\swith\s1000000\sit\scrashes\sindeed.\r\n<suchenwi>\srlwrap:\swarning:\stclsh\skilled\sby\sSIGSEGV\s(core\sdumped).\r\n<suchenwi>\srlwrap\shas\snot\scrashed,\sbut\sfor\stransparency,\r\n<suchenwi>\sit\swill\snow\skill\sitself\swith\sthe\ssame\ssignal\r\n<suchenwi>\sSpeicherzugriffsfehler\s(Speicherabzug\sgeschrieben)\r\n<Johannes13>\sit\scrashes\swhen\scalculating\sthe\sstring\srepresentation\sof\sa\slist\sof\sa\slist\sof\sa\slist...\r\n<jima>\sa\sreally\sgood\scompiled\swould\shave\sguessed\sthe\sanswer\swithout\siterating?\r\n<Zarutian>\srereads\swhat\sJohannes13\sand\ssuchenwi\ssaids\r\n<Zarutian>\s-s\r\n<jima>\ss/compiled/compiler\r\n<thommey>\syes,\sit\sdoes\screate\sa\snested\slist\sstructure\r\n<Zarutian>\sJohannes13:\sgot\sa\score\sdump\sfrom\sthe\scrash?\r\n<Johannes13>\sno,\swindows..\r\n<Zarutian>\soh,\sright\r\n<thommey>\s{\sset\sa\s[list\s$a];\sset\sa\s[string\srange\s$a\s0\send]\s}\sworks\s;)\r\n*\sZarutian\stries\sto\srecall\swhat\sthat\ssystem\sevent\sviewer\sis\scalled\sin\swindows\r\n<suchenwi>\sThe\scrash\shappens\sbetween\s40000\sand\s43000\siterations.\r\n<thommey>\sstack\sexplosion\sprobably,\sthe\sbacktrace\sis\sthousands\sof\siterations\sof\sTcl_GetStringFromObj\s->\sTcl_GetString\s->\sUpdateStringOfList\s->\sTcl_GetStringFromObj\r\n<suchenwi>\sBut\sit's\snot\sdescending\sin\srecursion,\sit\siterates\sflatly...\r\n*\sjon8\shat\sdie\sVerbindung\sgetrennt\s(Remote\shost\sclosed\sthe\sconnection)\r\n<thommey>\sthe\sC\sfunction\scalls\srecurse\r\n<suchenwi>\sah\r\n<thommey>\sthe\s"set\sa"\striggers\sit,\sgenerating\sthe\sstring\srep,\sit\sdoesn't\shave\sany\sissues\sbuilding\sthe\snested\slist\r\n<evilotto>\sthat\scrash\sis\ssurprising\sto\sme\sat\sleast...\r\n<Johannes13>\sexactly.\r\n<thommey>\s(until\sa\scertain\shigher\snesting\slimit\sI\sassume)\r\n<miguel>\sthommey:\sreminds\sof\sa\ssimilar\sproblem\swe\shad\son\sfreeing\ssuch\slists\s(discovered\sby\ssalvatore\siirc)\s-\sdkf\sfixed\sthat\r\n<ijchain>\s<miguel>\sdo\sfile\sa\sbug,\sassign\sit\sto\sdkf\r\n<giftpflanze>\sgawd,\si'm\sso\sstupid\r\n<laomaiweng>\s\sAlso\scrashes\swith\s100000\son\s8.6.1.\r\n<thommey>\s->\sJohannes13\s:P</verbatim>\r\n\r\nSo\sI\sassigned\sit\sto\sdkf...
J login JKU
J mimetype text/x-fossil-wiki
J username JKU
K c31f72813b3966d13deb165f957033d514acd99f
U JKU
Z f24066177d41a005a52c9014b4f19619