Artifacts Associated With Ticket 219066
Ticket change [1ace1b7c8f] (rid 123043) by nobody on 2000-10-26 01:10:06:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 4552 Bug Version: 8.2 SubmitDate: '2000-03-24' LastModified: '2000-03-27' Severity: LOW Status: Released Submitter: techsupp ChangedBy: hobbs OS: Windows NT FixedDate: '2000-03-27' FixedInVersion: 8.3.1 ClosedDate: '2000-10-25' Name: Kent Bloomstrand ReproducibleScript: The leak is not limited to only the TclPro library. I just ran another test this morning against both the "tcl82.dll" that ships with SS 5.0 and that of Tcl 8.2.3 and here is what I found: Beside the TclPro 1.3 tbcload leak problem, there is a definite leak in the base "source" command not getting properly cleaned up after TCL_DeleteInterp() is called. This happens with either the "tcl82.dll" that ships with StoryServer 5.0 (w/ 5.0.1 QA-8 patch) or with the Tcl 8.2.3 "tcl82.dll". I don't think we can allow leaks like this to occur in our products. In a simple test case, I run the program below to simulate a total of 40000 calls to repeatedly "source" the same non-compiled TCL file (with 600 simple procedures inside) and the total leak was about 10MB on my NT box. How to reproduce: Compile and run the following C program (similar to the one from Step 3). The file "d:/temp/plain.tcl" (cmd_2 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[]) { int i, j, status; char *cmd_2 = "source {d:/temp/plain.tcl}"; Tcl_Interp *interp; interp = Tcl_CreateInterp(); for (i = 0 ; i < 400 ; i++) { printf("%d...", i); for (j = 0 ; j < 100 ; j++) { printf("."); status = Tcl_GlobalEval(interp, cmd_2); if (status != TCL_OK) { printf("Source failed\n"); return 1; } } printf("\n"); } Tcl_DeleteInterp(interp); printf("Hit RETURN when done..."); getchar(); return 0; } ObservedBehavior: it leaks memory DesiredBehavior: it doesn't leak This turned out to be a "bug" in the provided script which never cleared the namespace export array (given the optional -clear argument). 8.3.1 has a fix to further improve this by checking for duplicates before adding to the export array. -- 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: "leak related to SOURCE command"
- type initialized to: "Bug"
Ticket change [279c7ada6b] (rid 88548) by welch on 2000-10-26 08:34:07:
- closedate changed to: "2000-10-26T01:34:07"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"
Ticket change [d7203b9e21] (rid 123927) by dgp on 2001-04-19 03:37:44:
- closedate changed to: "2001-04-18T20:37:44"
- closer changed to: "dgp"
- resolution changed to: "Invalid"
- subsystem changed to: "21. [namespace]"