#2993 Memory leak?

obsolete: 8.5a2
closed-fixed
9
2004-12-02
2004-12-02
No

compile-12.1 fails for me (config: Linux, Fedora Core
2, Tcl HEAD built with --enable-symbols=all,
--enable-threads)

==== compile-12.1 testing literal leak on interp delete
FAILED
==== Contents of test case:

proc getbytes {} {
set lines [split [memory info] "\n"]
puts [lindex $lines 3]
lindex $lines 3 3
}

set end [getbytes]
for {set i 0} {$i < 5} {incr i} {
interp create foo
foo eval {
namespace eval bar {}
}
interp delete foo
set tmp $end
set end [getbytes]
}
rename getbytes {}
set leak [expr {$end - $tmp}]

---- Result was:
20736
---- Result should have been (exact matching):
0
==== compile-12.1 FAILED

Discussion

  • miguel sofer

    miguel sofer - 2004-12-02

    Logged In: YES
    user_id=148712

    Reproed under --enable-symbols=mem (no threads); leak is
    5328 here

     
  • miguel sofer

    miguel sofer - 2004-12-02

    Logged In: YES
    user_id=148712

    Leak is real, and independent ofcompile flags. With a normal
    build, you can watch (in top) as a tclsh running
    while i {interp create a; interp delete a}
    grows in memory used.

     
  • miguel sofer

    miguel sofer - 2004-12-02
    • priority: 5 --> 9
     
  • Jeffrey Hobbs

    Jeffrey Hobbs - 2004-12-02

    Logged In: YES
    user_id=72656

    I cannot confirm this for 8.4.9 or HEAD on Windows. Unix
    only?? Testing with:

    make shell
    % while 1 { interp delete [interp create a] }

     
  • miguel sofer

    miguel sofer - 2004-12-02

    Logged In: YES
    user_id=148712

    The leak was not there in 8.5a1

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    leak is new since 2004-11-15.

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    leak is new since 2004-11-28.

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    Ignore those comments.

    Appears the failed test doesn't
    show up on Solaris ?

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    ok, on a better test platform,
    confirmed the leak started
    between 2004-11-30 and
    2004-12-01. very likely a
    problem in my commit.

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    leak is rooted in the
    post-script-evaluation
    portion of Tcl_Init.

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    leak happens in the call to
    TclpGetEncodingNameFromEnvironment()

     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    leak happens in the
    Tcl_GetEncoding() call
    that returns NULL.

     
  • Don Porter

    Don Porter - 2004-12-02
    • labels: 105683 --> 38. Init - Library - Autoload
    • assigned_to: msofer --> dgp
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2004-12-02

    Logged In: YES
    user_id=80530

    Leak is in MakeFileMap()
    in tclEncoding.c

    root cause was confusion about the
    refCounting of Tcl_Obj's returned
    by TclPathPart().

    Committing fix...

    thanks to the reporters and testers.

     

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks