Artifacts Associated With Ticket 218385ffffffffff
Ticket change [791b39cdb4] (rid 90064) by nobody on 2000-10-26 00:56:57:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- 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 - foundin initialized to: "obsolete: 8.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "69. Other"
- title initialized to: "procs created by TCL_CreateInterp() leaks memory"
- type initialized to: "Bug"
Ticket change [882f264eed] (rid 131828) by welch on 2000-10-26 08:21:16:
- closedate changed to: "2000-10-26T01:21:16"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [4119a90dd4] (rid 116124) by dgp on 2001-04-19 02:52:14:
- closedate changed to: "2001-04-18T19:52:14"
- closer changed to: "dgp"
- resolution changed to: "Works For Me"
- subsystem changed to: "21. [namespace]"