Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#3781 Invalid free in Tcl core

obsolete: 8.5a7
closed-invalid
Jeffrey Hobbs
5
2007-09-25
2007-09-06
Scott Simpson
No

I checked out the latest Tcl out of CVS as of 2007-09-06 and then linked the following program against it:

#include <tcl.h>

int Tcl_AppInit(Tcl_Interp* interp)
{
if (Tcl_Init(interp) == TCL_ERROR) {
return TCL_ERROR;
}

return TCL_OK;
}

int main(int argc, char* argv[])
{
Tcl_Main(argc, argv, Tcl_AppInit);
return 0;
}

I then ran "valgrind --leak-check=full mytclsh" against it and I get the following spurious free:

==32498== Invalid free() / delete / delete[]
==32498== at 0x43CF338: free (vg_replace_malloc.c:233)
==32498== by 0x636A7BB: free_mem (in /lib/tls/libc-2.3.4.so)
==32498== by 0x636A1E1: __libc_freeres (in /lib/tls/libc-2.3.4.so)
==32498== by 0x43C6355: _vgnU_freeres (vg_preloaded.c:60)
==32498== by 0x62EE903: _Exit (in /lib/tls/libc-2.3.4.so)
==32498== by 0x4430661: Tcl_Exit (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x43FEC21: Tcl_ExitObjCmd (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x43F7233: TclEvalObjvInternal (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x4434C50: TclExecuteByteCode (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x443B6FE: TclCompEvalObj (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x43F873A: TclEvalObjEx (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== by 0x43F8A64: Tcl_EvalObjEx (in /home/simpsons/tcl/unix/libtcl8.5.so)
==32498== Address 0x45C7008 is not stack'd, malloc'd or (recently) free'd

Discussion

  • miguel sofer
    miguel sofer
    2007-09-07

    Logged In: YES
    user_id=148712
    Originator: NO

    This looks like a problem in libc's exit(), not in Tcl.

     
  • Jeffrey Hobbs
    Jeffrey Hobbs
    2007-09-11

    • status: open --> pending-invalid
     
    • status: pending-invalid --> closed-invalid
     
  • Logged In: YES
    user_id=1312539
    Originator: NO

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).