> $ valgrind /bin/ls
> ==18112== Memcheck, a memory error detector
> ==18112== Copyright (C) 2002-2010, and GNU GPL'd, by Julian Seward et al.
> ==18112== Using Valgrind-3.6.1 and LibVEX; rerun with -h for copyright info
> ==18112== Command: /bin/ls
> ==18112==
> Segmentation fault
>
> (Obviously, /bin/ls works when not executed through valgrind ;-)
As with any compiled binary program, run it under a debugger such as gdb
and display information at the time of signal:
$ gdb valgrind
(gdb) run /bin/ls ## add other command-line arguments here
[SIGSEGV]
(gdb) x/i $pc
(gdb) info reg
(gdb) x/12i $pc-0x20
(gdb) bt
(gdb) quit
Sometimes SIGSEGV is expected. So rather than 'quit', say 'continue'
and see if the continuation look reasonable.
Also as with any compiled binary program, the strace utility shows the
interaction with the operating system:
$ strace -f -o strace.out valgrind /bin/ls
Then look at the last few dozen lines of file strace.out.
The output from strace will show how many SIGSEGV were "intentional".
valgrind has some built-in debugging:
$ valgrind -d /bin/ls
Depending on what this shows, consider other debugging options that
are displayed by "valgrind --help-debug" which is hinted from
"valgrind --help".
As with all software, RTFM:
http://valgrind.org/docs/manual/manual.html
http://valgrind.org/support/bug_reports.html
which are linked from the very top level http://valgrind.org/
--
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users