Ticket #748 (new bug)

Opened 6 years ago

Last modified 4 years ago

memory leak in IMCC

Reported by: coke Owned by: chromatic
Priority: normal Milestone:
Component: imcc Version: trunk
Severity: high Keywords: tcl blocker memory
Cc: whiteknight Language: tcl
Patch status: Platform:

Description

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.

Change History

  Changed 6 years ago by coke

  • lang set to tcl

follow-up: ↓ 3   Changed 5 years ago by chromatic

  • owner set to chromatic

Can you still reproduce this?

Can you demonstrate this with a small PIR test case?

in reply to: ↑ 2   Changed 5 years ago by coke

Replying to chromatic:

Can you still reproduce this?

with parrot (r39799) and partcl (r 512), that large memory leak is gone, but there are several smaller leaks:

The original one leak was 25,242 bytes The full leak summary for 'tcl.pbc -e "puts hi"' is currently:

==17272== LEAK SUMMARY:
==17272==    definitely lost: 3,865 bytes in 313 blocks.
==17272==    indirectly lost: 1,704 bytes in 11 blocks.
==17272==      possibly lost: 0 bytes in 0 blocks.
==17272==    still reachable: 20 bytes in 1 blocks.
==17272==         suppressed: 0 bytes in 0 blocks.

  Changed 4 years ago by jkeenan

  • cc whiteknight added

Can we get an update on the status of this ticket?

Thank you very much.

kid51

cc-ing whiteknight because he's presently knee-deep in IMCC.

  Changed 4 years ago by coke

On Wed, Jan 26, 2011 at 9:14 AM, Will Coleda <will@coleda.com> wrote:
> partcl's dead, I have no idea if this test case is still leaking.
>
> Go ahead and close the ticket.
>

(Resending to include tickets@parrot.org, which for some reason is not
always included as a CC!)

-- 
Will "Coke" Coleda

  Changed 4 years ago by cotto

Now that partcl's been brought back to life, this leak still appears to be in effect, among a great many others:

cotto@feather:/usr/src/partcl-old @master 1 $ valgrind --leak-check=full parrot tcl.pbc -e "puts hi"
<snip>
==17273== 3,159 bytes in 351 blocks are definitely lost in loss record 511 of 974
==17273==    at 0x4025BD3: malloc (vg_replace_malloc.c:236)
==17273==    by 0x4103813: mem_sys_allocate (alloc_memory.c:55)
==17273==    by 0x4103A4B: mem_sys_strdup (alloc_memory.c:205)
==17273==    by 0x425CE4C: yylex_skip (imcc.l:842)
==17273==    by 0x425D2F9: read_macro (imcc.l:969)
==17273==    by 0x4259824: yylex (imcc.l:450)
==17273==    by 0x42529C9: yyparse (imcparser.c:3074)
==17273==    by 0x425E035: imcc_run_compilation (imcc.l:1334)
==17273==    by 0x425DFBD: compile_string (imcc.l:1325)
==17273==    by 0x426051A: imcc_compile (main.c:852)
==17273==    by 0x42609C6: imcc_compile_pir_ex (main.c:1014)
==17273==    by 0x412DCB0: pcf_P_Jt (core_thunks.c:129)
Note: See TracTickets for help on using tickets.