|
From: Philippe W. <phi...@sk...> - 2012-11-05 21:47:00
|
On Mon, 2012-11-05 at 22:50 +0530, Uday Reddy wrote: > On Mon, Nov 5, 2012 at 9:06 PM, John Reiser <jr...@bi...> wrote: > >> ==14178== Invalid read of size 2 > >> ==14178== at 0x4A094C0: memcpy@@GLIBC_2.14 (mc_replace_strmem.c:653) > > > >> ==14178== Address 0x8b3256e is 750 bytes inside a block of size 40,704 alloc'd > >> ==14178== at 0x4A074CD: malloc (vg_replace_malloc.c:236) > >> ==14178== by 0x4A07657: realloc (vg_replace_malloc.c:525) > > > > Something peculiar is happening because of the realloc(). > > > > Re-run with --track-origins=yes. > > > > Re-run together with vgdb. Stop at this complaint, and use vgdb to print > > the status of the entire buffer. > > Thanks, but I didn't understand the last part. What exactly do I need > to run to "print the status of the entire buffer"? I'm running with > > --track-origins=yes --db-attach=yes > > my 'man valgrind' has no mention of vgdb. vgdb is only available from Valgrind version >= 3.7.0. => the best is to upgrade to the last version (3.8.1). With vgdb, you can connect gdb to the process under Valgrind and e.g. verify the addressability or definedness of your buffer using memcheck monitor commands. See http://www.valgrind.org/docs/manual/mc-manual.html#mc-manual.monitor-commands for more info about memcheck monitor commands. See http://www.valgrind.org/docs/manual/manual-core-adv.html#manual-core-adv.gdbserver * for more info about how to use gdb with your program under Valgrind. Philippe |