#1999 leak with the new thread allocator

obsolete: 8.4b2
closed-fixed
miguel sofer
8
2002-08-07
2002-07-27
miguel sofer
No

Reported on clt by Sven Sass on clt:
http://groups.google.com/groups?dq=&start=25&hl=en&lr=&ie=UTF-8&group=comp.lang.tcl&selm=88d0b923.0207260455.4e4f3da9%40posting.google.com
http://groups.google.com/groups?dq=&hl=en&lr=&ie=UTF-8&group=comp.lang.tcl&selm=ahrscj%24290%2402%241%40news.t-online.com

The problem is: when compiling with both
-DTCL_THREADS -DUSE_THREAD_ALLOC
the following script (typed at the tclsh prompt) leaks
massively

for { set i 0 } { $i < 100000 } {incr i} {
lappend a ""
unset a
}

Replacing [lappend] with [append] or [unset a] with
[set a {}] stops the leak; compiling with the previous
allocator stops it too.

I confirmed the problem on linux, with the HEAD as of
2002-04-24 - i.e., just after the commit of the new
allocator and before releasing tcl8.4b1.

Discussion

  • miguel sofer
    miguel sofer
    2002-08-07

    Logged In: YES
    user_id=148712

    Fixed in HEAD - generic/tclObj.c (Tcl_NewObj) was missing
    the special code for USE_THREAD_ALLOC, and was thus
    allocating the object in a list that would never be freed.

     
  • miguel sofer
    miguel sofer
    2002-08-07

    • assigned_to: hobbs --> msofer
    • status: open --> closed-fixed
     
  • miguel sofer
    miguel sofer
    2002-08-08

    Logged In: YES
    user_id=148712

    Note: no test added, the leak was already exercised by the
    testsuite (creating object with lappend), so that purify
    should pick it up.