Hint #1.  Fix the first complaint.  Do not pass GO, do not collect $200.  FIX 
the first complaint.
You will get more sympathy and attention if the *first* significant event
is the bug/error/mystery that is the focus of your inquiry.

> ==3755== Mismatched free() / delete / delete []
> ==3755==    at 0x4C2CD3A: free (vg_replace_malloc.c:530)
> ==3755==    by 0x13EE71B3: bool
> google::protobuf::InsertIfNotPresent...

=====

> ishikawa@ip030:/NREF-COMM-CENTRAL/comm-central$ gdb /usr/local/bin/valgrind
   [[snip]]
> Program received signal SIGSEGV, Segmentation fault.
> 0x000000080470fdf8 in ?? ()
> (gdb) where
> #0  0x000000080470fdf8 in ?? ()
> #1  0x0000000802e8df30 in ?? ()
> #2  0x000000000010d76b in ?? ()
> #3  0x0000000802008460 in ?? ()
> #4  0x0000000802e8df30 in ?? ()
> #5  0x0000000000001c00 in ?? ()
> #6  0x0000000038c6bb00 in ?? ()
> #7  0x0000000000000601 in ?? ()
> #8  0x0000000000011af3 in ?? ()
> #9  0x0000000000000000 in ?? ()
> (gdb) quit
> A debugging session is active.

Hint #2.  Use gdb effectively.

(gdb) info reg   ## show all registers
(gdb) x/5i $pc   ## examine instruction stream
(gdb) x/30i $pc-0x20   ## likely previous instruction stream (heuristic sync 
for variable-length instructions)
(gdb) x/32xw $sp   ## examine memory at stack pointer
(gdb) info proc   ## display the process ID
(gdb) shell cat /proc/<PID>/maps   ## show memory mapping; <PID> is "process" 
from "info proc"


Hint #3.  If child processes are involved, then apply the tool to them, too.
$ valgrind --trace-children=yes ...

-- 


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to