Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-10-13
12:07 • Closed ticket [6525391072]: TclObjTest_Init leaks when Tcltest is initialized tw... artifact: 983839ac0d user: jan.nijtmans
12:05
Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in: b6c314d9e3 user: jan.nijtmans tags: core-8-6-branch
2026-10-12
20:25
Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in: 9d37233711 user: jan.nijtmans tags: core-9-0-branch
20:24
Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in: 214777d5aa user: jan.nijtmans tags: trunk, main
15:31 • Ticket [6525391072] TclObjTest_Init leaks when Tcltest is initialized twice in a... artifact: aa85956550 user: serhiy.storchaka
15:29 • New ticket [6525391072]. artifact: 04984cf2a9 user: serhiy.storchaka
15:22
Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice in ... closed check-in: e224475cb1 user: serhiy.storchaka tags: tcltest-objtest-reinit-leak

TclObjTest_Init leaks when Tcltest is initialized twice in an interpreter

Closed / Fixed6525391072cf1e8e8fdc04084a5856adc9bfcc3cCreated 52 days agoUpdated 51 days ago
Descriptionwiki2026-10-12 15:29:18
TclObjTest_Init() leaks its array of object variables (160 bytes) when Tcltest is initialized twice in an interpreter, as it is in every testthread thread (by the post-init load {} Tcltest and again by NewTestThread()). Found with valgrind. The per-interp array was introduced by the fix for [3386721fff].

Proposed fix in branch tcltest-objtest-reinit-leak: keep the existing array.

Referenced by4
  • b6c314d9e3Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in2026-10-13 12:05:42
  • 9d37233711Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in2026-10-12 20:25:20
  • 214777d5aaFix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice check-in2026-10-12 20:24:38
  • e224475cb1Fix [6525391072]: TclObjTest_Init() leaked its variable array when Tcltest was initialized twice in an interpreter, as in every [testthread] thread (by Tcl_Init() and again by NewTestThread). Keep the existing array. check-in2026-10-12 15:22:45
serhiy.storchaka Ticket [6525391072]: 2 changes [History diff]2026-10-12 15:31:34
jan.nijtmanswiki2026-10-13 12:07:32

Fixed in [trunk], backported to core-9-0-branch and core-8-6-branch.

Since this is a change in the test only, this ticket will not be mentioned in the release notes.

Many thanks!

Log in (anonymous is fine) to add a comment.