Skip to content
Tcl Source Code History Of Ticket 733221ffffffffff
Login

History Of Ticket 733221ffffffffff

Artifacts Associated With Ticket 733221ffffffffff

  1. Ticket change [18011f1542] (rid 122593) by mistachkin on 2003-05-06 12:07:49:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. 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;
      
      --------
      
      win/tclAppInit.c, line 269:
      
          argSpace = (char *) Tcl_Alloc(
          (unsigned) (size * sizeof(char *) + strlen
      (cmdLine) + 1));
      
      1. Shouldn't this also be ckalloc?
      2. This is a local variable in the function.
      3. This memory is never freed.
      
      --------
      
      tools/encoding/txt2enc.c
      
      1. Memory allocated via malloc on line #181 and 
      #204 is never freed.
      2. Since this is a stand-alone utility, it should be 
      fairly trivial to fix these leaks with the following 
      code before "return 0" on line #243:
      
          for (hi = 0; hi < 256; hi++) {
      if (toUnicode[hi] != NULL) {
          free(toUnicode[hi]);
                  toUnicode[hi] = NULL;
      }
          }
      
      --------
      
      generic/tclThreadAlloc.c
      
      1. We have the static file variables:
      
      static Tcl_Mutex *listLockPtr;
      static Tcl_Mutex *objLockPtr;
      
      2. They are allocated via TclpNewAllocMutex, which 
      BOTH allocates memory via malloc AND calls 
      InitializeCriticalSection on the contained critical 
      section.
      
      3. Neither the block of memory nor the critical 
      section are ever freed.
      
      4. There needs to be a new function in 
      tclThreadAlloc.c, 
      called "TclFinalizeThreadAllocSubsystem", that 
      frees these mutexes (probably by calling an 
      appropriate platform specific func, yet to be 
      created, perhaps called "TclpNewFreeMutex") and 
      then calls the "TclpFinalizeThreadAllocSubsystem" 
      function for the platform specific cleanup (i've 
      created the Win32 version of this function in my 
      new patch #731356).
      
      5. Another leak (see SF bug #731754, fixed in my 
      patch #731356) involves this code, near line #279:
      
      #ifdef WIN32
          TlsFree((DWORD) cachePtr);
      #else
          free(cachePtr);
      #endif
      
      The above code is entirely incorrect for Win32.  I 
      believe it should always be "free(cachePtr);" as 
      cachePtr is NOT a TLS index, it is a block of 
      memory.
      
      6. Yet another leak (also fixed in my patch 
      #731356) involves freeing the actual TLS index 
      used by the threaded memory allocator (what the 
      above incorrect code was TRYING and failing to do).
      
      --------
      
      
    4. foundin initialized to: "None"
    5. priority initialized to: "5 Medium"
    6. resolution initialized to: "None"
    7. status initialized to: "Open"
    8. submitter initialized to: "mistachkin"
    9. subsystem initialized to: "41. Memory Allocation"
    10. title initialized to: "various memory leaks..."
    11. type initialized to: "Bug"
  2. Ticket change [074b65535f] (rid 89369) by mistachkin on 2003-05-06 19:08:03:

    1. priority changed to: "9 Immediate"
  3. Ticket change [d822cd212b] (rid 107385) by mistachkin on 2003-05-10 15:34:55:

    1. icomment:
      Logged In: YES 
      user_id=113501
      
      I have fixed the tclAppInit.c leaks, the txt2enc.c leak, 
      and tclThreadAlloc.c cachePtr leak.  I need some help 
      (from JeffH ?) understanding the "style" of the threaded 
      memory allocator to fix the remaining leaks in it.
      
      The tclDate.c leaks totally confuse me as I have zero 
      experience with yacc.  I'm of the opinion that these 
      leaks should be plugged by creating a new finalization 
      routine specific to the tclDate.c file 
      called "TclFinalizeDate" or something like that.  
      
      Also, this file should definately be calling 
      ckalloc/ckrealloc and NOT mallco/realloc.  
      
      However, I haven't the foggiest idea how to make 
      yacc "do the right thing".
      
      
      
    2. login: "mistachkin"
    3. mimetype: "text/plain"
    4. username: "mistachkin"
  4. Ticket change [ccdf24e66e] (rid 95779) by hobbs on 2003-05-11 06:24:28:

    1. closedate changed to: "2003-05-10T23:24:28"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      Please open the remaining bugs as individual reports.  It 
      makes it easier to track which pieces are closed (and you 
      have now corrected the greater part of this multi-part report).
      
      For tclDate.c ... it's all auto-generated and I've never looked 
      too deeply into the yacc.  In any case, it does not appear to 
      be a leak since YYMAXDEPTH is defined right above it (it 
      isn't defined anywhere else), so that info is static.
      
      The threaded malloc was written by Jim Davidson et al at 
      AOL, but Zoran might also know a bit about it.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "hobbs"
  5. Ticket change [426e2fc34d] (rid 116380) by dkf on 2003-05-12 15:58:09:

    1. icomment:
      Logged In: YES 
      user_id=79902
      
      Fixing yacc output so it doesn't leak is really rather
      difficult because yacc was never designed to be used that
      way; you have to install your own memory allocators in the
      file that track all the intermediate memory allocated and
      release all the bits when you're done with them.  I don't
      think you can do this without generating loads of warnings.
      
      IMHO not using yacc is probably a better solution.  I'm sure
      KBK will agree.  ;^)
      
      
    2. login: "dkf"
    3. mimetype: "text/plain"
    4. username: "dkf"
  6. Ticket change [ddb78dc3fd] (rid 114721) by dkf on 2003-05-12 15:58:17:

    1. closedate changed to: "2003-05-12T08:58:17"
    2. closer changed to: "dkf"