Skip to content
This repository has been archived by the owner on Jun 1, 2023. It is now read-only.

new sub and signature parser leak on errors #94

Closed
rurban opened this issue Dec 20, 2015 · 2 comments
Closed

new sub and signature parser leak on errors #94

rurban opened this issue Dec 20, 2015 · 2 comments
Assignees
Labels

Comments

@rurban
Copy link
Member

rurban commented Dec 20, 2015

PERL_DESTRUCT_LEVEL=2 valgrind --leak-check=full ./miniperl -Ilib -e'+sub:a{}'

With GH #7 , the interim signature parse leaks the lex op yyval.opval on errors.

==10628== 222,208 (7,168 direct, 215,040 indirect) bytes in 14 blocks are definitely lost in loss re
cord 43 of 43
==10628==    at 0x4C2AD10: calloc (vg_replace_malloc.c:623)
==10628==    by 0x415CE1: S_new_slab (op.c:181)
==10628==    by 0x415DED: Perl_Slab_Alloc (op.c:226)
==10628==    by 0x4239A1: Perl_newOP (op.c:4748)
==10628==    by 0x4A0FED: S_pending_ident (toke.c:8257)
==10628==    by 0x486A02: Perl_yylex (toke.c:4340)
==10628==    by 0x4B4F04: Perl_yyparse (perly.c:322)
==10628==    by 0x63CAD9: S_doeval (pp_ctl.c:3484)
==10628==    by 0x642B49: Perl_pp_require (pp_ctl.c:4169)
==10628==    by 0x52BB2B: Perl_runops_debug (dump.c:2232)
==10628==    by 0x40B4D4: Perl_call_sv (perl.c:2740)
==10628==    by 0x414117: Perl_call_list (perl.c:4846)

testcase: cperl t/op/svleak.t

not ok 130 - OP_SIGNATURE
# Failed test 130 - OP_SIGNATURE at t/op/svleak.t line 32
#      got "1"
# expected <= "0"
not ok 131 - OP_SIGNATURE err
# Failed test 131 - OP_SIGNATURE err at t/op/svleak.t line 32
#      got "1"
# expected <= "0"

This only fails in the errorcase.

@rurban rurban added this to the v5.22.2 milestone Dec 20, 2015
@rurban rurban self-assigned this Dec 20, 2015
@rurban
Copy link
Member Author

rurban commented Dec 20, 2015

Only leaks in the error case.

@rurban rurban removed this from the v5.22.2 milestone Dec 20, 2015
@rurban rurban changed the title signature parser leak new sub and signature parser leak on errors Dec 20, 2015
@rurban
Copy link
Member Author

rurban commented Jan 1, 2016

Ok, this is a wrong test, which assumes it will leak one more sv as multideref, but does not.
Fixed the test with 99190cbfbd7006166c68a6268b78f9ed65e3e3e9

@rurban rurban closed this as completed Jan 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

1 participant