Skip to content
Tcl Source Code View Ticket
Login

View Ticket

loop running 'exec' command hangs after N iterations

Closed / Fixed217945ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 26 years ago
Descriptionplain2000-10-26 00:46:25
OriginalBugID: 3903 Bug
Version: 8.2.2
SubmitDate: '1999-12-20'
LastModified: '2000-03-30'
Severity: MED
Status: Closed
Submitter: techsupp
ChangedBy: hobbs
RelatedBugIDs: 2460
OS: Windows NT
OSVersion: Windows NT v4.0, service release 5
Machine: various PC's, a Compaq Pentium II, an IBM Pentium II, 2 homebuil
FixedDate: '2000-10-25'
ClosedDate: '2000-03-30'


Name:
Russ Durrett

Extensions:
none

CustomShell:
none

ReproducibleScript:
# A simple Tcl shell program to run 'Hello World!' in a loop.
for {set index 1} {$index <= 10000} {incr index} {
  set helloOut [exec hello.exe]
  puts "$helloOut  index = $index"
}

ObservedBehavior:
I was using a Tcl script to test a C program by running it repeatedly.  I found that the Tcl script would run the C program a certain
number of times and then hang up.  I can reduce the problem to a bare minimum by using the above script to run the following
C program in a loop:

    /* Hello World! program */
    #include <stdio.h>
    int main (void)
    {
      printf ("Hello World!\n");
      return 0;
    } /* end main */

When I run this under Windows NT (v4, SR5), it will hang after about 895 iteration with Tcl v8.1 or v8.22 and after about 2022
iterations with Tcl v8.2.  I have run this on 4 different PC's (a Compaq, an IBM, and 2 homebuilts) with very repeatable results.
I also tried this under Windows 95 and Solaris and the script worked fine, going al the way to 10,000 iterations.

DesiredBehavior:
Tcl script doesn't stop in the middle of the loop.
welch Closed ticket [217945ffff]. [History diff]2000-10-26 08:10:55
dgp Ticket [217945ffff]: 3 changes [History diff]2001-04-05 08:20:14
Log in (anonymous is fine) to add a comment.