Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 257230a4b362d1def75fb8041019a814ad8692e1c3bd5e7c8d9456e77e458361
Ticket: 103abf181eb01366c018e047d525d0d042c8c5c5
regression since 9.0.4 brings leaks and hangs to bundled Itcl 4.3.8
User & Date: serhiy.storchaka on 2026-11-16 17:52:41
Changes

  1. icomment:
    This is not a new bug: fixing [8413e79232] in [e44f1d0e87] exposed existing problems that the old tcltest behaviour had hidden.
    
    Before, <tt>cleanupTests</tt> called <tt>exit</tt> in any interpreter where Tk was loaded. Itcl's <tt>tests/helpers.tcl</tt> runs each test file three times in a child interpreter to look for leaks. So in widgetadaptor.test and widgetclass.test the whole process exited after the first run, and three problems went unnoticed:
    <ul>
    <li>the other two runs never happened, so 118 tests were silently skipped (2255 instead of 2373);</li>
    <li>the leak check never completed: the Tk widget tests leak 17149 bytes (widgetadaptor.test) and 12880 bytes (widgetclass.test) per run in a child interpreter;</li>
    <li>helpers.tcl ends with <tt>return -code return</tt> and relied on that exit to end the process. Without it, the process waits in Tk's event loop.</li>
    </ul>
    Since [e44f1d0e87], tcltest no longer exits when a test file is sourced by another script, which is correct. All three runs complete, the leak is reported, and the process hangs.
    
    This only shows when Tk can be loaded by the test processes; without Tk the Itcl tests pass. With <tt>exit</tt> instead of <tt>return -code return</tt> at the end of the leak-test branch in helpers.tcl, all 2373 Itcl tests pass and nothing hangs. The leaks are still reported and need a separate look, in Tk or in Itcl's widget code.
    
  2. login: "serhiy.storchaka"
  3. mimetype: "text/x-fossil-wiki"