Most of these changes are from Louis Brunner's GitHub repo.
The most imortant changes are to the memory space and to the code
related to getting the host filename during startup. This means
that when Valgrind crashes or hits an assert we now get a legible
host stacktrrace.
This also fixes none/tests/darwin/bug228343
The core error FdBadUse was added in commit 22971a15d6
"Report track-fd errors for fd used which was not opened or already closed"
But not documented. Add it to the protocol documentation now.
- Update COPYING and VEX/LICENSE.GPL to version 3.
- Update README, NEWS, docs/manual license and contributing text.
- Update file headers to say either version 3 of the License,
or (at your option) any later version.
- Leave tests and perf file headers as is, unless the code is derived
from Valgrind/VEX.
- Leave valgrind.h, cachegrind.h, callgrind.h, drd.h, helgrind.h,
memcheck.h and dhat.h Hybrid-BSD licensed.
Introduce Makefile variable BUILD_DOCS with these possible values:
none - does not build any documentation
all - builds all documentation
html - builds HTML docs but skips building PDFs
BUILD_ALL_DOCS is still recognised for backward compatibility and
is mapped to BUILD_DOCS like so:
If not specified --> BUILD_DOCS=all
BUILD_ALL_DOCS=yes --> BUILD_DOCS=all
BUILD_ALL_DOCS=no --> BUILD_DOCS=html
README_DEVELOPERS adjusted.
Fixes https://bugs.kde.org/show_bug.cgi?id=495483
When --track-fds=bad is specified, do not warn about
leaked file descriptors and only warn about file decriptors
which was not opened or already closed.
Update the documentation in docs/xml/manual-core.xml.
Add none/tests/track_bad test to test the new option.
Adjust none/tests/cmdline1 and none/tests/cmdline2 expected
outputs.
https://bugs.kde.org/show_bug.cgi?id=493434
Use --modify-fds=yes to restrict the option from affecting
the 0/1/2 file descriptors as they're often used for
stdin/tdout/stderr redirection.
The new possibility is named "yes" because "yes" is used
as the default in general. The default behaviour of the --modify-fds
option is then such, that highest available file descriptor is returned
execept when the lowest stdin/stdout/stderr (0, 1, 2) are available.
For example, if we want to redirect stdout to stderr by closing stdout
(file descriptor 1) and then calling dup (), file descriptor 1 will be
returned and not the highest number available. This is because the
following is a common pattern to redirect stdout to stderr:
close (1);
/* stdout becomes stderr */
ret = dup (2);
Add none/tests/track_yes.vgtest and none/tests/track_high.vgtest
tests to test --modify-fds=yes/high behave as expected.
https://bugs.kde.org/show_bug.cgi?id=502359
Normally a newly recreated file descriptor gets the lowest number
available. This might cause old file descriptor numbers to be reused
and hides bad file descriptor accesses (because the old number is
new again).
When enabled, when the program opens a new file descriptor,
the highest available file descriptor is returned instead of the
lowest one.
Add the none/tests/track_new.stderr.exp test to test this new option.
Adjust none/tests/filter_fdleak to filter the track_new.vgtest,
removing some internal glibc functions from the backtraces and remove
symbol versioning. The output of the use_after_close test also had to
be adjusted. Also adjust the none/tests/cmdline1 and
none/tests/cmdline2 output as the new --modify-fds=no|high is
displayed.
https://bugs.kde.org/show_bug.cgi?id=493433
The perform processor assist (PPA) instruction provides the CPU with
special execution hints. It belongs to the processor-assist facility,
which shares facility bit 49 with the execution-hint and load-and-trap
facilities and with the miscellaneous-instruction-extensions facility 1.
Implementing PPA enables setting facility bit 49 to one. Similar to other
execution hint instructions, implement PPA as a no-op for now.
After renaming various DFP instructions to their new name, reflect this in
s390-check-opcodes.pl by ignoring their old names, so the checker doesn't
complain about mismatches.
Also, add the missing documentation in s390-opcodes.csv about the fact
that the "with rounding mode" instruction versions cgdtra, cgxtra, and
cxgtra are implemented.
After consequently renaming ppno to prno, the tool s390-check-opcodes.pl
complains:
*** opcode prno is implemented but CSV file does not say so
*** opcode ppno is not implemented but CSV file says so
*** opcode ppno is not handled by the decoder
Fix this by renaming to "prno" in s390-opcodes.csv as well and declaring
"ppno" instead of "prno" as an alias in s390-check-opcodes.pl.
Add support for the branch prediction preload (BPP), branch prediction
relative preload (BPRP), and next instruction access intent (NIAI)
instructions. These instructions just provide performance hints to the
CPU and have no other effect on program execution. Thus implement them as
no-ops.
When XML_CATALOG_FILES don't exist on the system xmllint will have to
query those files through various websites. When there is a network
error xmllint will fail. So make sure to only run the validity tests
when both xmllint and XML_CATALOG_FILES exists.
Recent commits in Binutils added arch15 instructions to s390-opc.txt.
Since then, the script s390-check-opcodes.pl complains about many insns
that are not known to Valgrind.
Update Valgrind's instruction list to be in synch with Binutils again.
Add the new instructions to s390-opcodes.csv and declare them as "not
implemented".
Handle instructions that were added to z/Architecture with the
message-security assist (MSA) facility or with one of its extensions up to
MSA extension 9:
km -- ``cipher message''
kmc -- ``cipher message with chaining''
kimd -- ``compute intermediate message digest''
klmd -- ``compute last message digest''
kmac -- ``compute message authentication code''
kmf -- ``cipher message with cipher feedback''
kmctr -- ``cipher message with counter''
kmo -- ``cipher message with output feedback''
pcc -- ``perform cryptographic computation''
kma -- ``cipher message with authentication''
kdsa -- ``compute digital signature authentication''
Each of these instructions has multiple functions. Support all functions
described by MSA levels up to extension 9. Handle the instructions as
"extensions" and essentially forward them to the instructions themselves,
as long as they are available on the host.
Note that the MSA-3 instruction
pkcmo -- ``perform cryptographic key management operation''
will not be handled by this change, since it is privileged and should not
occur in user-space programs.
The MSA facilities are typically used by cryptographic libraries like
OpenSSL or openCryptoki. So far Valgrind suppresses the facility bits
indicating any MSA support, which causes such libraries to revert to a
software implementation.
This change enables running cryptographic applications under Valgrind
without reverting to an alternate code path.
So far the DFLTCC (deflate conversion call) instruction is not supported
by Valgrind. Similar to PRNO and NNPA, it is a "complex" instruction
whose memory effects cannot be adequately expressed with a dirty helper.
Add support for the DFLTCC instruction using the new "extension" mechanism
and reflect this accordingly in the supported facilities and HWCAPs.
Pick up some commits from valgrind-htdocs:
commit d97a1a24e
Fix description of memory xtree.
Was referring to function g2 which is not present in the screenshot.
Suggested by Fabien Launay on valgrind-developers.
commit bc2801d98
Fix a few "the the" usages.
One reported by Fabien Launay on valgrind-developers. The other
two found with grep. There's a fourth one, but it's in a patch
file so I've left it for now.
commit acc56391e
Consistent spelling of visualize(r)
Suggested by Fabien Launay on valgrind-developers
I checked my Shorter Oxford English Dictionary, and there it is
with a z. Good enough for me.
Finalize the NNPA facility support by handling the NNPA instruction
itself, using the new "extension" approach. Also reflect NNPA facility
support in HWCAP and in the STFLE bits.
Add needs_xml_output to none tool so it can also output xml when
--track-fds enabled.
Use xml protocolversion 5 when clo_track_fds is enabled
Split OpenFD pathname and description. Add description when a file
descriptor is closed so it can be used in a future error. On error
print <fd> element and (if known) a <path> element.
Add docs/internals/xml-output-protocol5.txt.
https://bugs.kde.org/show_bug.cgi?id=328563
Co-Authored-By: Mark Wielaard <mark@klomp.org>
Extend --show-error-list=no|yes with all to allow to look also the
list of suppressed errors and see which supp entry is suppressing it.
Add an option also_suppressed in the monitor command 'c.vinfo all_errors'
to similarly be able to show the suppressed errors.
Small fix in check_makefile_consistency: avoid it considers emacs ~ files.
List the instructions first introduced with z16 in s390-opcodes.csv. Also
mention the unimplemented ones in guest_s390_toIR.c and add new extended
mnemonics to the script s390-check-opcodes.pl. For ease of use, add
support for invoking the script without command line arguments.
Remove --launched-with-multi from --help-debug output since it is not
a real user option. Do add a comment in m_main.c explaining the
internal usage.
Add a top-level comment describing the three usages of vgdb.
Fix comment description of decode_hexstring, create_packet,
split_hexdecode.
Consistently use 3 space indention in send_packet and receive_packet
and next_delim_string and split_hexdecode, count_delims,
do_multi_mode.
Fix return type of count_delims to size_t.
Add a note in coregrind/m_gdbserver/server.c to sync qSupported
replies with coregrind/vgdb.c.
Use vgdb (all lowercase) and GDB (all caps) consistently in the
manual.
Executing vgdb --multi makes vgdb talk the gdb extended-remote
protocol. This means that the gdb run command is supported and
vgdb will start up the program under valgrind. Which means you
don't need to run gdb and valgrind from different terminals.
Also vgdb keeps being connected to gdb after valgrind exits. So
you can easily rerun the program with the same breakpoints in
place.
vgdb now implements a minimal gdbserver that just recognizes
a few extended-remote protocol packets. Once it starts up valgrind
it sets up noack and qsupported then it will forward packets
between gdb and valgrind gdbserver. After valgrind shutsdown it
resumes handling gdb packets itself.
https://bugs.kde.org/show_bug.cgi?id=434057
Co-authored-by: Mark Wielaard <mark@klomp.org>
Adds a new warning to memcheck when realloc is used with a size of 0.
For a long time this has been "implementation defined" and so
non-portable. With C23 it will become UB.
Also adds a switch to turn off the error generation and a
second switch to select between the most common
"implementation" behaviours. The defaults for this second
switch are baked in at build time.