Skip to content
Tcl Source Code View Ticket
Login

View Ticket

test suite regression in Tcl 9.0.2

Closed / Fixedda5e1bc7bcc1951b6133a07f6b8e5430c3ff9e0dCreated 1 year agoUpdated 1 year ago
Descriptionplain2025-06-16 19:37:25
$ make test-tcl TESTFLAGS='-singleproc 1 -file "exec.test process.test"'
...
exec.test
process.test


==== process-3.1 empty subprocess list FAILED
==== Contents of test case:

    llength [tcl::process list]

---- Result was:
1
---- Result should have been (exact matching):
0
==== process-3.1 FAILED



==== process-3.2 empty subprocess status FAILED
==== Contents of test case:

    dict size [tcl::process status]

---- Result was:
1
---- Result should have been (exact matching):
0
==== process-3.2 FAILED



==== process-4.1 exec one child FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set pid [exec [interpreter] $path(exit) 0 &]
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status [lindex [tcl::process status $pid] 1]
    expr {
	   [llength $list] eq 1
	&& [lindex $list 0] eq $pid
	&& [dict size $statuses] eq 1
	&& [dict get $statuses $pid] eq $status
	&& $status eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-4.1 FAILED



==== process-4.2 exec two children in parallel FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set pid1 [exec [interpreter] $path(exit) 0 &]
    set pid2 [exec [interpreter] $path(exit) 0 &]
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status1 [lindex [tcl::process status $pid1] 1]
    set status2 [lindex [tcl::process status $pid2] 1]
    expr {
	   [llength $list] eq 2
	&& [lsearch $list $pid1] >= 0
	&& [lsearch $list $pid2] >= 0
	&& [dict size $statuses] eq 2
	&& [dict get $statuses $pid1] eq $status1
	&& [dict get $statuses $pid2] eq $status2
	&& $status1 eq 0
	&& $status2 eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-4.2 FAILED



==== process-4.3 exec 3-stage pipe FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set pids [exec  [interpreter] $path(exit) 0  | [interpreter] $path(exit) 0  | [interpreter] $path(exit) 0  &]
    lassign $pids pid1 pid2 pid3
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status1 [lindex [tcl::process status $pid1] 1]
    set status2 [lindex [tcl::process status $pid2] 1]
    set status3 [lindex [tcl::process status $pid3] 1]
    expr {
	   [llength $pids] eq 3
	&& [llength $list] eq 3
	&& [lsearch $list $pid1] >= 0
	&& [lsearch $list $pid2] >= 0
	&& [lsearch $list $pid3] >= 0
	&& [dict size $statuses] eq 3
	&& [dict get $statuses $pid1] eq $status1
	&& [dict get $statuses $pid2] eq $status2
	&& [dict get $statuses $pid3] eq $status3
	&& $status1 eq 0
	&& $status2 eq 0
	&& $status3 eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-4.3 FAILED



==== process-5.1 exec one child FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set f [open "|\"[interpreter]\" \"$path(exit)\" 0"]
    set pid [pid $f]
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status [lindex [tcl::process status $pid] 1]
    expr {
	   [llength $list] eq 1
	&& [lindex $list 0] eq $pid
	&& [dict size $statuses] eq 1
	&& [dict get $statuses $pid] eq $status
	&& $status eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-5.1 FAILED



==== process-5.2 exec two children in parallel FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set f1 [open "|\"[interpreter]\" \"$path(exit)\" 0"]
    set f2 [open "|\"[interpreter]\" \"$path(exit)\" 0"]
    set pid1 [pid $f1]
    set pid2 [pid $f2]
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status1 [lindex [tcl::process status $pid1] 1]
    set status2 [lindex [tcl::process status $pid2] 1]
    expr {
	   [llength $list] eq 2
	&& [lsearch $list $pid1] >= 0
	&& [lsearch $list $pid2] >= 0
	&& [dict size $statuses] eq 2
	&& [dict get $statuses $pid1] eq $status1
	&& [dict get $statuses $pid2] eq $status2
	&& $status1 eq 0
	&& $status2 eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-5.2 FAILED



==== process-5.3 exec 3-stage pipe FAILED
==== Contents of test case:

    tcl::process autopurge 0
    set f [open "|
	  \"[interpreter]\" \"$path(exit)\" 0
	| \"[interpreter]\" \"$path(exit)\" 0
	| \"[interpreter]\" \"$path(exit)\" 0
    "]
    set pids [pid $f]
    lassign $pids pid1 pid2 pid3
    set list [tcl::process list]
    set statuses [tcl::process status -wait]
    set status1 [lindex [tcl::process status $pid1] 1]
    set status2 [lindex [tcl::process status $pid2] 1]
    set status3 [lindex [tcl::process status $pid3] 1]
    expr {
	   [llength $pids] eq 3
	&& [llength $list] eq 3
	&& [lsearch $list $pid1] >= 0
	&& [lsearch $list $pid2] >= 0
	&& [lsearch $list $pid3] >= 0
	&& [dict size $statuses] eq 3
	&& [dict get $statuses $pid1] eq $status1
	&& [dict get $statuses $pid2] eq $status2
	&& [dict get $statuses $pid3] eq $status3
	&& $status1 eq 0
	&& $status2 eq 0
	&& $status3 eq 0
    }

---- Result was:
0
---- Result should have been (exact matching):
1
==== process-5.3 FAILED
Referenced by2
dgpplain2025-06-16 19:38:50
Something in test file exec.test leaves an interpreter in
a state where the tests of tcl::process in process.test
cannot pass.

Whatever the problem is, it seems to have arrived as a
regression since Tcl 9.0.1
dgpplain2025-06-16 19:48:48
Bisecting says this is the fault of TIP 716.

Most likely its additions to exec.test.
dgpplain2025-06-16 19:52:49
-skip exec-22.1

makes the failures go away.
apnadkarnimarkdown2025-06-17 04:35:13

Thanks for the diagnosis. Proposed fix in branch bug-da5e1bc7bc.

Channel was not being closed in this and other error paths leaving the child process around and causing the process tests to fail in singleproc mode.

dgpplain2025-06-17 16:09:57
The patch is an effective fix.  Merged to the 9-0-branch.
Will merge other places from there.
Log in (anonymous is fine) to add a comment.