Skip to content

Instantly share code, notes, and snippets.

@dlovell
Last active December 26, 2015 10:19
Show Gist options
  • Save dlovell/7136227 to your computer and use it in GitHub Desktop.
Save dlovell/7136227 to your computer and use it in GitHub Desktop.
Valgrind with python issue
==30598== Memcheck, a memory error detector
==30598== Copyright (C) 2002-2011, and GNU GPL'd, by Julian Seward et al.
==30598== Using Valgrind-3.7.0 and LibVEX; rerun with -h for copyright info
==30598== Command: python -E -tt -c print\ "hello\ world"
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x4589F6: code_dealloc.9725 (in /usr/bin/python2.7)
==30598== by 0x52E7BF: load_source_module.39052 (in /usr/bin/python2.7)
==30598== by 0x52F19A: import_submodule.39106 (in /usr/bin/python2.7)
==30598== by 0x4C0522: load_next.39111 (in /usr/bin/python2.7)
==30598== by 0x52FA63: import_module_level.isra.3.39132 (in /usr/bin/python2.7)
==30598== by 0x4280AA: builtin___import__.32787 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x4F7AA5: PyEval_CallObjectWithKeywords (in /usr/bin/python2.7)
==30598== by 0x488DC2: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x4239F7: PyImport_ExecCodeModuleEx (in /usr/bin/python2.7)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x458B21: code_dealloc.9725 (in /usr/bin/python2.7)
==30598== by 0x548BA6: tupledealloc.24203 (in /usr/bin/python2.7)
==30598== by 0x458A19: code_dealloc.9725 (in /usr/bin/python2.7)
==30598== by 0x52E7BF: load_source_module.39052 (in /usr/bin/python2.7)
==30598== by 0x52F19A: import_submodule.39106 (in /usr/bin/python2.7)
==30598== by 0x4C0522: load_next.39111 (in /usr/bin/python2.7)
==30598== by 0x52FA63: import_module_level.isra.3.39132 (in /usr/bin/python2.7)
==30598== by 0x4280AA: builtin___import__.32787 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x4F7AA5: PyEval_CallObjectWithKeywords (in /usr/bin/python2.7)
==30598== by 0x488DC2: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x527444: _PyObject_GC_Resize (in /usr/bin/python2.7)
==30598== by 0x4C514F: PyFrame_New (in /usr/bin/python2.7)
==30598== by 0x486DAB: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== Address 0x67fa020 is 176 bytes inside a block of size 200 free'd
==30598== at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x45FE46: listextend.16657 (in /usr/bin/python2.7)
==30598== by 0x486D45: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598==
==30598== Conditional jump or move depends on uninitialised value(s)
==30598== at 0x549D02: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x527444: _PyObject_GC_Resize (in /usr/bin/python2.7)
==30598== by 0x4C514F: PyFrame_New (in /usr/bin/python2.7)
==30598== by 0x486DAB: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x549D1A: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x527444: _PyObject_GC_Resize (in /usr/bin/python2.7)
==30598== by 0x4C514F: PyFrame_New (in /usr/bin/python2.7)
==30598== by 0x486DAB: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x50683E: _PyString_Resize (in /usr/bin/python2.7)
==30598== by 0x506BB0: PyString_FromFormatV (in /usr/bin/python2.7)
==30598== by 0x5071BE: PyErr_Format (in /usr/bin/python2.7)
==30598== by 0x453601: PyInt_FromString (in /usr/bin/python2.7)
==30598== by 0x454AD0: PyNumber_Int (in /usr/bin/python2.7)
==30598== by 0x4E83B2: int_new.15710 (in /usr/bin/python2.7)
==30598== by 0x50C037: type_call.25261 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x486C69: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== Address 0x681b020 is 672 bytes inside a block of size 839 free'd
==30598== at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x50683E: _PyString_Resize (in /usr/bin/python2.7)
==30598== by 0x5115EF: PyString_Repr (in /usr/bin/python2.7)
==30598== by 0x46C044: PyObject_Repr (in /usr/bin/python2.7)
==30598== by 0x4535BE: PyInt_FromString (in /usr/bin/python2.7)
==30598== by 0x454AD0: PyNumber_Int (in /usr/bin/python2.7)
==30598== by 0x4E83B2: int_new.15710 (in /usr/bin/python2.7)
==30598== by 0x50C037: type_call.25261 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x486C69: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x50683E: _PyString_Resize (in /usr/bin/python2.7)
==30598== by 0x5115EF: PyString_Repr (in /usr/bin/python2.7)
==30598== by 0x46C044: PyObject_Repr (in /usr/bin/python2.7)
==30598== by 0x4535BE: PyInt_FromString (in /usr/bin/python2.7)
==30598== by 0x454AD0: PyNumber_Int (in /usr/bin/python2.7)
==30598== by 0x4E83B2: int_new.15710 (in /usr/bin/python2.7)
==30598== by 0x50C037: type_call.25261 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x486C69: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== Address 0x6823020 is 640 bytes inside a block of size 1,104 free'd
==30598== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x473611: pattern_match.67902 (in /usr/bin/python2.7)
==30598== by 0x486613: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x50683E: _PyString_Resize (in /usr/bin/python2.7)
==30598== by 0x4E0A15: string_concatenate.33767 (in /usr/bin/python2.7)
==30598== by 0x48A28E: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== Address 0x6975020 is 688 bytes inside a block of size 719 free'd
==30598== at 0x4C2B7B2: realloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x50683E: _PyString_Resize (in /usr/bin/python2.7)
==30598== by 0x5115EF: PyString_Repr (in /usr/bin/python2.7)
==30598== by 0x46C044: PyObject_Repr (in /usr/bin/python2.7)
==30598== by 0x4535BE: PyInt_FromString (in /usr/bin/python2.7)
==30598== by 0x454AD0: PyNumber_Int (in /usr/bin/python2.7)
==30598== by 0x4E83B2: int_new.15710 (in /usr/bin/python2.7)
==30598== by 0x50C037: type_call.25261 (in /usr/bin/python2.7)
==30598== by 0x4F7495: PyObject_Call (in /usr/bin/python2.7)
==30598== by 0x486C69: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Conditional jump or move depends on uninitialised value(s)
==30598== at 0x549D02: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x54A8F4: PyNode_AddChild (in /usr/bin/python2.7)
==30598== by 0x54AB12: PyParser_AddToken (in /usr/bin/python2.7)
==30598== by 0x52E045: parsetok.2431 (in /usr/bin/python2.7)
==30598== by 0x4861F2: PyParser_ASTFromString (in /usr/bin/python2.7)
==30598== by 0x48626E: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== by 0x48C337: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x549D1A: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x54A8F4: PyNode_AddChild (in /usr/bin/python2.7)
==30598== by 0x54AB12: PyParser_AddToken (in /usr/bin/python2.7)
==30598== by 0x52E045: parsetok.2431 (in /usr/bin/python2.7)
==30598== by 0x4861F2: PyParser_ASTFromString (in /usr/bin/python2.7)
==30598== by 0x48626E: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== by 0x48C337: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x5278B1: compiler_next_instr.isra.17.35188 (in /usr/bin/python2.7)
==30598== by 0x4D263B: compiler_addop_name.35279 (in /usr/bin/python2.7)
==30598== by 0x43B0F1: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x43A2B6: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x43AE7E: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x43AF89: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x43A2E7: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x4D6FA7: compiler_visit_stmt.35334.3297 (in /usr/bin/python2.7)
==30598== by 0x4D9C0F: compiler_body.part.28.35342.3289 (in /usr/bin/python2.7)
==30598== by 0x4D9DC2: PyAST_Compile (in /usr/bin/python2.7)
==30598== by 0x486286: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== Address 0x6c9a020 is 480 bytes inside a block of size 768 free'd
==30598== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x548767: dict_dealloc.18156 (in /usr/bin/python2.7)
==30598== by 0x468D99: analyze_block.44187 (in /usr/bin/python2.7)
==30598== by 0x4D5F61: PySymtable_Build (in /usr/bin/python2.7)
==30598== by 0x4D9D21: PyAST_Compile (in /usr/bin/python2.7)
==30598== by 0x486286: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== by 0x48C337: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Invalid read of size 4
==30598== at 0x549CF9: PyObject_Realloc.part.0.20647 (in /usr/bin/python2.7)
==30598== by 0x5278B1: compiler_next_instr.isra.17.35188 (in /usr/bin/python2.7)
==30598== by 0x4D236C: compiler_nameop.35269 (in /usr/bin/python2.7)
==30598== by 0x43A2E7: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x43A2E7: compiler_visit_expr.35297 (in /usr/bin/python2.7)
==30598== by 0x4D6FA7: compiler_visit_stmt.35334.3297 (in /usr/bin/python2.7)
==30598== by 0x4D9C0F: compiler_body.part.28.35342.3289 (in /usr/bin/python2.7)
==30598== by 0x4D9DC2: PyAST_Compile (in /usr/bin/python2.7)
==30598== by 0x486286: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== by 0x48C337: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== Address 0x6c9a020 is 480 bytes inside a block of size 768 free'd
==30598== at 0x4C2A82E: free (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==30598== by 0x548767: dict_dealloc.18156 (in /usr/bin/python2.7)
==30598== by 0x468D99: analyze_block.44187 (in /usr/bin/python2.7)
==30598== by 0x4D5F61: PySymtable_Build (in /usr/bin/python2.7)
==30598== by 0x4D9D21: PyAST_Compile (in /usr/bin/python2.7)
==30598== by 0x486286: PyRun_StringFlags (in /usr/bin/python2.7)
==30598== by 0x48C337: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x48D92F: PyEval_EvalCodeEx (in /usr/bin/python2.7)
==30598== by 0x486BB7: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598== by 0x486E01: PyEval_EvalFrameEx (in /usr/bin/python2.7)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x458B21: code_dealloc.9725 (in /usr/bin/python2.7)
==30598== by 0x477C54: func_dealloc.15050 (in /usr/bin/python2.7)
==30598== by 0x555D64: insertdict.18183 (in /usr/bin/python2.7)
==30598== by 0x4BEF08: PyDict_SetItem (in /usr/bin/python2.7)
==30598== by 0x44CA27: _PyModule_Clear (in /usr/bin/python2.7)
==30598== by 0x436806: PyImport_Cleanup (in /usr/bin/python2.7)
==30598== by 0x47EC4B: Py_Finalize (in /usr/bin/python2.7)
==30598== by 0x425B39: Py_Main (in /usr/bin/python2.7)
==30598== by 0x5FC376C: (below main) (libc-start.c:226)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x458B21: code_dealloc.9725 (in /usr/bin/python2.7)
==30598== by 0x477C54: func_dealloc.15050 (in /usr/bin/python2.7)
==30598== by 0x54878C: dict_dealloc.18156 (in /usr/bin/python2.7)
==30598== by 0x4588D1: class_dealloc.8529 (in /usr/bin/python2.7)
==30598== by 0x555D64: insertdict.18183 (in /usr/bin/python2.7)
==30598== by 0x4BEF08: PyDict_SetItem (in /usr/bin/python2.7)
==30598== by 0x44C9B8: _PyModule_Clear (in /usr/bin/python2.7)
==30598== by 0x436806: PyImport_Cleanup (in /usr/bin/python2.7)
==30598== by 0x47EC4B: Py_Finalize (in /usr/bin/python2.7)
==30598== by 0x425B39: Py_Main (in /usr/bin/python2.7)
==30598== by 0x5FC376C: (below main) (libc-start.c:226)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x54875C: dict_dealloc.18156 (in /usr/bin/python2.7)
==30598== by 0x5486DD: dict_dealloc.18156 (in /usr/bin/python2.7)
==30598== by 0x47EC74: Py_Finalize (in /usr/bin/python2.7)
==30598== by 0x425B39: Py_Main (in /usr/bin/python2.7)
==30598== by 0x5FC376C: (below main) (libc-start.c:226)
==30598==
==30598== Use of uninitialised value of size 8
==30598== at 0x579750: PyObject_Free (in /usr/bin/python2.7)
==30598== by 0x47EE78: Py_Finalize (in /usr/bin/python2.7)
==30598== by 0x425B39: Py_Main (in /usr/bin/python2.7)
==30598== by 0x5FC376C: (below main) (libc-start.c:226)
==30598==
==30598==
==30598== HEAP SUMMARY:
==30598== in use at exit: 1,537,499 bytes in 454 blocks
==30598== total heap usage: 7,477 allocs, 7,023 frees, 7,901,784 bytes allocated
==30598==
==30598== LEAK SUMMARY:
==30598== definitely lost: 0 bytes in 0 blocks
==30598== indirectly lost: 0 bytes in 0 blocks
==30598== possibly lost: 209,456 bytes in 36 blocks
==30598== still reachable: 1,328,043 bytes in 418 blocks
==30598== suppressed: 0 bytes in 0 blocks
==30598== Rerun with --leak-check=full to see details of leaked memory
==30598==
==30598== For counts of detected and suppressed errors, rerun with: -v
==30598== Use --track-origins=yes to see where uninitialised values come from
==30598== ERROR SUMMARY: 49 errors from 16 contexts (suppressed: 876 from 69)

Get a modified Valgrind suppressions file per SO with

wget http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp
perl -i.bak -pe 's/^###// if 127 <= $. and $. <= 162' valgrind-python.supp

Run Valgrind on a simple python program

valgrind --tool=memcheck --suppressions=valgrind-python.supp python -E -tt -c 'print "hello world"' >out 2>err

Observe that there are still a ton of errors (full err file is attached)

grep ERROR err

==30598== ERROR SUMMARY: 49 errors from 16 contexts (suppressed: 876 from 69)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment