Hi Joel, Thank you for the testing. I fixed the problem by the attached patch. Please review my changes in "symbol_list_free". I was forced to "inline" the LIST_FREE macro in order not to traverse the list twice. Let me know if you have objections.
I pushed the patch to master and branch-2.5. Alex On Thu, Jul 23, 2009 at 12:07 AM, Joel E. Denny <[email protected]> wrote: > Hi Alex. > > On Sat, 4 Jul 2009, Alex Rozenman wrote: > > > I pushed the attached patch to the master. The patch contains various > style > > fixes (according to Akim's request) and some factoring. I will also > > cherry-pick to branch-2.5. > > I just ran make maintainer-check-valgrind in branch-2.5:tests/. There are > some memory leaks in your named reference code as revealed by test group > 29, shown below. Could you take a look at that? Thanks. > > % VALGRIND_OPTS='--leak-check=full --show-reachable=yes' ./testsuite > PREBISON='valgrind -q' PREPARSER='valgrind -q' -v 29 > ## ----------------------------------- ## > ## GNU Bison 2.4.1.92-cba9 test suite. ## > ## ----------------------------------- ## > 29. named-refs.at:20: testing ... > ./named-refs.at:189: bison -o test.c test.y > --- /dev/null 2009-04-16 12:14:40.000000000 -0400 > +++ > /home/jdenny/cs/bison/bison-git/tests/testsuite.dir/at-groups/29/stderr > 2009-07-22 16:03:35.000000000 -0400 > @@ -0,0 +1,23 @@ > +==15074== > +==15074== 120 bytes in 1 blocks are still reachable in loss record 1 of 2 > +==15074== at 0x4022AB8: malloc (vg_replace_malloc.c:207) > +==15074== by 0x4022BFC: realloc (vg_replace_malloc.c:429) > +==15074== by 0x8084B28: xrealloc (xmalloc.c:57) > +==15074== by 0x806B2BD: xnrealloc (xalloc.h:136) > +==15074== by 0x806B266: variant_table_grow (scan-code.l:348) > +==15074== by 0x806B380: variant_add (scan-code.l:380) > +==15074== by 0x806B729: parse_ref (scan-code.l:478) > +==15074== by 0x806C7FE: handle_action_dollar (scan-code.l:653) > +==15074== by 0x8068AE6: code_lex (scan-code.l:185) > +==15074== by 0x806CF9B: translate_action (scan-code.l:785) > +==15074== by 0x806D1B8: code_props_translate_code (scan-code.l:854) > +==15074== by 0x8066150: reader (reader.c:704) > +==15074== > +==15074== > +==15074== 392 bytes in 14 blocks are definitely lost in loss record 2 of > 2 > +==15074== at 0x4022AB8: malloc (vg_replace_malloc.c:207) > +==15074== by 0x8084BA1: xmalloc (xmalloc.c:45) > +==15074== by 0x8056F15: named_ref_new (named-ref.c:28) > +==15074== by 0x806175B: gram_parse (parse-gram.y:556) > +==15074== by 0x8065E63: reader (reader.c:591) > +==15074== by 0x8053ACA: main (main.c:82) > 29. named-refs.at:20: FAILED (named-refs.at:189) > > -- Best regards, Alex Rozenman ([email protected]).
1e20ad112fc43f3d6adb3cc26be69ebffb14e9f6
Description: Binary data
