petdance/scratch — Issue #68: memory leak in IMCC
Author: petdance
Created: 2011-11-14 06:06:43+00:00
State: open
Labels: bug, imcc, Pri-normal, Sev-high

From a valgrind run against partcl (r440) on parrot (r39470) using
parrot tcl.pbc -e "puts hi"

```
==12199== 25,242 bytes in 1,120 blocks are definitely lost in loss record 48 of 48
==12199== at 0x402601E: malloc (vg_replace_malloc.c:207)
==12199== by 0x40D78B3: mem_sys_allocate (alloc_memory.c:47)
==12199== by 0x4136C0B: str_dup (primitives.c:357)
==12199== by 0x43210B9: yylex_skip (imcc.l:859)
==12199== by 0x431F527: yylex (imcc.l:416)
==12199== by 0x431649E: yyparse (imcparser.c:3117)
==12199== by 0x431C03D: compile_string (imcc.l:1351)
==12199== by 0x4338A84: imcc_compile (parser_util.c:683)
==12199== by 0x4338D2D: imcc_compile_pir_ex (parser_util.c:876)
==12199== by 0x439708C: ???
==12199== by 0x426112B: Parrot_NCI_invoke (nci.pmc:326)
==12199== by 0x4061835: Parrot_invokecc_p (core.ops:504)
==12199== by 0x413124F: runops_slow_core (cores.c:462)
==12199== by 0x412FE4D: runops_int (main.c:987)
==12199== by 0x40EC710: runops (ops.c:107)
==12199== by 0x40ECB03: runops_args (ops.c:256)
==12199== by 0x40ED9B5: Parrot_runops_fromc_args (ops.c:325)
==12199== by 0x40CA856: Parrot_runcode (embed.c:1014)
==12199== by 0x4322A5E: imcc_run_pbc (main.c:801)
==12199== by 0x432365B: imcc_run (main.c:1092)
==12199== by 0x8048967: main (main.c:61)
```

This is 82% of the leaked memory.

Originally http://trac.parrot.org/parrot/ticket/748