Skip to content
Tcl Source Code Artifact [34f3c94807]
Login

Artifact [34f3c94807]

Artifact 34f3c948074d6cd5ec2361eb2b8e7c245a6a5806:

Ticket change [34f3c94807] - Ticket [3392070fffffffff|3392070fff] <i>literal leak in regexpComp/subst combination</i> status still Open with 4 other changes by dgp on 2011-08-16 02:39:24.
D 2011-08-16T02:39:24
J icomment \nReduced\sleak\sdemonstration...\n\n$\scat\sa.tcl\nsource\sb.tcl\n\n$\scat\sb.tcl\nproc\sfoo\s{}\s{\n\s\s\s\sregexp\s.\sx\sj\n\s\s\s\sreturn\s$j\n}\nfoo\nsubst\s\\j\n\n$\svalgrind\s./tcltest\sa.tcl\n...\n==6105==\s292\s(48\sdirect,\s244\sindirect)\sbytes\sin\s1\sblocks\sare\sdefinitely\slost\sin\sloss\srecord\s23\sof\s24\n==6105==\s\s\s\sat\s0x4A05E1C:\smalloc\s(vg_replace_malloc.c:195)\n==6105==\s\s\s\sby\s0x498654:\sTcl_Alloc\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4FB2CA:\sTclCreateLiteral\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4FB501:\sTclRegisterLiteral\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4CF24A:\sTclCompileTokens\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4CE6A6:\sTclCompileScript\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4D0A6B:\sTclSetByteCodeFromAny\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4D0BB6:\sSetByteCodeFromAny\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x4E5065:\sTclCompileObj\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n==6105==\s\s\s\sby\s0x494338:\sTclNREvalObjEx\s(in\s/local/tmp/dgp/fossil/tcl-only/unix/tcltest)\n\n\nDebugging\sprints\sshow\sthe\sliteral\s"j"\sis\snot\sreleased\sby\nTclDeleteLiteralTable()\sdue\sto\sa\ssurplus\srefcount.\n
J login dgp
J mimetype text/plain
J username dgp
K 3392070fffffffffffffffffffffffffffffffff
U dgp
Z 1b986f3d17402e0c49bede8e3285d553