Ticket #5 (closed bug: duplicate)

Opened 6 years ago

Last modified 5 years ago

partcl's [puts hi] exposes memory leaks in r33137

Reported by: coke Owned by:
Priority: major Milestone:
Component: core Version:
Severity: none Keywords: memory
Cc: Language: tcl
Patch status: Platform: linux

Description

First get a copy of parrot (r33137) and partcl (r172)

((  http://code.google.com/p/partcl/wiki/PartclSource ))

Once you've built partcl, run the following command:

valgrind --suppressions=/home/coke/sandbox/parrot/tools/dev/parrot.supp --num-callers=500 --leak-check=full --leak-resolution=high --show-reachable=yes ./parrot --leak-test languages/tcl/tcl.pbc -e "puts hi"

This generates the about-to-be-attached valgrind output. (I've suppressed some uninit. warnings in this output to highlight the memory issues.)

Change History

Changed 6 years ago by coke

Adding the file timed out. A copy can (temporarily) be found here:

 http://www.coleda.com/tmp/puts_hi.txt

Changed 6 years ago by coke

Still can't attach files to tickets. An updated copy can be found here:

 http://www.coleda.com/tmp/puts_hi2.txt

Was (r33137): definitely lost: 19,656 bytes in 1,002 blocks.
Now (r33343): definitely lost: 15,481 bytes in 379 blocks.

Changed 6 years ago by adu

I could not use valgrind because I am on Mac OS X. However, Apple has a tool called leaks which was very helpful. Here is the output  before and  after garbage collection (GC). The recommended way of using leaks is to run it on a PID while the program is running, and to do this I put manual hangs so that parrot would stay around long enough to be tested. This is what the files looked like for these tests.

For test 1 (before) main.c:main():

    ...
    /* testing for memory leaks */
    if (getenv("PARROT_LEAK_TEST"))
        sleep(120);

    Parrot_destroy(interp);
    ...

For test 2 (after) exit.c:Parrot_exit():

    ...
    /* testing for memory leaks */
    if (getenv("PARROT_LEAK_TEST"))
        sleep(120);

    exit(status);
    ...

Changed 5 years ago by coke

  • status changed from new to closed
  • resolution set to duplicate

This ticket has been replaced with some more specific tickets covering individual leaks.

Note: See TracTickets for help on using tickets.