Skip to content
Tcl Source Code History Of Ticket 218385
Login

History Of Ticket 218385

Artifacts Associated With Ticket 218385

  1. Ticket change [791b39cdb4] (rid 90064) by nobody on 2000-10-26 00:56:57:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      OriginalBugID: 4553 Bug
      Version: 8.2
      SubmitDate: '2000-03-24'
      LastModified: '2000-03-27'
      Severity: SER
      Status: Closed
      Submitter: techsupp
      ChangedBy: hobbs
      RelatedBugIDs: 4552 4503
      OS: Windows NT
      FixedDate: '2000-10-25'
      ClosedDate: '2000-03-27'
      
      
      Name:
      Kent Bloomstrand
      
      ReproducibleScript:
      It seems redefining the same procs (non-compiled) within a single 
      TCL interp created by TCL_CreateInterp() will also cause memory 
      leak (per Mark Scheevel's suggestion). 
      
      How to reproduce: 
      
      Compile and run the following C program (similar to the one from Step 3). 
      The file "d:/temp/plain.tcl" ("*file" in the following program) is the 
      same simple TCL file from Step 1 before with 600 simple procedures 
      such as 'proc ::ns::proc_a {} {return 1}': 
      
      int main(int argc, char* argv[]) 
      { 
          // code to re-eval the same set of non-compiled TCL procs 250,000 times 
          int i, j, status; 
          char tmp[32766]; 
          char *file = "d:/temp/plain.tcl"; 
          char cmd_string[32766]; 
          FILE *fp; 
          Tcl_Interp *interp; 
      
          if (NULL != (fp = fopen(file, "r"))) { 
              strcpy(cmd_string, "namespace eval :: {\n"); 
              while (! feof(fp)) { 
                  (void) fgets(tmp, 2048, fp); 
                  strcat(cmd_string, tmp); 
              } 
              strcat(cmd_string, "}\n"); 
          } 
          fclose(fp); 
      
          interp = Tcl_CreateInterp(); 
          for (i = 0 ; i < 10000 ; i++) { 
              printf("%d...", i); 
              for (j = 0 ; j < 100 ; j++) { 
                  printf("."); 
                  status = Tcl_GlobalEval(interp, cmd_string); 
                  if (status != TCL_OK) { 
                      printf("namespace eval failed\n"); 
                      return 1; 
                  } 
              } 
              printf("\n"); 
          } 
          Tcl_DeleteInterp(interp); 
      
          printf("Hit RETURN when done..."); 
          getchar(); 
          return 0; 
      }
      
      ObservedBehavior:
      it leaks
      
      DesiredBehavior:
      no leak
      
      
      
      This particular case is not reproducable, but may be related to
      4552 (use of 'namespace export cmd1' causes monotonic memory
      growth, but *not* a leak), or 4503, which points out that tbcload
      has a leak in repeated sourcing of the same file. 
      -- 03/27/2000 hobbs
      
    4. foundin initialized to: "obsolete: 8.2"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "nobody"
    9. subsystem initialized to: "69. Other"
    10. title initialized to: "procs created by TCL_CreateInterp() leaks memory"
    11. type initialized to: "Bug"
  2. Ticket change [882f264eed] (rid 131828) by welch on 2000-10-26 08:21:16:

    1. closedate changed to: "2000-10-26T01:21:16"
    2. closer changed to: "welch"
    3. priority changed to: "2"
    4. resolution changed to: "Fixed"
    5. status changed to: "Closed"
  3. Ticket change [4119a90dd4] (rid 116124) by dgp on 2001-04-19 02:52:14:

    1. closedate changed to: "2001-04-18T19:52:14"
    2. closer changed to: "dgp"
    3. resolution changed to: "Works For Me"
    4. subsystem changed to: "21. [namespace]"