Artifacts Associated With Ticket 218821ffffffffff
Ticket change [7222ef4dfc] (rid 100807) by nobody on 2000-10-26 01:05:59:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 2254 Bug Version: 8.1 SubmitDate: '1999-06-21' LastModified: '1999-07-01' Severity: MED Status: Released Submitter: techsupp ChangedBy: foster OS: Other Machine: NA FixedDate: '1999-06-21' FixedInVersion: 8.2b1 ClosedDate: '2000-10-25' Name: Andrej Vckovski CVS: tclUnixThrd.c 1.18 98/02/19 14:24:12 ObservedBehavior: in TclpThreadCreate(), the pthread_attr_t attr structure is not destroyed. This causes a Memory Leak. However, I am not 100% sure if that's really ok, as I as a uninitalized memory read on thr_create() after fixing this. But according to POSIX threads definition an attr structure needs to be destroyed after usage. DesiredBehavior: no leak Patch: *** tclUnixThrd.c Fri Jun 18 20:48:24 1999 --- tclUnixThrd.c.fixed Fri Jun 18 19:53:42 1999 *************** *** 71,85 **** Tcl_ThreadCreateProc proc; /* Main() function of the thread */ ClientData clientData; /* The one argument to Main() */ { pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); if (pthread_create((pthread_t *)idPtr, &attr, (void * (*)())proc, (void *)clientData) < 0) { ! return TCL_ERROR; } else { ! return TCL_OK; } } /* --- 71,88 ---- Tcl_ThreadCreateProc proc; /* Main() function of the thread */ ClientData clientData; /* The one argument to Main() */ { + int res; pthread_attr_t attr; pthread_attr_init(&attr); pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); if (pthread_create((pthread_t *)idPtr, &attr, (void * (*)())proc, (void *)clientData) < 0) { ! res = TCL_ERROR; } else { ! res = TCL_OK; } + pthread_attr_destroy(&attr); + return res; } /* PatchFiles: tclUnixThrd.c 06/21/1999 11:53 - stanton - Applied patch - foundin initialized to: "obsolete: 8.1"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "49. Threading"
- title initialized to: "Memory leak on thread creation"
- type initialized to: "Bug"
Ticket change [a6df78d77e] (rid 98680) by welch on 2000-10-26 08:29:17:
- closedate changed to: "2000-10-26T01:29:17"
- closer changed to: "welch"
- priority changed to: "2"
- resolution changed to: "Fixed"
- status changed to: "Closed"