Skip to content
Tcl Source Code View Ticket
Login

View Ticket

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.