Tk Source Code

View Ticket
Login
Ticket UUID: 881d3f651403d1ea00d1e6a30aca601b0b997de5
Title: Test config-2.1 fails with "-singleproc 0"
Type: Bug Version: trunk, 9.1a0
Submitter: erikleunissen Created on: 2025-08-12 11:00:49
Subsystem: 86. Test Tools Assigned To: jan.nijtmans
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2026-10-05 07:33:03
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2026-10-04 21:12:42
Description:
Notes up front
--------------
* Observed with Linux and Windows:
* Currently, the test script all.tcl prevents "-singleproc 0". Therefore,
  to reproduce you need to change in all.tcl:

    tcltest::configure -singleproc 1

to

    tcltest::configure -singleproc 0


Test output
-----------

==== config-2.1 Tk_DeleteOptionTable - reference counts FAILED
==== Contents of test case:

    set x {}
    testobjconfig chain1 .a
    testobjconfig chain2 .b
    testobjconfig chain3 .c
    deleteWindows
    testobjconfig delete chain3
    lappend x [testobjconfig info chain2] [testobjconfig info chain1]
    testobjconfig delete chain2
    lappend x [testobjconfig info chain2] [testobjconfig info chain1]

---- Result was:
{2 4 -three 2 2 -one} {2 2 -one} {} {2 2 -one}
---- Result should have been (exact matching):
{3 4 -three 2 2 -one} {2 2 -one} {} {2 2 -one}
==== config-2.1 FAILED
User Comments: serhiy.storchaka added on 2026-10-05 07:33:03:

Backported to 8.6 in [52ef0a205f].


jan.nijtmans added on 2026-10-04 21:12:42:

Fixed in [f125036340d0c941|trunk] and in core-9-0-branch

Many thanks!


serhiy.storchaka added on 2026-09-18 12:31:26:

The reference counts also include the option objects with cached lookups (optionObjType in tkConfig.c), and the literals of the previous test bodies survive as long as their bytecode does, so the counts depend on which tests ran before in the same process and on the Tcl version. Fixed on branch config-test-refcounts in [d2ab551ed8]: the test now compares the counts before and after the deletion.


erikleunissen added on 2025-10-29 14:53:48:
And also note that (on Linux) if the option "-match config-2.1" is passed,
the test fails regardless whether "-singleproc 0" is used.

erikleunissen added on 2025-10-29 14:50:59:
Since commit [c2d3890e3c] on 17-okt-2025, the option -singleproc 0 can be simply
passed on the command line. So, the recommended invocation (on unices) is:

    TESTFLAGS="-file config.test -match config-2.1 -singleproc 0"
    
Also, note that the test fails differently (observed on Linux), depending on
whether the option "-match config-2.1" is passed. Without as reported previously,
with that option the test result is:

==== config-2.1 Tk_DeleteOptionTable - reference counts FAILED
==== Contents of test case:

    set x {}
    testobjconfig chain1 .a
    testobjconfig chain2 .b
    testobjconfig chain3 .c
    deleteWindows
    testobjconfig delete chain3
    lappend x [testobjconfig info chain2] [testobjconfig info chain1]
    testobjconfig delete chain2
    lappend x [testobjconfig info chain2] [testobjconfig info chain1]

---- Result was:
{1 4 -three 2 2 -one} {2 2 -one} {} {1 2 -one}
---- Result should have been (exact matching):
{3 4 -three 2 2 -one} {2 2 -one} {} {2 2 -one}
==== config-2.1 FAILED