This is the mail archive of the archer@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [python] Crash when using generators with Python 2.4


Paul Pluzhnikov wrote:
Here is what I see after 'git pull' and rebuild today:


Thanks, I'll look at the log in more detail. I'm kind of curious if we include the python suppression here:


http://svn.python.org/projects/python/trunk/Misc/valgrind-python.supp

if we could narrow down the number of leaks. My brief smoke test (attached output) with suppressions shows some areas of interest. It is by no means comprehensive, though.

Regards

Phil


[pmuldoon@localhost gdb]$ valgrind  --leak-check=full --suppressions=/home/pmuldoon/python.sup ./gdb ~/pretty-printers

==4089== Memcheck, a memory error detector.
==4089== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al.
==4089== Using LibVEX rev 1804, a library for dynamic binary translation.
==4089== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP.
==4089== Using valgrind-3.3.0, a dynamic binary instrumentation framework.
==4089== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al.
==4089== For more details, rerun with: -v
==4089== 
GNU gdb (GDB) 6.8.50.20090106-cvs
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/pmuldoon/pretty-printers...done.
Using host libthread_db library "/lib64/libthread_db.so.1".
Setting up the environment for debugging gdb.
Function "internal_error" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
Function "info_command" not defined.
Make breakpoint pending on future shared library load? (y or [n]) [answered N; input not from terminal]
/home/pmuldoon/archer_tromey_python/obj/gdb/.gdbinit:18: Error in sourced command file:
No breakpoint number 0.

(pg-gdb) b main
Reading in symbols for /home/pmuldoon/pretty-printers.cpp
Breakpoint 1 at 0x40134f: file /home/pmuldoon/pretty-printers.cpp, line 75.

(pg-gdb) r
Starting program: /home/pmuldoon/pretty-printers 

==4094== 
==4094== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 448 from 7)
==4094== malloc/free: in use at exit: 5,693,838 bytes in 7,349 blocks.
==4094== malloc/free: 22,215 allocs, 14,866 frees, 9,076,969 bytes allocated.
==4094== For counts of detected errors, rerun with: -v
==4094== searching for pointers to 7,349 not-freed blocks.
==4094== checked 5,242,808 bytes.
==4094== 
==4094== 1 bytes in 1 blocks are definitely lost in loss record 1 of 51
==4094==    at 0x4A05174: calloc (vg_replace_malloc.c:397)
==4094==    by 0x454C93: xcalloc (utils.c:1146)
==4094==    by 0x454BFA: xzalloc (utils.c:1110)
==4094==    by 0x4E0AD0: allocate_value_contents (value.c:270)
==4094==    by 0x4E0AFF: allocate_value (value.c:279)
==4094==    by 0x4E1873: create_internalvar (value.c:880)
==4094==    by 0x4E18F2: lookup_internalvar (value.c:904)
==4094==    by 0x4C89B3: set_breakpoint_count (breakpoint.c:340)
==4094==    by 0x4D04BD: create_breakpoint (breakpoint.c:5136)
==4094==    by 0x4D0BAC: create_breakpoints (breakpoint.c:5325)
==4094==    by 0x4D14BE: break_command_really (breakpoint.c:5625)
==4094==    by 0x4D1697: break_command_1 (breakpoint.c:5678)
==4094== 
==4094== 
==4094== 96 bytes in 2 blocks are definitely lost in loss record 14 of 51
==4094==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4094==    by 0x378C67132F: vasprintf (vasprintf.c:77)
==4094==    by 0x454F00: xstrvprintf (utils.c:1194)
==4094==    by 0x454DAF: xstrprintf (utils.c:1170)
==4094==    by 0x479FC6: add_packet_config_cmd (remote.c:865)
==4094==    by 0x4885AD: _initialize_remote (remote.c:9087)
==4094==    by 0x45B6CF: initialize_all_files (init.c:149)
==4094==    by 0x4536DF: gdb_init (top.c:1655)
==4094==    by 0x44A59D: captured_main (main.c:682)
==4094==    by 0x529748: catch_errors (exceptions.c:516)
==4094==    by 0x44AD8E: gdb_main (main.c:931)
==4094==    by 0x449A43: main (gdb.c:33)
==4094== 
==4094== 
==4094== 1,061 (1,030 direct, 31 indirect) bytes in 8 blocks are definitely lost in loss record 29 of 51
==4094==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4094==    by 0x454BC6: xmalloc (utils.c:1100)
==4094==    by 0x706A8D: xstrdup (xstrdup.c:34)
==4094==    by 0x4969BB: add_setshow_cmd_full (cli-decode.c:395)
==4094==    by 0x496C87: add_setshow_boolean_cmd (cli-decode.c:490)
==4094==    by 0x49D933: init_cli_cmds (cli-cmds.c:1331)
==4094==    by 0x4536E9: gdb_init (top.c:1657)
==4094==    by 0x44A59D: captured_main (main.c:682)
==4094==    by 0x529748: catch_errors (exceptions.c:516)
==4094==    by 0x44AD8E: gdb_main (main.c:931)
==4094==    by 0x449A43: main (gdb.c:33)
==4094== 
==4094== 
==4094== 3,926 bytes in 58 blocks are definitely lost in loss record 35 of 51
==4094==    at 0x4A074D1: realloc (vg_replace_malloc.c:429)
==4094==    by 0x378C6712D7: vasprintf (vasprintf.c:85)
==4094==    by 0x454F00: xstrvprintf (utils.c:1194)
==4094==    by 0x454DAF: xstrprintf (utils.c:1170)
==4094==    by 0x479FC6: add_packet_config_cmd (remote.c:865)
==4094==    by 0x48830A: _initialize_remote (remote.c:9005)
==4094==    by 0x45B6CF: initialize_all_files (init.c:149)
==4094==    by 0x4536DF: gdb_init (top.c:1655)
==4094==    by 0x44A59D: captured_main (main.c:682)
==4094==    by 0x529748: catch_errors (exceptions.c:516)
==4094==    by 0x44AD8E: gdb_main (main.c:931)
==4094==    by 0x449A43: main (gdb.c:33)
==4094== 
==4094== 
==4094== 17,336 bytes in 39 blocks are possibly lost in loss record 41 of 51
==4094==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4094==    by 0x4D1A299: _PyObject_GC_Malloc (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D1A38D: _PyObject_GC_NewVar (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4C8BDC8: PyFrame_New (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4CF0E14: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4CF1864: PyEval_EvalCodeEx (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4CF1AA1: PyEval_EvalCode (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D03DBF: PyImport_ExecCodeModuleEx (in /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D04047: (within /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D05738: (within /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D059D1: (within /usr/lib64/libpython2.5.so.1.0)
==4094==    by 0x4D0601E: (within /usr/lib64/libpython2.5.so.1.0)
==4094== 
==4094== LEAK SUMMARY:
==4094==    definitely lost: 5,053 bytes in 69 blocks.
==4094==    indirectly lost: 31 bytes in 1 blocks.
==4094==      possibly lost: 17,336 bytes in 39 blocks.
==4094==    still reachable: 5,671,418 bytes in 7,240 blocks.
==4094==         suppressed: 0 bytes in 0 blocks.
==4094== Reachable blocks (those to which a pointer was found) are not shown.
==4094== To see them, rerun with: --leak-check=full --show-reachable=yes

Breakpoint 1, main () at /home/pmuldoon/pretty-printers.cpp:75
75	  somebits[0] = 1;

(pg-gdb) b 105
Breakpoint 2 at 0x40167b: file /home/pmuldoon/pretty-printers.cpp, line 105.

(pg-gdb) r
(pg-gdb) c
Continuing.

Breakpoint 2, main () at /home/pmuldoon/pretty-printers.cpp:105
105	  vvv.push_back ("liver");

(pg-gdb) python import gdb.libstdcxx.v6.printers
(pg-gdb) p ddd

$1 = std::deque with 3 elements = {18, 23, 7}

(pg-gdb) p str
$2 = "maude"

(pg-gdb) p ref
$3 = "maude"

(pg-gdb) p vvv
$4 = std::vector of length 1, capacity 1 = {0x408c55 "maude"}

(pg-gdb) p val
$5 = {
  x = empty std::list, 
  y = empty __gnu_cxx::slist, 
  intset = std::set with 0 elements, 
  uoset = std::tr1::unordered_set with 0 elements, 
  s = "maude"
}
(pg-gdb) quit

The program is running.  Quit anyway (and kill it)? (y or n) y
==4089== 
==4089== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 523 from 7)
==4089== malloc/free: in use at exit: 11,122,191 bytes in 8,600 blocks.
==4089== malloc/free: 32,902 allocs, 24,302 frees, 18,945,496 bytes allocated.
==4089== For counts of detected errors, rerun with: -v
==4089== searching for pointers to 8,600 not-freed blocks.
==4089== checked 10,167,848 bytes.
==4089== 
==4089== 5 bytes in 2 blocks are definitely lost in loss record 1 of 58
==4089==    at 0x4A05174: calloc (vg_replace_malloc.c:397)
==4089==    by 0x454C93: xcalloc (utils.c:1146)
==4089==    by 0x454BFA: xzalloc (utils.c:1110)
==4089==    by 0x4E0AD0: allocate_value_contents (value.c:270)
==4089==    by 0x4E0AFF: allocate_value (value.c:279)
==4089==    by 0x4E1873: create_internalvar (value.c:880)
==4089==    by 0x4E18F2: lookup_internalvar (value.c:904)
==4089==    by 0x4C89B3: set_breakpoint_count (breakpoint.c:340)
==4089==    by 0x4D04BD: create_breakpoint (breakpoint.c:5136)
==4089==    by 0x4D0BAC: create_breakpoints (breakpoint.c:5325)
==4089==    by 0x4D14BE: break_command_really (breakpoint.c:5625)
==4089==    by 0x4D1697: break_command_1 (breakpoint.c:5678)
==4089== 
==4089== 
==4089== 96 bytes in 2 blocks are definitely lost in loss record 13 of 58
==4089==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4089==    by 0x378C67132F: vasprintf (vasprintf.c:77)
==4089==    by 0x454F00: xstrvprintf (utils.c:1194)
==4089==    by 0x454DAF: xstrprintf (utils.c:1170)
==4089==    by 0x479FC6: add_packet_config_cmd (remote.c:865)
==4089==    by 0x4885AD: _initialize_remote (remote.c:9087)
==4089==    by 0x45B6CF: initialize_all_files (init.c:149)
==4089==    by 0x4536DF: gdb_init (top.c:1655)
==4089==    by 0x44A59D: captured_main (main.c:682)
==4089==    by 0x529748: catch_errors (exceptions.c:516)
==4089==    by 0x44AD8E: gdb_main (main.c:931)
==4089==    by 0x449A43: main (gdb.c:33)
==4089== 
==4089== 
==4089== 480 bytes in 12 blocks are definitely lost in loss record 24 of 58
==4089==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4089==    by 0x454C3E: xrealloc (utils.c:1126)
==4089==    by 0x5AC1D8: vec_o_reserve (vec.c:100)
==4089==    by 0x5AC180: vec_p_reserve (vec.c:83)
==4089==    by 0x4D4150: VEC_bp_location_p_reserve (breakpoint.h:341)
==4089==    by 0x4D40E1: VEC_bp_location_p_safe_push (breakpoint.h:341)
==4089==    by 0x4D3DE7: update_global_location_list (breakpoint.c:6899)
==4089==    by 0x4D4BA9: update_breakpoint_locations (breakpoint.c:7362)
==4089==    by 0x4D4EE4: breakpoint_re_set_one (breakpoint.c:7454)
==4089==    by 0x529748: catch_errors (exceptions.c:516)
==4089==    by 0x4D4FB3: breakpoint_re_set (breakpoint.c:7546)
==4089==    by 0x50571E: new_symfile_objfile (symfile.c:924)
==4089== 
==4089== 
==4089== 624 bytes in 1 blocks are possibly lost in loss record 27 of 58
==4089==    at 0x4A074D1: realloc (vg_replace_malloc.c:429)
==4089==    by 0x4D19319: _PyObject_GC_Resize (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4C8BD7C: PyFrame_New (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF0E14: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF0E6C: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF0E6C: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF1864: PyEval_EvalCodeEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CEFFDB: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF1864: PyEval_EvalCodeEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CEFFDB: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF1864: PyEval_EvalCodeEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CEFFDB: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089== 
==4089== 
==4089== 3,050 (1,881 direct, 1,169 indirect) bytes in 30 blocks are definitely lost in loss record 37 of 58
==4089==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4089==    by 0x454BC6: xmalloc (utils.c:1100)
==4089==    by 0x706A8D: xstrdup (xstrdup.c:34)
==4089==    by 0x4969BB: add_setshow_cmd_full (cli-decode.c:395)
==4089==    by 0x496C87: add_setshow_boolean_cmd (cli-decode.c:490)
==4089==    by 0x49D933: init_cli_cmds (cli-cmds.c:1331)
==4089==    by 0x4536E9: gdb_init (top.c:1657)
==4089==    by 0x44A59D: captured_main (main.c:682)
==4089==    by 0x529748: catch_errors (exceptions.c:516)
==4089==    by 0x44AD8E: gdb_main (main.c:931)
==4089==    by 0x449A43: main (gdb.c:33)
==4089== 
==4089== 
==4089== 3,926 bytes in 58 blocks are definitely lost in loss record 39 of 58
==4089==    at 0x4A074D1: realloc (vg_replace_malloc.c:429)
==4089==    by 0x378C6712D7: vasprintf (vasprintf.c:85)
==4089==    by 0x454F00: xstrvprintf (utils.c:1194)
==4089==    by 0x454DAF: xstrprintf (utils.c:1170)
==4089==    by 0x479FC6: add_packet_config_cmd (remote.c:865)
==4089==    by 0x48830A: _initialize_remote (remote.c:9005)
==4089==    by 0x45B6CF: initialize_all_files (init.c:149)
==4089==    by 0x4536DF: gdb_init (top.c:1655)
==4089==    by 0x44A59D: captured_main (main.c:682)
==4089==    by 0x529748: catch_errors (exceptions.c:516)
==4089==    by 0x44AD8E: gdb_main (main.c:931)
==4089==    by 0x449A43: main (gdb.c:33)
==4089== 
==4089== 
==4089== 47,504 bytes in 101 blocks are possibly lost in loss record 48 of 58
==4089==    at 0x4A0739E: malloc (vg_replace_malloc.c:207)
==4089==    by 0x4D1A299: _PyObject_GC_Malloc (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D1A38D: _PyObject_GC_NewVar (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4C8BDC8: PyFrame_New (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF0E14: PyEval_EvalFrameEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF1864: PyEval_EvalCodeEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4CF1AA1: PyEval_EvalCode (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D03DBF: PyImport_ExecCodeModuleEx (in /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D04047: (within /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D05738: (within /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D059D1: (within /usr/lib64/libpython2.5.so.1.0)
==4089==    by 0x4D0601E: (within /usr/lib64/libpython2.5.so.1.0)
==4089== 
==4089== LEAK SUMMARY:
==4089==    definitely lost: 6,388 bytes in 104 blocks.
==4089==    indirectly lost: 1,169 bytes in 24 blocks.
==4089==      possibly lost: 48,128 bytes in 102 blocks.
==4089==    still reachable: 11,066,506 bytes in 8,370 blocks.
==4089==         suppressed: 0 bytes in 0 blocks.
==4089== Reachable blocks (those to which a pointer was found) are not shown.
==4089== To see them, rerun with: --leak-check=full --show-reachable=yes




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]