Skip to content
Tcl Source Code History Of Ticket 1603234fffffffffffffffffffffffffffffffff
Login

History Of Ticket 1603234fffffffffffffffffffffffffffffffff

Artifacts Associated With Ticket 1603234fffffffffffffffffffffffffffffffff

  1. Ticket change [1cd76cc2d6] (rid 90681) by nobody on 2006-11-26 15:21:00:

    1. assignee initialized to: "vasiljevic"
    2. cmimetype initialized to: "text/plain"
    3. comment initialized to:
      I am developing project using Tcl + Thread (BitTorrent tracker). At first I tried to use model where main thread after accepting new connection (using 
      socket -server) transfers connection socket to free thread using thread::transfer. But testing of this model reveals slow memory leak (about 1Mb/5min with requests rate about 100 req/sec). Using Tcl memory debugging (Tcl and Thread built with --enable-symbols=mem) and memory command I found that memory leaks after each thread::transfer call. This observes on latest Tcl/Threads versions as well (tcl8.4.14 and thread2.6.5) compiled on Solaris 9/i386 using GCC 3.3.2.
      
      Is this a known issue ? Is thread::transfer requires some extra dealing with transferred filedescriptors before or after transfer ?
      
      This is a small test:
      
      #!/usr/local/bin/tclsh
      
      package require Thread
      
      proc transfer {channel} {
          global tid
      
          puts [memory info]
          thread::transfer $tid $channel
          thread::send -async $tid "close $channel"
      }
      
      proc accept {channel client_addr client_port} {
          after idle [list transfer $channel]
      }
      
      set tid [thread::create -joinable thread::wait]
      
      socket -server accept 9999
      
      thread::wait
      
      Field "current bytes allocated" increased by 32 bytes after each incoming connection.
      
      
    4. foundin initialized to: "obsolete: 8.4.14"
    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: "nobody"
    10. subsystem initialized to: "80. Thread Package"
    11. title initialized to: "Memory leak with thread::transfer"
    12. type initialized to: "Bug"
  2. Ticket change [7a7fb1cfb4] (rid 90332) by nobody on 2006-11-26 22:22:16:

    1. icomment:
      Logged In: NO 
      
      Sorry, I forgot to include a e-mail. My e-mail is [email protected].
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  3. Ticket change [65273c5d62] (rid 92906) by hobbs on 2006-12-01 05:01:48:

    1. icomment:
      Logged In: YES 
      user_id=72656
      Originator: NO
      
      I am not able to repro this bug using valgrind 3.2.1 on Linux x64.  Perhaps it is because it is being properly freed at exit, just not in the interim use?
      
      
    2. login: "hobbs"
    3. mimetype: "text/plain"
    4. username: "hobbs"
  4. Ticket change [399d62856f] (rid 112424) by nobody on 2006-12-01 06:33:51:

    1. icomment:
      Logged In: NO 
      
      So "current bytes allocated" output by [memory info] doesn't increase after each new connection in your tests ?
      
      
      
    2. login: "nobody"
    3. mimetype: "text/plain"
    4. username: "nobody"
  5. Ticket change [413ee49b1e] (rid 116153) by vasiljevic on 2007-01-20 01:42:02:

    1. icomment:
      Logged In: YES 
      user_id=95086
      Originator: NO
      
      What you experience might be a problem in Tcl core
      that badly handles std channels. I'm loking at that
      at this moment.
      
      It appears to leak std channels on every thread 
      creation and exit. I haven't examined your code
      but will do that later on when I find out what the
      damn is happening with those channels and why do
      they leak.
      
      This is considered to be a very problematic point
      in Tcl design (handling of std channels when 
      building thread-enabled Tcl library).
      
      
      
      
    2. login: "vasiljevic"
    3. mimetype: "text/plain"
    4. username: "vasiljevic"
  6. Ticket change [b38e6e769e] (rid 124879) by oleg_derevenetz on 2007-06-05 04:02:49:

    1. icomment:
      Logged In: YES 
      user_id=1654299
      Originator: NO
      
      vasiljevic, if this issue will be resolved some day - it will be good. Are there any solutions or recommendations for this case now ?
      
      
      
    2. login: "oleg_derevenetz"
    3. mimetype: "text/plain"
    4. username: "oleg_derevenetz"
  7. Ticket change [24df9eb491] (rid 131185) by dgp on 2012-04-24 23:01:37:

    1. assignee changed to: "dgp"
    2. icomment:
      
      Problem is that ThreadTransfer() doesn't free
      the resultPtr that it allocs.
      
      
    3. login: "dgp"
    4. mimetype: "text/plain"
    5. priority changed to: "9 Immediate"
    6. username: "dgp"
  8. Ticket change [ea2c58e71f] (rid 103324) by dgp on 2012-04-24 23:41:00:

    1. closedate changed to: "2012-04-24T16:41:00"
    2. closer changed to: "dgp"
    3. icomment:
      
      
      allow_comments - 1
      
      
      Fixed for Thread 2.6.8+.
      
      
    4. login: "dgp"
    5. mimetype: "text/plain"
    6. resolution changed to: "Fixed"
    7. status changed to: "Closed"
    8. username: "dgp"