Xiang Zhang added the comment: Valgrind can also complain:
valgrind --leak-check=yes --suppressions=Misc/valgrind-python.supp Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c ==6836== Memcheck, a memory error detector ==6836== Copyright (C) 2002-2015, and GNU GPL'd, by Julian Seward et al. ==6836== Using Valgrind-3.11.0 and LibVEX; rerun with -h for copyright info ==6836== Command: Parser/pgen ./Grammar/Grammar Include/graminit.h Python/graminit.c ==6836== Translating labels ... ==6836== ==6836== HEAP SUMMARY: ==6836== in use at exit: 18,236 bytes in 133 blocks ==6836== total heap usage: 848 allocs, 715 frees, 781,340 bytes allocated ==6836== ==6836== 6 bytes in 1 blocks are possibly lost in loss record 1 of 11 ==6836== at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x50E1379: strdup (strdup.c:42) ==6836== by 0x403405: _Py_addlabel (grammar.c:104) ==6836== by 0x403D40: newnfagrammar (pgen.c:116) ==6836== by 0x403E21: metacompile (pgen.c:158) ==6836== by 0x4056F1: _Py_pgen (pgen.c:668) ==6836== by 0x40CBE3: getgrammar (pgenmain.c:125) ==6836== by 0x40C932: main (pgenmain.c:64) ==6836== ==6836== 178 bytes in 33 blocks are possibly lost in loss record 2 of 11 ==6836== at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x403838: translabel (grammar.c:203) ==6836== by 0x40356A: _Py_translatelabels (grammar.c:147) ==6836== by 0x405711: _Py_pgen (pgen.c:670) ==6836== by 0x40CBE3: getgrammar (pgenmain.c:125) ==6836== by 0x40C932: main (pgenmain.c:64) ==6836== ==6836== 584 bytes in 1 blocks are possibly lost in loss record 3 of 11 ==6836== at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x405774: _PyMem_RawMalloc (obmalloc.c:83) ==6836== by 0x4076DE: _PyMem_DebugRawAlloc (obmalloc.c:1903) ==6836== by 0x4077CC: _PyMem_DebugRawMalloc (obmalloc.c:1926) ==6836== by 0x405EDF: PyMem_RawMalloc (obmalloc.c:396) ==6836== by 0x406D16: _PyObject_Alloc (obmalloc.c:1466) ==6836== by 0x407515: _PyObject_Realloc (obmalloc.c:1756) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x4030C6: _Py_addstate (grammar.c:55) ==6836== by 0x405497: convert (pgen.c:611) ==6836== ==6836== 640 bytes in 1 blocks are possibly lost in loss record 4 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x403B2A: addnfastate (pgen.c:52) ==6836== by 0x4047E5: compile_atom (pgen.c:300) ==6836== by 0x4045E9: compile_item (pgen.c:268) ==6836== by 0x40438D: compile_alt (pgen.c:237) ==6836== ==6836== 744 bytes in 1 blocks are definitely lost in loss record 5 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x403D8C: addnfa (pgen.c:126) ==6836== by 0x403F4E: compile_rule (pgen.c:178) ==6836== by 0x403E86: metacompile (pgen.c:164) ==6836== by 0x4056F1: _Py_pgen (pgen.c:668) ==6836== ==6836== 800 bytes in 1 blocks are possibly lost in loss record 6 of 11 ==6836== at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x405774: _PyMem_RawMalloc (obmalloc.c:83) ==6836== by 0x4076DE: _PyMem_DebugRawAlloc (obmalloc.c:1903) ==6836== by 0x407914: _PyMem_DebugRawRealloc (obmalloc.c:1971) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40631C: new_arena (obmalloc.c:1064) ==6836== by 0x4067FC: _PyObject_Alloc (obmalloc.c:1339) ==6836== by 0x406D66: _PyObject_Malloc (obmalloc.c:1476) ==6836== by 0x4076DE: _PyMem_DebugRawAlloc (obmalloc.c:1903) ==6836== by 0x4077CC: _PyMem_DebugRawMalloc (obmalloc.c:1926) ==6836== by 0x407B23: _PyMem_DebugMalloc (obmalloc.c:2028) ==6836== by 0x406179: PyObject_Malloc (obmalloc.c:489) ==6836== ==6836== 892 bytes in 85 blocks are possibly lost in loss record 7 of 11 ==6836== at 0x4C2BBCF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x50E1379: strdup (strdup.c:42) ==6836== by 0x40304A: _Py_adddfa (grammar.c:42) ==6836== by 0x405691: maketables (pgen.c:655) ==6836== by 0x405701: _Py_pgen (pgen.c:669) ==6836== by 0x40CBE3: getgrammar (pgenmain.c:125) ==6836== by 0x40C932: main (pgenmain.c:64) ==6836== ==6836== 2,272 bytes in 3 blocks are possibly lost in loss record 8 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x4030C6: _Py_addstate (grammar.c:55) ==6836== by 0x405497: convert (pgen.c:611) ==6836== by 0x404F7B: makedfa (pgen.c:489) ==6836== by 0x4056C0: maketables (pgen.c:656) ==6836== ==6836== 2,864 bytes in 1 blocks are possibly lost in loss record 9 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x4033AA: _Py_addlabel (grammar.c:98) ==6836== by 0x40480D: compile_atom (pgen.c:301) ==6836== by 0x4045E9: compile_item (pgen.c:268) ==6836== by 0x40433D: compile_alt (pgen.c:232) ==6836== ==6836== 3,464 bytes in 1 blocks are possibly lost in loss record 10 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x402FE4: _Py_adddfa (grammar.c:36) ==6836== by 0x405691: maketables (pgen.c:655) ==6836== by 0x405701: _Py_pgen (pgen.c:669) ==6836== by 0x40CBE3: getgrammar (pgenmain.c:125) ==6836== ==6836== 5,792 bytes in 5 blocks are possibly lost in loss record 11 of 11 ==6836== at 0x4C2DD9F: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==6836== by 0x4057F3: _PyMem_RawRealloc (obmalloc.c:105) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x405F70: PyMem_RawRealloc (obmalloc.c:414) ==6836== by 0x40756A: _PyObject_Realloc (obmalloc.c:1777) ==6836== by 0x407999: _PyMem_DebugRawRealloc (obmalloc.c:1986) ==6836== by 0x407BB2: _PyMem_DebugRealloc (obmalloc.c:2049) ==6836== by 0x40620A: PyObject_Realloc (obmalloc.c:507) ==6836== by 0x403B2A: addnfastate (pgen.c:52) ==6836== by 0x4047E5: compile_atom (pgen.c:300) ==6836== by 0x4045E9: compile_item (pgen.c:268) ==6836== by 0x40433D: compile_alt (pgen.c:232) ==6836== ==6836== LEAK SUMMARY: ==6836== definitely lost: 744 bytes in 1 blocks ==6836== indirectly lost: 0 bytes in 0 blocks ==6836== possibly lost: 17,492 bytes in 132 blocks ==6836== still reachable: 0 bytes in 0 blocks ==6836== suppressed: 0 bytes in 0 blocks ==6836== ==6836== For counts of detected and suppressed errors, rerun with: -v ==6836== ERROR SUMMARY: 11 errors from 11 contexts (suppressed: 484 from 2) ---------- nosy: +xiang.zhang _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27780> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com