Skip to content
Tcl Source Code History Of Ticket 1190441
Login

History Of Ticket 1190441

Artifacts Associated With Ticket 1190441

  1. Ticket change [01e6be336d] (rid 119565) by dossy on 2005-04-26 17:23:35:

    1. assignee initialized to: "hobbs"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      In trying to debug memory usage in Tcl, testing from
      within a tclsh is made difficult by the built-in
      "history" support.  A way to disable it (say, by
      setting an env var) would be really useful.
      
      
    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: "dossy"
    9. subsystem initialized to: "19. [history]"
    10. title initialized to:
      Provide a way to completely disable tclsh history support.
      
    11. type initialized to: "RFE"
  2. Ticket change [11d9acc72c] (rid 95213) by hobbs on 2005-11-30 04:55:35:

    1. closedate changed to: "2005-11-29T21:55:35"
    2. closer changed to: "hobbs"
    3. icomment:
      Logged In: YES 
      user_id=72656
      
      just add 'proc history args {}' at the beginning of a script
      to disable it.
      
      
    4. login: "hobbs"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"
    7. username: "hobbs"
  3. Ticket change [061845e843] (rid 89159) by dossy on 2005-11-30 07:55:32:

    1. icomment:
      Logged In: YES 
      user_id=21885
      
      That doesn't stop the constant Tcl_Eval'ing of the "history"
      commands, though.  That adds a bunch of noise to the
      debugging process.
      
      I think the answer might be to create a LD_PRELOAD hack that
      hijacks the Tcl_RecordAndEvalObj() function using dlsym()
      hacks, since Tcl_Main() calls it.  My point was, it'd be
      nice if there were a way to tell Tcl_Main() to just call
      Tcl_EvalObjEx() directly -- or, tell Tcl_RecordAndEvalObj()
      to not eval the "history add <foo>".
      
      Thanks.
      
      
    2. login: "dossy"
    3. mimetype: "text/plain"
    4. username: "dossy"
  4. Ticket change [9aed1ee2b9] (rid 111035) by msofer on 2005-11-30 09:37:31:

    1. closedate changed to: "2005-11-30T02:37:31"
    2. closer changed to: "msofer"
    3. icomment:
      Logged In: YES 
      user_id=148712
      
      Even easier: Tcl_RecordAndEvalObj could check if [history]
      is a proc with empty body, in which case it would skip
      calling it.
      
      This is a very simple change (patch attached untested!),
      waiting for comments before commiting: acceptable? satisfies
      dossy's needs?
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. status changed to: "Pending"
    7. username: "msofer"
  5. Add attachment "history.patch" [7c1e9a5a7a] (rid 97025) by msofer on 2005-11-30 09:37:32.

  6. Ticket change [492f7fea13] (rid 100015) by msofer on 2005-11-30 09:37:32:

    1. icomment:
      
      
      File Added - 158067: history.patch
      
      
      
    2. login: "msofer"
    3. mimetype: "text/plain"
    4. username: "msofer"
  7. Ticket change [ec09717270] (rid 103639) by hobbs on 2005-12-01 02:46:17:

    1. assignee changed to: "msofer"
    2. icomment:
      Logged In: YES 
      user_id=72656
      
      Miguel - that sounds good, although I'm dubious why this
      should really make memory debugging any harder (since I've
      been doing mem debugging lately, and 'proc history args {}'
      sufficed).
      
      
    3. login: "hobbs"
    4. mimetype: "text/plain"
    5. username: "hobbs"
  8. Ticket change [c8355e3b3c] (rid 122066) by dossy on 2005-12-01 03:16:18:

    1. icomment:
      Logged In: YES 
      user_id=21885
      
      I have a (dirty hack) LD_PRELOAD library that uses dlsym()
      trickery to wrap Tcl_Alloc, Tcl_Realloc and Tcl_Free with my
      own versions that do some logging (then calls the saved
      pointers to the original functions).
      
      Apparently there's a bunch of hooey that goes on in the
      Tcl_EvalObjEx() machinery and having two such calls, instead
      of one, adds a lot of "noise" to the logging.
      
      I'm struggling with trying to track down where memory is
      actually being used in multi-threaded Tcl -- AOLserver.  I
      try to test some things from a normal (interactive) tclsh to
      compare its logs to what's going on in AOLserver, but it's
      confusing.
      
      I also hijack a bunch of AOLserver "Ns_*" symbols as well. 
      It's all very exciting, but hasn't revealed much yet.
      
      
    2. login: "dossy"
    3. mimetype: "text/plain"
    4. status changed to: "Open"
    5. username: "dossy"
  9. Ticket change [63158d745b] (rid 92513) by hobbs on 2005-12-01 03:19:29:

    1. icomment:
      Logged In: YES 
      user_id=72656
      
      Unless you suspect the threaded Tcl allocator itself, all
      mem debugging should be done with -DPURIFY enabled, and exit
      the process by first renaming exit to {}.  The latter may
      not be necessary if you are using Tcl embedded and properly
      delete the final interp and finalize.
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  10. Ticket change [6d5db77ec3] (rid 128685) by dossy on 2005-12-01 03:24:29:

    1. icomment:
      Logged In: YES 
      user_id=21885
      
      I'm not talking about a memory leak -- yes, we might have
      those, too -- I'm talking about a "resource abuse leak" --
      where one thread running some Tcl script is using/holding on
      to a sizable amount of memory and not cleaning up after itself.
      
      Currently, there's very little that I know of for debugging
      this stuff.  I can use the seemingly unsupported
      Tcl_GetMemoryInfo() but that's not fine-grained enough to
      solve my problem.
      
      So, I log each thread's creation and every time a thread
      allocs/frees memory, then do point-in-time "accounting"
      figuring out net memory-in-use per thread and try to graph
      it over time to see which thread is using memory and tie it
      back to what Tcl script it might have been executing at the
      time.
      
      I'm thinking about hijacking Tcl_NewObj() and friends to
      track Tcl_Obj creation/destruction, but that's going to be a
      lot of work (but probably *exactly* what I need, here).
      
      
      
    2. login: "dossy"
    3. mimetype: "text/plain"
    4. username: "dossy"
  11. Ticket change [dc78190c65] (rid 114488) by msofer on 2006-09-30 00:59:39:

    1. priority changed to: "8"
  12. Ticket change [e1309037ed] (rid 87406) by msofer on 2006-10-01 00:59:43:

    1. closedate changed to: "2006-09-30T17:59:43"
    2. closer changed to: "msofer"
    3. icomment:
      
      
      File Added - 195999: history.patch
      
      Logged In: YES 
      user_id=148712
      
      updated patch, committed.
      
      
    4. login: "msofer"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "msofer"
  13. Add attachment "history.patch" [366cb014a7] (rid 107100) by msofer on 2006-10-01 00:59:43.