Skip to content
Tcl Source Code History Of Ticket 1589794fffffffff
Login

History Of Ticket 1589794fffffffff

Artifacts Associated With Ticket 1589794fffffffff

  1. Ticket change [636e8c0ee0] (rid 92574) by celine_thales on 2006-11-03 09:28:21:

    1. assignee initialized to: "nobody"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      Hello,
      
      I use tcl 8.3.4 on Win XP, and build with Visual C++ 6.0.
      In need to use Tcl with thread implementation, and I
      add TCL_THREADS compile option in settings of Tcl
      project and calling project. Then I saw a lot of memory
      leaks that appeared after call of Tcl_Finalize, at the
      end of application in debug. I don't use it in a
      console, so I use Tcl_Init, and Tcl_Finalize.
      
      I needed to correct a bug in Tcl_FinalizeNotifier so
      that it doesn't crash because pointer was NULL (Bug
      #217982).
      
      I added TclThread_Init just after Tcl_Init but don't
      know if it's necessary.
      
      I tried also with tcl 8.4.13 and this doesn't change
      anything for memory leaks.
      
      I tried to track leaks with TCL_MEM_DEBUG and call of
      Tcl_DumpActiveMemory without success.
      
      Is there anything special to do to be in multi
      threading after setting TCL_THREADS?
      
      Thank you for answering me because I begin to feel lost!
      
      Celine
      
      
      
    4. foundin initialized to: "obsolete: 8.3.4"
    5. is_private initialized to: "0"
    6. priority initialized to: "5 Medium"
    7. resolution initialized to: "None"
    8. status initialized to: "Open"
    9. submitter initialized to: "celine_thales"
    10. subsystem initialized to: "49. Threading"
    11. title initialized to: "Memory leaks with TCL_THREADS"
    12. type initialized to: "Bug"
  2. Add attachment "LogTCL_MEM_DEBUG_thread.txt" [871636c303] (rid 131633) by celine_thales on 2006-11-03 16:28:21.

  3. Ticket change [b086611272] (rid 97995) by celine_thales on 2006-11-03 16:28:22:

    1. icomment:
      
      
      File Added - 201253: LogTCL_MEM_DEBUG_thread.txt
      
      
      
    2. login: "celine_thales"
    3. mimetype: "text/plain"
    4. username: "celine_thales"
  4. Ticket change [d9b2d8a0bf] (rid 107650) by dkf on 2006-11-03 17:52:23:

    1. assignee changed to: "vasiljevic"
  5. Ticket change [046775d83a] (rid 119996) by vasiljevic on 2007-01-20 01:39:28:

    1. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      You are by no means lost. I'm slow but sure :-)
      What you experience might be a problem in Tcl core
      that badly handles std channels. I'm loking at that
      at this moment.
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  6. Ticket change [f63d739520] (rid 130268) by celine_thales on 2007-01-22 15:30:23:

    1. icomment:
      Logged In: YES 
      user_id=1631532
      Originator: YES
      
      Hi, 
      the solution I found at this moment was to add TclFinalizeThreadData in Tcl_Finalize and I modified the way my threads were called, because I realized that Tcl_Init was not necessary executed in the same calling thread as Tcl_Finalize. I have no more leaks now, but my solution might not be the right one.
      
      Thank you to have taken my problem into account. 
      
      
      
    2. login: "celine_thales"
    3. mimetype: "text/plain"
    4. username: "celine_thales"
  7. Ticket change [4ca42f3a1f] (rid 126925) by vasiljevic on 2007-01-22 15:43:36:

    1. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      Can you tell me where exactly (post a code excerpt or a diff) you added 
      TclFinalizeThreadData?
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  8. Add attachment "TclEvent_c.txt" [181c1d7ed1] (rid 122612) by celine_thales on 2007-01-22 16:21:03.

  9. Ticket change [87a300ba67] (rid 131730) by celine_thales on 2007-01-22 16:21:04:

    1. icomment:
      
      
      File Added - 212462: TclEvent_c.txt
      
      Logged In: YES 
      user_id=1631532
      Originator: YES
      
      I joined diffTclEvent.jpg
      File Added: TclEvent_c.txt
      
      
    2. login: "celine_thales"
    3. mimetype: "text/plain"
    4. username: "celine_thales"
  10. Ticket change [5b948c5778] (rid 118356) by vasiljevic on 2007-06-30 21:02:31:

    1. closedate changed to: "2007-06-30T14:02:31"
    2. closer changed to: "vasiljevic"
    3. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      Allright. The change you made was helping in 
      the case Tcl_Init and Tcl_Finalize are not done
      in the same thread. 
      
      Normally Tcl_Init and Tcl_Finalize should be called
      from the same thread (the main startup thread)
      which is the first thread in your process. So the 
      first thread should load and init the Tcl library and
      it is this one thread that needs to finalize and unload
      the Tcl library. You cannot delegate this to some other
      thread.
      Yep, this is not a sign of a good design and has
      quite a few of side-effects like: you must somehow
      terminate all threads using Tcl lib before your main
      thread that loaded/inited Tcl lib exists.
      But that's the way it is now; changing this would 
      require a major library rewrite which is expensive. 
      For the time being you should always pay attention
      to load and finalize Tcl library in the same (preferably 
      startup) thread.
      
      Cheers
      Zoran
      
      
    4. login: "vasiljevic"
    5. mimetype: "text/plain"
    6. resolution changed to: "Wont Fix"
    7. status changed to: "Closed"
    8. username: "vasiljevic"