Artifacts Associated With Ticket 736425ffffffffff
Ticket change [27f96860af] (rid 88619) by mistachkin on 2003-05-12 11:27:58:
- assignee initialized to: "kennykb"
- cmimetype initialized to: "text/plain"
- comment initialized to:
generic/tclDate.c 1. Shouldn't this file be using ckalloc/ckrealloc? 2. The following variables are allocated and are never freed: int *TclDates; YYSTYPE *TclDatev; ----- It appears that we can override the use of malloc/realloc by defining the YYEXPAND preprocessor macro and having it call a function which does ckalloc/ckrealloc instead. As for the leak, I think since the only memory that is allocated by this file is the two static variables above, a finalization routine is in order. This should be a fairly trivial fix. I have attached a preliminary fix for these two issues (this is not a patch, it's just some code to cut and paste into tclDate.c/tclGetDate.y). I'm willing to learn yacc to assist if necessary. As a "next gen" solution to this problem, I suggested to dkf that we parse the dates using Tcl code that is evaluated when necessary (since yacc appears to be rather wild).
- foundin initialized to: "None"
- priority initialized to: "9 Immediate"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "mistachkin"
- subsystem initialized to: "06. Time Measurement"
- title initialized to: "memory leaks in tclDate.c"
- type initialized to: "Bug"
Ticket change [085ec3b1b2] (rid 89551) by mistachkin on 2003-05-12 18:27:58:
- icomment:
File Added - 50173: datefix.c
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Add attachment "datefix.c" [b8a56e17ca] (rid 128997) by mistachkin on 2003-05-12 18:27:58.
Ticket change [207448791c] (rid 91310) by hobbs on 2003-05-14 06:03:07:
- icomment:
Logged In: YES user_id=72656 No finalization is necessary because those two are statics, and I don't think anyone has ever changed that behavior. The point is that this is all yacc, and thus we have to work with what yacc gives us. It may be necessary to change the YYEXPAND, but I don't know of any problems that have arisen from this. The "leak" is a red herring because that is a never-used code path.
- login: "hobbs"
- mimetype: "text/plain"
- priority changed to: "5 Medium"
- username: "hobbs"
- icomment:
Ticket change [9e31ca17ab] (rid 96438) by mistachkin on 2003-05-14 10:15:44:
- icomment:
Logged In: YES user_id=113501 I already have some code that will fix these problems. Does anybody have a test case I can use to test it with (something that forces it to call malloc/realloc)? Also, what version of yacc is required and what is the proper invocation of the command to process tclGetDate.y ?
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [04a6cc2cf2] (rid 120039) by kennykb on 2003-05-19 02:40:11:
- closedate changed to: "2003-05-18T19:40:11"
- closer changed to: "kennykb"
- icomment:
Logged In: YES user_id=99768 Original poster confirms that the memory leak is resolved.
- login: "kennykb"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "kennykb"