Ticket #16 (new todo) — at Version 6

Opened 13 years ago

Last modified 11 years ago

fix memory leaks in pirc

Reported by: anonymous Owned by: kjs
Priority: normal Milestone:
Component: pirc Version:
Severity: none Keywords: pirc
Cc: Language:
Patch status: Platform:

Description (last modified by plobsing) (diff)

Some places in PIRC use parrot's mem_sys_allocate(); they should be either converted to pir_mem_allocate, for automatic free()ing, or they should be explicitly free()d somewhere using mem_sys_free(). This depends on how easy it is to track where the memory is used, and when it can be free()d. In general, PIRC's pir_mem_allocate should be used.

This needs to be fixed.

Change History

Changed 13 years ago by coke

  • keywords pirc added
  • summary changed from [pirc] fix memory leaks in pirc to fix memory leaks in pirc

Changed 13 years ago by kjs

  • owner set to kjs

Changed 13 years ago by kjs

  • component changed from none to pirc

Changed 13 years ago by dtg

Hi, I suppose this is related:

[17:10:36] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST> svn info ..
Path: ..
URL: http://svn.perl.org/parrot/trunk
Repository Root: http://svn.perl.org/parrot
Repository UUID: d31e2699-5ff4-0310-a27c-f18f2fbe73fe
Revision: 34883
Node Kind: directory
Schedule: normal
Last Changed Author: bernhard
Last Changed Rev: 34883
Last Changed Date: 2009-01-03 15:57:53 +0100 (Sat, 03 Jan 2009)

[17:10:37] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST> cat leak.pir
.sub foo
.end

[17:10:38] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST> parrot -O1 -o leak.pbc leak.pir

[17:10:39] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST> pbc_to_exe leak.pbc | grep -i warning

[17:10:40] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST> valgrind --leak-check=full -q ./leak
==1203==
==1203== 7 bytes in 1 blocks are definitely lost in loss record 1 of 1
==1203==    at 0x40053C0: malloc (vg_replace_malloc.c:149)
==1203==    by 0x41D8A63: mem_sys_allocate (memory.c:47)
==1203==    by 0x415CB8A: string_to_cstring_nullable (string.c:2203)
==1203==    by 0x415CC3C: string_to_cstring (string.c:2177)
==1203==    by 0x43A36C1: Parrot_String_set_string_native (string.pmc:221)
==1203==    by 0x43A32E5: Parrot_String_thaw (string.pmc:841)
==1203==    by 0x421B336: do_thaw (pmc_freeze.c:1393)
==1203==    by 0x421B463: visit_todo_list_thaw (pmc_freeze.c:1660)
==1203==    by 0x4416317: Parrot_FixedPMCArray_visit (fixedpmcarray.pmc:754)
==1203==    by 0x421AB88: visit_loop_todo_list (pmc_freeze.c:1733)
==1203==    by 0x421ADF1: run_thaw (pmc_freeze.c:1857)
==1203==    by 0x421AFB5: Parrot_thaw (pmc_freeze.c:1981)

[17:10:41] goosh@orbiter:~/dev/workspace/PARROT/parrot/TEST>

regards dtg

Changed 11 years ago by plobsing

  • description modified (diff)

Changed 11 years ago by plobsing

  • description modified (diff)

This issue is now being tracked at as issue #3 for  https://github.com/parrot/pirc. ( https://github.com/parrot/pirc/issues/#issue/3)

Note: See TracTickets for help on using tickets.