On 02/19/2018 11:14 PM, John Reiser wrote:
Is there a way to get core when valgrind on invalid access? Am I
missing something?
If you are running valgrind interactively and valgrind reports an error,
then one of the error options is to invoke gdb. Gdb has a command:
generate-core-file <filename>
See the gdb manual which is available online in html.
Interesting. Shame on me for not knowing about the gdbserver thing!
I wonder what exactly does "interactively" mean here. I'm running it as
part of an automated regression test suite that starts postgres, and
executes a bunch of SQL scripts on it.
If I understand the docs correctly, this qualifies as interactive. I'll
try tweaking the scripts tomorrow to use the --vgdb options.
If you start valgrind with the option --vgdb-error=<number>
then you have a gdbserver process which provides *much better*
service than attaching gdb only at the point of error.
See the valgrind manual, or "valgrind --help" for a synopsis.
In either case the core file will include the pieces of valgrind
which are running in the same process [and address space]
as "your" program. So you might become confused while separating
what is "your" program from what is valgrind.
For practical purposes (shortest time to finding and fixing
the "first" error) it often is best to use the --vgdb-error=<number>
invocation, perhaps with --track-origins=yes. And yes, this
means you are allowed to [you must] watch and help.
I don't follow. Watch and help with what?
regards
Tomas
------------------------------------------------------------------------------
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