[Bug gdb/28480] pretty printing getting confused

jwakely.gcc at gmail dot com sourceware-bugzilla@sourceware.org
Thu Oct 21 00:49:13 GMT 2021


https://sourceware.org/bugzilla/show_bug.cgi?id=28480

--- Comment #2 from Jonathan Wakely <jwakely.gcc at gmail dot com> ---
$ valgrind /tmp/gdb/gdb/gdb -q -ex 'br 16' -ex r -ex 'p uptr' -ex qq /tmp/a.out
 | grep 'get() ='
==1770130== Memcheck, a memory error detector
==1770130== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1770130== Using Valgrind-3.18.1 and LibVEX; rerun with -h for copyright info
==1770130== Command: /tmp/gdb/gdb/gdb -q -ex br\ 16 -ex r -ex p\ uptr -ex qq
/tmp/a.out
==1770130== 
warning: linux_ptrace_test_ret_to_nx: WSTOPSIG 6 is neither SIGTRAP nor
SIGSEGV!
==1770130== Invalid read of size 1
==1770130==    at 0x484A2F0: memmove (vg_replace_strmem.c:1382)
==1770130==    by 0x76FE49: memcpy (string_fortified.h:29)
==1770130==    by 0x76FE49: value_contents_copy_raw(value*, long, value*, long,
long) (value.c:1330)
==1770130==    by 0x7735C0: value_primitive_field(value*, long, int, type*)
(value.c:3036)
==1770130==    by 0x764152: struct_field_searcher::search(value*, long, type*)
(valops.c:1901)
==1770130==    by 0x763E40: struct_field_searcher::search(value*, long, type*)
(valops.c:2002)
==1770130==    by 0x763E40: struct_field_searcher::search(value*, long, type*)
(valops.c:2002)
==1770130==    by 0x763E40: struct_field_searcher::search(value*, long, type*)
(valops.c:2002)
==1770130==    by 0x76423D: search_struct_field(char const*, value*, type*,
int) (valops.c:2023)
==1770130==    by 0x766CF0: value_struct_elt(value**, value**, char const*,
int*, char const*) (valops.c:2251)
==1770130==    by 0x67DDB6: valpy_getitem(_object*, _object*) (py-value.c:990)
==1770130==    by 0x497D836: _PyEval_EvalFrameDefault (ceval.c:2101)
==1770130==    by 0x497BE93: UnknownInlinedFun (pycore_ceval.h:46)
==1770130==    by 0x497BE93: _PyEval_Vector (ceval.c:5073)
==1770130==  Address 0x536a99f is 1 bytes before a block of size 8 alloc'd
==1770130==    at 0x4845464: calloc (vg_replace_malloc.c:1328)
==1770130==    by 0x456D60: xcalloc (alloc.c:100)
==1770130==    by 0x770986: allocate_value_contents (value.c:1022)
==1770130==    by 0x770986: allocate_value_contents (value.c:1016)
==1770130==    by 0x770986: allocate_value(type*) (value.c:1033)
==1770130==    by 0x77359B: value_primitive_field(value*, long, int, type*)
(value.c:3035)
==1770130==    by 0x764152: struct_field_searcher::search(value*, long, type*)
(valops.c:1901)
==1770130==    by 0x763E40: struct_field_searcher::search(value*, long, type*)
(valops.c:2002)
==1770130==    by 0x76423D: search_struct_field(char const*, value*, type*,
int) (valops.c:2023)
==1770130==    by 0x766CF0: value_struct_elt(value**, value**, char const*,
int*, char const*) (valops.c:2251)
==1770130==    by 0x67DDB6: valpy_getitem(_object*, _object*) (py-value.c:990)
==1770130==    by 0x497D836: _PyEval_EvalFrameDefault (ceval.c:2101)
==1770130==    by 0x497BE93: UnknownInlinedFun (pycore_ceval.h:46)
==1770130==    by 0x497BE93: _PyEval_Vector (ceval.c:5073)
==1770130==    by 0x4985890: UnknownInlinedFun (call.c:342)
==1770130==    by 0x4985890: _PyObject_FastCallDictTstate (call.c:142)
==1770130== 
$1 = std::unique_ptr<datum> = {get() = {<No data fields>}}
==1770130== 
==1770130== HEAP SUMMARY:
==1770130==     in use at exit: 18,182,520 bytes in 34,241 blocks
==1770130==   total heap usage: 259,945 allocs, 225,704 frees, 171,556,058
bytes allocated
==1770130== 
==1770130== LEAK SUMMARY:
==1770130==    definitely lost: 160 bytes in 3 blocks
==1770130==    indirectly lost: 0 bytes in 0 blocks
==1770130==      possibly lost: 446,388 bytes in 3,992 blocks
==1770130==    still reachable: 17,735,972 bytes in 30,246 blocks
==1770130==         suppressed: 0 bytes in 0 blocks
==1770130== Rerun with --leak-check=full to see details of leaked memory
==1770130== 
==1770130== For lists of detected and suppressed errors, rerun with: -s
==1770130== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Gdb-prs mailing list