]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
13 months agoAvoid dev/inode check on btrfs with --sanity-level=3 VALGRIND_3_23_BRANCH
Mark Wielaard [Thu, 4 Jul 2024 13:21:39 +0000 (15:21 +0200)] 
Avoid dev/inode check on btrfs with --sanity-level=3

With --sanity-level=3 or higher the aspacemgr sanity checks the
device/inode numbers from /proc/self/maps to the file stat
results. These don't match on btrfs. So detect when a file is on a
btrfs volume and ignore the check in that case.

https://bugs.kde.org/show_bug.cgi?id=317127
(cherry picked from commit 3b06d458ffc5cc8de8d701926e5d86979185fa04)

13 months agogdbserver_tests filters remove more verbose python rpm load warnings
Mark Wielaard [Thu, 4 Jul 2024 16:04:18 +0000 (18:04 +0200)] 
gdbserver_tests filters remove more verbose python rpm load warnings

The rpm python load warnings on Fedora became even more verbose.
Filter out all stderr messages related to them so tests don't fail.

(cherry picked from commit d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d)

13 months agoarm64: Fix fcvtas instruction.
Bernhard Übelacker [Thu, 27 Jun 2024 20:51:09 +0000 (22:51 +0200)] 
arm64: Fix fcvtas instruction.

(cherry picked from commit de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2)

13 months agoImplement VMOVQ xmm1, xmm2/m64
Mark Wielaard [Sun, 30 Jun 2024 18:17:32 +0000 (20:17 +0200)] 
Implement VMOVQ xmm1, xmm2/m64

We implemented the memory variant already, but not the reg variant.
Add a separate avx-vmovq testcase, because avx-1 is already really big.

https://bugs.kde.org/show_bug.cgi?id=391148
https://bugs.kde.org/show_bug.cgi?id=417572
https://bugs.kde.org/show_bug.cgi?id=489088

(cherry picked from commit 10a22445d747817932692b1c1ee3faa726121cb4)

13 months agogdbserver_tests filters remove python rpm module load warning
Mark Wielaard [Mon, 24 Jun 2024 12:56:37 +0000 (14:56 +0200)] 
gdbserver_tests filters remove python rpm module load warning

gdb on Fedora will warn not being able to load the rpm python module.
Unable to load 'rpm' module.  Please install the python3-rpm package.
Filter out that message so tests don't fail.

(cherry picked from commit d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef)

13 months agomips: skip using shared syscall numbers for mips64
Petar Jovanovic [Mon, 24 Jun 2024 10:33:46 +0000 (10:33 +0000)] 
mips: skip using shared syscall numbers for mips64

mips does not use shared syscall numbers, so we can not use
vki-scnums-shared-linux.h.

This fixes KDE #444781.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
(cherry picked from commit efaa17e53a750d5f0f4c138b507b1b104729ed67)

13 months agoDon't allow programs calling fnctl on valgrind's own file descriptors
Alexandra Hájková [Thu, 20 Jun 2024 11:45:56 +0000 (07:45 -0400)] 
Don't allow programs calling fnctl on valgrind's own file descriptors

Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64
and block syscalls with EBADF when the file descriptor isn't allowed
to be used by the program.

https://bugs.kde.org/show_bug.cgi?id=337388
(cherry picked from commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5)

13 months agoClose both internal pipe fds after VG_(fork) in parent and child
Mark Wielaard [Sun, 16 Jun 2024 22:27:12 +0000 (00:27 +0200)] 
Close both internal pipe fds after VG_(fork) in parent and child

An VG_fork() creates a pipe between parent and child to syncronize the
two processes. The parent wants to register the child pid before the
child can run. This is done in register_sigchld_ignore.

Make sure both the parent and the child close both the read and write
file descriptors so none leak.

https://bugs.kde.org/show_bug.cgi?id=479661
(cherry picked from commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160)

13 months agoDon't leave fds created with --log-file, --xml-file or --log-socket open
Mark Wielaard [Sun, 16 Jun 2024 19:23:08 +0000 (21:23 +0200)] 
Don't leave fds created with --log-file, --xml-file or --log-socket open

prepare_sink_fd and prepare_sink_socket will create a new file
descriptor for the output sink. finalize_sink_fd then copies the fd
to the safe range, so it doesn't conflict with any application fds.

If we created the original fd ourselves, it was a VgLogTo_File or
VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it.

Also close socket when connecting fails in VG_(connect_via_socket).

Add a testcase for --log-file and --xml-file which prints output to
/dev/stderr

https://bugs.kde.org/show_bug.cgi?id=202770
https://bugs.kde.org/show_bug.cgi?id=311655
https://bugs.kde.org/show_bug.cgi?id=488379

Co-authored-by: Alexandra Hájková <ahajkova@redhat.com
(cherry picked from commit fbd7596f8342f0b0fbbe088d960da839a8bdb839)

13 months agoBug 487439 - SIGILL in JDK11, JDK17
Paul Floyd [Sun, 16 Jun 2024 07:25:51 +0000 (09:25 +0200)] 
Bug 487439 - SIGILL in JDK11, JDK17

(cherry picked from commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0)

14 months agoLinux regtest: reallocarray needs malloc.h
Paul Floyd [Tue, 4 Jun 2024 10:49:33 +0000 (12:49 +0200)] 
Linux regtest: reallocarray needs malloc.h

Seen on Rocky 8.9

(cherry picked from commit a015ad2e0db40076b4841220c7ab6d6853798936)

14 months agoBug 453044 - gbserver_tests failures in aarch64
Jesus Checa [Sat, 25 May 2024 10:40:30 +0000 (12:40 +0200)] 
Bug 453044 - gbserver_tests failures in aarch64

(cherry picked from commit 790abdf7d3f3df0c968605b68ca765310689b7ce)

14 months agos390x: Minor fixes in extension-s390x.c
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
s390x: Minor fixes in extension-s390x.c

Some tracker names for registers are not consistent with the naming
scheme.  Also, there is a dead assignment to orig_addr2 and orig_len2.
Fix both.

(cherry picked from commit 76f2218924f85547f670969b1a0b59e5200e22ec)

14 months agoAvoid use of guest_IP_AT_SYSCALL in handle_extension()
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
Avoid use of guest_IP_AT_SYSCALL in handle_extension()

The guest state field guest_IP_AT_SYSCALL is referenced in
handle_extension(), even though it may not be defined by all
architectures.  Avoid its use altogether.

(cherry picked from commit 16249b21456d681b5d98400287b8dbd926050c75)

14 months agoFix uninitialized `err' in handle_extension()
Andreas Arnez [Wed, 15 May 2024 12:32:42 +0000 (14:32 +0200)] 
Fix uninitialized `err' in handle_extension()

In handle_extension(), in the case of a second return from SCHEDSETJMP the
variable `err' would be used uninitialized.  Fix this by avoiding any
access to `err' in this case.

(cherry picked from commit 94c2e5c6be23c6323f24deacdad5f98fb9f0b1c2)

14 months agomips: skip using shared syscall numbers for mips32
Aleksandar Rikalo [Fri, 10 May 2024 15:59:28 +0000 (17:59 +0200)] 
mips: skip using shared syscall numbers for mips32

mips does not use shared syscall numbers, so we can not use
vki-scnums-shared-linux.h.

This partially fixes KDE #444781.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Signed-off-by: Aleksandar Rikalo <arikalo@gmail.com>
(cherry picked from commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba)

14 months agoaarch64 frinta and frinta vector instructions
Paul Floyd [Thu, 9 May 2024 19:01:52 +0000 (21:01 +0200)] 
aarch64 frinta and frinta vector instructions

The initial fix for Bug 484426 only corrected frinta and frintn
scalar instructions. This adds support for the vector variants.

(cherry picked from commit 7b66a5b58219ac1a4865da8e371edbdb8d765f32)

14 months agoBug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table
Paul Floyd [Sat, 4 May 2024 13:03:11 +0000 (15:03 +0200)] 
Bug 486569 - linux inotify_init syscall wrapper missing POST entry in syscall_table

(cherry picked from commit b38115cc6087f30f872c533f93c7c31a6d73eb24)

14 months agoBug 486293 - memccpy false positives
Paul Floyd [Wed, 1 May 2024 07:24:14 +0000 (09:24 +0200)] 
Bug 486293 - memccpy false positives

(cherry picked from commit 805c020c6e5161966e6eb0099ebe937a510cea9e)

14 months ago486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'
Paul Floyd [Sat, 27 Apr 2024 11:07:07 +0000 (13:07 +0200)] 
486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL'

(cherry picked from commit 7214886886bce9029f325214156c02dcfff760d5)

15 months agoPrepare NEWS for branch 3.23 fixes
Mark Wielaard [Mon, 29 Apr 2024 13:15:46 +0000 (15:15 +0200)] 
Prepare NEWS for branch 3.23 fixes

15 months agoSet version to 3.23.1.GIT
Mark Wielaard [Mon, 29 Apr 2024 13:09:46 +0000 (15:09 +0200)] 
Set version to 3.23.1.GIT

15 months ago-> 3.23.0 final VALGRIND_3_23_0
Mark Wielaard [Fri, 26 Apr 2024 16:44:47 +0000 (18:44 +0200)] 
-> 3.23.0 final

15 months agoNEWS: Add new instruction support for arm64, amd64, s390x and x86
Mark Wielaard [Fri, 26 Apr 2024 15:03:49 +0000 (17:03 +0200)] 
NEWS: Add new instruction support for arm64, amd64, s390x and x86

15 months agoAdd various none/tests/ppc64 test binaries to .gitignore
Mark Wielaard [Fri, 26 Apr 2024 12:52:46 +0000 (14:52 +0200)] 
Add various none/tests/ppc64 test binaries to .gitignore

15 months agoAdd valgrind-*tar.gz and bz2 to .gitignore
Mark Wielaard [Fri, 26 Apr 2024 12:48:33 +0000 (14:48 +0200)] 
Add valgrind-*tar.gz and bz2 to .gitignore

They are generated by make distcheck.

15 months agoUse 32 bit (with space) in sized_aligned_new_delete_misaligned test supp
Mark Wielaard [Thu, 25 Apr 2024 20:11:29 +0000 (22:11 +0200)] 
Use 32 bit (with space) in sized_aligned_new_delete_misaligned test supp

To be consistent with the space used in the exp-32 test file and all
other supp names.

15 months agos390x: Add support for the `NNPA' instruction
Andreas Arnez [Thu, 25 Apr 2024 12:38:45 +0000 (14:38 +0200)] 
s390x: Add support for the `NNPA' instruction

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.

15 months agoSet version to 3.23.0-RC2
Mark Wielaard [Wed, 24 Apr 2024 22:45:49 +0000 (00:45 +0200)] 
Set version to 3.23.0-RC2

15 months agoglibc-2.X-helgrind.supp.in: Also recognize variants on gethostbyname2_r
Mark Wielaard [Wed, 24 Apr 2024 20:11:11 +0000 (22:11 +0200)] 
glibc-2.X-helgrind.supp.in: Also recognize variants on gethostbyname2_r

15 months agoFreeBSD syscall: add wrapper for kcmp
Paul Floyd [Wed, 24 Apr 2024 19:34:03 +0000 (21:34 +0200)] 
FreeBSD syscall: add wrapper for kcmp

For FreeBSD 15.0-CURRENT. Will need to add for 14.1 when it is out.
Mostly the same as the Linux kcmp syscall (small differences in the
supported types).

15 months agoAdd prereqs for tests using python 3.9+
Mark Wielaard [Wed, 24 Apr 2024 18:50:43 +0000 (20:50 +0200)] 
Add prereqs for tests using python 3.9+

Adds a script tests/python_test.sh that checks whether there is a python3
binary and that it supports python version 3.9 or higher. Use this script
in the various cachegrind/tests annotate vgtests as prereq.

15 months agoFreeBSD syswrap: wrong length for __sysctlbyname(name)
Paul Floyd [Wed, 24 Apr 2024 18:14:40 +0000 (20:14 +0200)] 
FreeBSD syswrap: wrong length for __sysctlbyname(name)

Copied and pasted from syscall where name is a pointer to array of ints
so the size has a '*sizeof(int)'. -byname name is a char* so should not
have the *4 factor.

From
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278566

15 months agoAdd new bar_bad exp files to drd/tests/Makefile.am (EXTRA_DIST).
Mark Wielaard [Wed, 24 Apr 2024 17:24:02 +0000 (19:24 +0200)] 
Add new bar_bad exp files to drd/tests/Makefile.am (EXTRA_DIST).

15 months agoAdd another drd/tests/bar_bad exp variant.
Mark Wielaard [Wed, 24 Apr 2024 16:42:42 +0000 (16:42 +0000)] 
Add another drd/tests/bar_bad exp variant.

An uninitialized barrier might not be recognized as a barrier at all.

15 months agos390x: Improve operand names in trackers for PRNO
Andreas Arnez [Tue, 23 Apr 2024 14:27:11 +0000 (16:27 +0200)] 
s390x: Improve operand names in trackers for PRNO

The operand names in the trackers called in the implementation of the PRNO
extension do not indicate the extension being handled.  Change this by
adding the name PRNO to all these names.

15 months agoAdd dl_new_hash suppression to drd/tests/std_thread2.supp
Mark Wielaard [Wed, 24 Apr 2024 14:00:44 +0000 (16:00 +0200)] 
Add dl_new_hash suppression to drd/tests/std_thread2.supp

_dl_lookup_symbol_x is already suppressed and normally _dl_new_hash
seems inlined, but on some systems it isn't.

15 months agoVG_(show_open_fds) Only emit empty line when not creating xml output
Mark Wielaard [Wed, 24 Apr 2024 11:20:34 +0000 (13:20 +0200)] 
VG_(show_open_fds) Only emit empty line when not creating xml output

The "empty" line containing '== pid == ' would corrupt the xml output
with --track-fds=yes.

15 months agoFilter away "main" differences in filter_fdleak
Mark Wielaard [Tue, 23 Apr 2024 12:14:33 +0000 (14:14 +0200)] 
Filter away "main" differences in filter_fdleak

Stack traces showing where fds were created show some differences in
the "main" function, different line numbers, or (in binary) or (below
main). Since the precise location of the original call in the main
function isn't the goal of these tests just filer them all out and
replace them with a simple "main".

15 months agofilter out in /absolute/path in drd/tests stderr filter
Mark Wielaard [Sat, 20 Apr 2024 20:56:05 +0000 (22:56 +0200)] 
filter out in /absolute/path in drd/tests stderr filter

This filters out a line like:
by 0x........: ??? (in /home/mjw/valgrind/helgrind/tests/tc04_free_lock)
and replaces it with
by 0x........: ???

15 months agoAdd new .exp-32 files to memcheck/tests/Makefile.am EXTRA_DIST
Mark Wielaard [Sat, 20 Apr 2024 19:58:09 +0000 (21:58 +0200)] 
Add new .exp-32 files to memcheck/tests/Makefile.am EXTRA_DIST

15 months ago32 bit new_delete_mismatch_size and sized_aligned_new_delete_misaligned .exp
Mark Wielaard [Sat, 20 Apr 2024 19:30:59 +0000 (21:30 +0200)] 
32 bit new_delete_mismatch_size and sized_aligned_new_delete_misaligned .exp

Add 32 bit variants of the memcheck/tests/new_delete_mismatch_size_supp,
memcheck/tests/sized_aligned_new_delete_misaligned{2,3}_supp .exp files.

15 months agoFreeBSD suppression: puts reachable
Paul Floyd [Sat, 20 Apr 2024 16:42:41 +0000 (18:42 +0200)] 
FreeBSD suppression: puts reachable

15 months agoFreeBSD suppressions: yet more reachables
Paul Floyd [Sat, 20 Apr 2024 06:29:51 +0000 (08:29 +0200)] 
FreeBSD suppressions: yet more reachables

15 months agoFreeBSD suppression: reachable for setlocale
Paul Floyd [Sat, 20 Apr 2024 05:54:05 +0000 (07:54 +0200)] 
FreeBSD suppression: reachable for setlocale

Normally I have LANG=en_GB.UTF-8 and LC_ALL=C but if I switch to
C.UTF-8 for everything (which is the default for a fresh install)
then setlocale comes into the picture with a reachable allocation
on exit.

15 months agoFreeBSD suppression: add a suppression for __swbuf seen on arm64
Paul Floyd [Sat, 20 Apr 2024 05:50:31 +0000 (07:50 +0200)] 
FreeBSD suppression: add a suppression for __swbuf seen on arm64

Still no libc freeres.

15 months agoSet version to 3.23.0-RC1
Mark Wielaard [Sat, 20 Apr 2024 01:40:29 +0000 (03:40 +0200)] 
Set version to 3.23.0-RC1

15 months agoUpdate emitted Copyright years to include 2024
Mark Wielaard [Sat, 20 Apr 2024 01:36:01 +0000 (03:36 +0200)] 
Update emitted Copyright years to include 2024

Also adjust test exp and filters.

15 months agocore errors suppression support
Mark Wielaard [Fri, 19 Apr 2024 20:46:11 +0000 (22:46 +0200)] 
core errors suppression support

Add two new functions core_get_extra_suppression_info and
core_get_error_name as alternatives for tool suppression callbacks.
These functions are used in gen_suppression.

Instead of a tool name, a core error component name is "CoreError".

Two new suppression kinds FdBadCloseSupp and FdNotClosedSupp
were added. Corresponding to the FdBadClose and FdNotClosed
error kinds.

core_error_matches_suppression matches these suppression kinds
with error kinds.

core_get_extra_suppression_info and core_print_extra_suppression_use
are noops for core errors.

is_suppressible_error, supp_matches_error, load_one_suppressions_file
and show_used_suppressions have been adjusted to work with core
error kinds.

A new function VG_(found_or_suppressed_errs) helps to not output
an empty error summary if only core errors are requested, but no
errors were detected.

VG_(clo_track_fds) has been moved from pub_core_options.h to
pub_tool_options.h. And VG_(needs_core_errors) now takes a Bool
that can be set to false in the tool post_clo_init handler. This
is used in the none tool to request core errors, but disable all
reporting if no option has been given that enables such errors.

This make sure only the none/tests/fdleak_ipv4.stderr.exp needs
adjustment. For all other tests the output is exactly as before.

https://bugs.kde.org/show_bug.cgi?id=485778

15 months agoFix const signedness issue in VG_(show_open_fds)
Mark Wielaard [Fri, 19 Apr 2024 14:59:25 +0000 (16:59 +0200)] 
Fix const signedness issue in VG_(show_open_fds)

The colon variable should be a const HChar.

15 months agoImprove file descriptor xml output, add fd and path elements
Alexandra Hájková [Thu, 18 Apr 2024 09:21:49 +0000 (05:21 -0400)] 
Improve file descriptor xml output, add fd and path elements

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>
15 months agoAdd core errors and use them to implement file descriptor tracker
Mark Wielaard [Wed, 20 Mar 2024 05:44:23 +0000 (01:44 -0400)] 
Add core errors and use them to implement file descriptor tracker

All the tool error callbacks now have a core error equivalent.
core errors are negative (while tool errors are positive).
There are two new ones for tracking issues with file descriptors.
FdBadClose (-2) and FdNotClosed (-3).

Add following core error functions with delegates to file descriptor
specific functions (implemented in syswrap-generic):

- core_eq_Error (fd_eq_Error)
  Compares core errors to detect duplicates
- core_before_pp_Error (fd_before_pp_Error)
  Currently prints nothing for known core errors and
  exists with FATAL for unknown core errors
- core_pp_Error (fd_pp_Error)
  For FdBadClose prints the backtraces for the file descriptor was
  opened, where it was originally closed and where it was closed again.
  For FdNotClosed prints where the file descriptor was opened.
- core_update_extra (fd_update_extra)
  Returns the size of the BadCloseExtra or FdNotClosedExtra struct
  which data needs to be saved (the fd number, pathname/description
  and previous backtraces).

We now accept the error (ExeContext) where to be NULL.
This is necessary for reporting not closed file descriptors when
the descriptor is inherited from the parent (so wasn't actually
created and doesn't have a 'where' in the current process code).

All the testcases still pass since the (stderr) output is the
same. But now they count as "real" errors. And so --error-exitcode
does now also work for file descriptor errors or leaks.

https://bugs.kde.org/show_bug.cgi?id=362680

Co-authored-by: Alexandra Hájková <ahajkova@redhat.com>
15 months agoAdd FreeBSD arm64 to README list of platforms
Paul Floyd [Thu, 18 Apr 2024 18:53:58 +0000 (20:53 +0200)] 
Add FreeBSD arm64 to README list of platforms

15 months agoDon't include pub_tool_tooliface.h in priv_types_n_macros.h
Mark Wielaard [Thu, 18 Apr 2024 15:45:16 +0000 (17:45 +0200)] 
Don't include pub_tool_tooliface.h in priv_types_n_macros.h

post-regtest-checks complains:
*** File coregrind/m_extension/priv_types_n_macros.h must not include pub_tool_tooliface.h

Which isn't really necessary anyway since priv_types_n_macros.h
already includes pub_core_tooliface.h.

15 months agoAdd pub_core_extension.h to coregrind/Makefile.am noinst_HEADERS
Mark Wielaard [Thu, 18 Apr 2024 13:58:37 +0000 (15:58 +0200)] 
Add pub_core_extension.h to coregrind/Makefile.am noinst_HEADERS

15 months agoAdd extension concept and exploit it for s390x `PRNO'
Andreas Arnez [Thu, 18 Apr 2024 11:49:52 +0000 (13:49 +0200)] 
Add extension concept and exploit it for s390x `PRNO'

z/Architecture specifies various "complex" machine instructions whose
register and memory effects cannot be expressed with Valgrind's current
mechanisms.

One example is the PPNO instruction -- "perform pseudorandom number
operation", whose main purpose is to generate a chunk of pseudorandom
data.  When doing so, it reads and writes a so-called "parameter block"
while also writing the variable-sized pseudorandom data itself.  These
memory effects cannot be adequately represented by the IRDirty concept.

Instead of using dirty helpers, a different approach is to treat such
instructions similar to syscalls, adding a new IRJumpKind for this
purpose.

This patch provides an implementation of this approach and an illustration
of its use at the example of PPNO (or its newer instantiation "PRNO").

15 months agos390x: Re-implement `vpdi' without intermediate updates
Andreas Arnez [Tue, 16 Apr 2024 15:24:47 +0000 (17:24 +0200)] 
s390x: Re-implement `vpdi' without intermediate updates

The vpdi instruction is implemented incorrectly for the case where the
result vector coincides with one of the input operands, because it
performs an intermediate update.  An example where this produces wrong
results is for

vpdi    %v3,%v3,%v3,4

where the instruction is used to swap the two halves of %v3.

Fix this by avoiding the intermediate update and using Iop_64HLtoV128
instead.

15 months agoBug 481874 - Add arm64 support for FreeBSD
Paul Floyd [Tue, 16 Apr 2024 05:39:33 +0000 (07:39 +0200)] 
Bug 481874 - Add arm64 support for FreeBSD

15 months agonon-linux regtest: update cmdline expecteds
Paul Floyd [Mon, 15 Apr 2024 05:18:42 +0000 (07:18 +0200)] 
non-linux regtest: update cmdline expecteds

15 months agoAdd Bug 481676 to NEWS
Paul Floyd [Mon, 15 Apr 2024 05:03:23 +0000 (07:03 +0200)] 
Add Bug 481676 to NEWS

Forgot I'd opened a bugzi for the problem.

15 months agoAdd @configure_input@ to all filer files generated by configure
Mark Wielaard [Sun, 14 Apr 2024 21:56:31 +0000 (23:56 +0200)] 
Add @configure_input@ to all filer files generated by configure

This will add a comment at the top of each filter file saying:

 filter_file.  Generated from filter_file.in by configure.

15 months agoMissing edit of filter_gdb.in
Philippe Waroquiers [Sun, 14 Apr 2024 20:54:49 +0000 (22:54 +0200)] 
Missing edit of filter_gdb.in

.exp files were updated to correspond to GDB 15,
filter_gdb being responsible to transform old GDB output to newly
expected output.

Sadly, I edited filter_gdb instead of filter_gdb.in

Tests should succeed again with older GDB.

15 months agoadd_hardwired_spec for ld-linux-x86-64.so.2 strcmp
Florian Weimer [Sun, 14 Apr 2024 19:56:03 +0000 (21:56 +0200)] 
add_hardwired_spec for ld-linux-x86-64.so.2 strcmp

glibc built with -march=x86-64-v3 does not work due to ld.so strcmp

https://bugs.kde.org/show_bug.cgi?id=485487

15 months agonightly/bin/nightly: Use grep -E instead of egrep
Mark Wielaard [Sun, 14 Apr 2024 19:42:12 +0000 (21:42 +0200)] 
nightly/bin/nightly: Use grep -E instead of egrep

15 months agoEnsure gdbserver tests work with a recent git version of GDB
Philippe Waroquiers [Sun, 14 Apr 2024 19:58:11 +0000 (21:58 +0200)] 
Ensure gdbserver tests work with a recent git version of GDB

Tested with GDB 12, 13, 14 and 15.0.50.20240414

15 months agoensure error output of vgdb relay mode is shown to the GDB user
Philippe Waroquiers [Sun, 14 Apr 2024 19:15:24 +0000 (21:15 +0200)] 
ensure error output of vgdb relay mode is shown to the GDB user

With GDB14.1, when there is more than one valgrind process, 'target remote | vgdb' shows:
  (gdb) tar rem | vgdb
  Remote debugging using | vgdb
  no --pid= arg given and multiple valgrind pids found:
  use --pid=913621 for ./Inst/bin/valgrind --vgdb-stop-at=startup ./gdbserver_tests/sleepers
  use --pid=913622 for ./Inst/bin/valgrind --vgdb-stop-at=startup ./gdbserver_tests/sleepers
  Remote communication error.  Target disconnected: Connection reset by peer.
  (gdb)

With GDB 15.0.50.20240414-git, we obtain:
  (gdb) tar rem | vgdb
  Remote debugging using | vgdb
  Remote communication error.  Target disconnected: error while reading: Connection reset by peer.
  (gdb)

This looks like a race condition:

When vgdb exits due to several pid or due to any other error (e.g. an argument
error), GDB gets a SIGPIPE and closes the pipe to/from vgdb.  To avoid losing
the error messages In such cases, have vgdb wait for the first packet from GDB
before exiting.

With this change, the early errors of vgdb are shown to the user.

Tested on debian, with GDB 12, 13, 15 and 15.0.50.20240414-git.

15 months agoBug 485148 - vfmadd213ss instruction is instrumented incorrectly (the remaining part...
Paul Floyd [Sun, 14 Apr 2024 15:59:30 +0000 (17:59 +0200)] 
Bug 485148 - vfmadd213ss instruction is instrumented incorrectly (the remaining part of the register is cleared instead of kept unmodified)

Initial version contributed by Bruno Lathuilière <bruno.lathuiliere@edf.fr>
Initial test contributed by Petr <kobalicek.petr@gmail.com>

15 months agoFreeBSD syscall: aio_error fails with EINVAL if the aiocb pointer is not accessible.
Paul Floyd [Sun, 14 Apr 2024 14:54:43 +0000 (16:54 +0200)] 
FreeBSD syscall: aio_error fails with EINVAL if the aiocb pointer is not accessible.

15 months agoAvoid format '%u' expect unsigned int warning
Philippe Waroquiers [Sun, 14 Apr 2024 14:28:37 +0000 (16:28 +0200)] 
Avoid format '%u' expect unsigned int warning

15 months agoFreeBSD regtest: fix for scalar sigaltstack
Paul Floyd [Sun, 14 Apr 2024 13:32:41 +0000 (15:32 +0200)] 
FreeBSD regtest: fix for scalar sigaltstack

I was lazy and using pointers to the same struct for the new and old
data (which isn't allowed, the new is 'restrict'). The current gets
copied to the old first so under Valgrind it worked. In the kernel
there are separate structs (which get copied in and copied out) and
it doesn't work.

Maybe we should consider changing VG_(do_sys_sigaltstack) to have at
least one local copy in order to behave like the kernel.

15 months agoAllow to see more details about suppressed errors.
Philippe Waroquiers [Sun, 14 Apr 2024 13:35:16 +0000 (15:35 +0200)] 
Allow to see more details about suppressed errors.

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.

15 months agoFreeBSD regtest: setcontext only reads the context
Paul Floyd [Sun, 14 Apr 2024 13:31:22 +0000 (15:31 +0200)] 
FreeBSD regtest: setcontext only reads the context

16 months agoIllumos: also has wcpncpy
Paul Floyd [Sat, 13 Apr 2024 19:35:49 +0000 (21:35 +0200)] 
Illumos: also has wcpncpy

16 months agoregtest arm64: add a test for frinta and frintn
Paul Floyd [Sat, 13 Apr 2024 16:19:25 +0000 (18:19 +0200)] 
regtest arm64: add a test for frinta and frintn

Round ties above 0 (frinta) and to even (frintn). Both only scalar.
Vector not yet implemented.

16 months agoUpdate NEWS for bug476025
Paul Floyd [Sat, 13 Apr 2024 14:39:24 +0000 (16:39 +0200)] 
Update NEWS for bug476025

16 months agoamd64: Implement VFMADD213 for Iop_MAddF32 and Iop_MAddF64
Mark Wielaard [Sat, 13 Apr 2024 12:33:19 +0000 (14:33 +0200)] 
amd64: Implement VFMADD213 for Iop_MAddF32 and Iop_MAddF64

Speed up F32 and F64 FMA on amd64. Add priv/host_amd64_maddf.c
implementing h_amd64_calc_MAddF32_fma4 and h_amd64_calc_MAddF64_fma4
to be used instead of the generic variants h_generic_calc_MAddF32
and h_generic_calc_MAddF64 when host has VEX_HWCAPS_AMD64_FMA4.
Add fma3 and fma4 detection m_machine.c (machine_get_hwcaps).

This patch also fixes the memcheck/tests/vcpu_fnfns and
none/tests/amd64/fma testcases when run on a x86-64-v3 system.

Patch contributed by Grazvydas Ignotas <notasas@gmail.com> and
Bruno Lathuilière <bruno.lathuiliere@edf.fr>

https://bugs.kde.org/show_bug.cgi?id=481127
https://bugs.kde.org/show_bug.cgi?id=463463
https://bugs.kde.org/show_bug.cgi?id=463458

16 months agoAdd gethostbyname2_r to glibc-2.X-helgrind.supp.in
Mark Wielaard [Sat, 13 Apr 2024 01:03:26 +0000 (03:03 +0200)] 
Add gethostbyname2_r to glibc-2.X-helgrind.supp.in

This fixes helgrind/tests/getaddrinfo with glibc-2.28 which might
use gethostbyname2_r.

16 months agoregtest arm64: fixes for arm64 clang, part 5
Paul Floyd [Fri, 12 Apr 2024 18:50:39 +0000 (20:50 +0200)] 
regtest arm64: fixes for arm64 clang, part 5

last one for now
clang assembler not accepting sqrdmlah v0.4h, v1.4h, v2.4h[0]
It wants sqrdmlah v0.4h, v1.4h, v2.h[0]

16 months agoregtest arm64: fixes for arm64 clang, part 4
Paul Floyd [Fri, 12 Apr 2024 18:43:18 +0000 (20:43 +0200)] 
regtest arm64: fixes for arm64 clang, part 4

clang assembler being picky about unneeded annotations such as
LSL #0 but then insisting on a .0 that gas infers.

16 months agoregtest arm64: fixes for arm64 clang, part 3
Paul Floyd [Fri, 12 Apr 2024 18:28:05 +0000 (20:28 +0200)] 
regtest arm64: fixes for arm64 clang, part 3

clang assembler refuses to accept scvtf with q regs where v regs
should be used (again the arm manual agrees).

16 months agoregtest arm64: fixes for arm64 clang, part 2
Paul Floyd [Fri, 12 Apr 2024 18:14:18 +0000 (20:14 +0200)] 
regtest arm64: fixes for arm64 clang, part 2

More clang moans about using int where long long is expected
Also clang assembler refuses to accept opcodes like sub x21,x22,x23,sxtb
According to the arm manual it is right and it should be
sub x21,x22,w23,sxtb.
I asked on the LLVM discourse and they said they preferred to be strict
and unambiguous.

16 months agoregtest arm64: fixes for arm64 clang, part 1
Paul Floyd [Fri, 12 Apr 2024 17:59:35 +0000 (19:59 +0200)] 
regtest arm64: fixes for arm64 clang, part 1

clang warns about using integers where long longs are expected.
Secondly a few of the tests read the executable text. clang uses
different registers than GCC which causes a diff. Hence another
expected. The tests are potentially flaky so if we see instability
we need to modify the test.

16 months agolinux arm64: fix build with clang
Paul Floyd [Fri, 12 Apr 2024 10:50:07 +0000 (12:50 +0200)] 
linux arm64: fix build with clang

Same issue as https://bugs.kde.org/show_bug.cgi?id=421321
but with clang.

16 months agoAdd new helgrind race suppression for pth_mempcpy_false_races
Mark Wielaard [Fri, 12 Apr 2024 13:18:51 +0000 (15:18 +0200)] 
Add new helgrind race suppression for pth_mempcpy_false_races

In glibc 2.39+ the internal __printf_buffer_write might use memmove
instead of a memcpy variant. Add an extra suppression variant using
memmove.

This makes pth_mempcpy_false_races pass again.

See also https://bugs.kde.org/show_bug.cgi?id=450962

16 months agoAdd support for expensive cmpgt into vbits
Eyal Soha [Wed, 25 Oct 2023 03:52:56 +0000 (21:52 -0600)] 
Add support for expensive cmpgt into vbits

16 months agoAdd __set_vma_name suppression to drd/tests/std_thread2.supp
Mark Wielaard [Thu, 11 Apr 2024 17:48:22 +0000 (19:48 +0200)] 
Add __set_vma_name suppression to drd/tests/std_thread2.supp

glibc uses a atomic var to set whether the kernel supports
PR_SET_VMA_ANON_NAME. This looks like a conflicting access to drd.
Suppress it for this testcase.

16 months agoAdd memcheck/tests/linux/capget.stderr.exp4 variant
Mark Wielaard [Thu, 11 Apr 2024 16:29:01 +0000 (18:29 +0200)] 
Add memcheck/tests/linux/capget.stderr.exp4 variant

Add an expect file for capget where the inheritable bits are set,
when run as root.

16 months agoFreeBSD Helgrind: suppression for libstdc++ std::mutex::lock()
Paul Floyd [Mon, 8 Apr 2024 18:43:10 +0000 (20:43 +0200)] 
FreeBSD Helgrind: suppression for libstdc++ std::mutex::lock()

16 months agoDon't call vg_assert inside sync_signalhandler_from_kernel
Mark Wielaard [Fri, 5 Apr 2024 13:23:32 +0000 (15:23 +0200)] 
Don't call vg_assert inside sync_signalhandler_from_kernel

Calling vg_assert inside a core signal handler will mess up the core
backtrace. Making it even harder to find bugs in the core.

16 months agoUpdate libiberty demangler
Mark Wielaard [Wed, 3 Apr 2024 21:13:02 +0000 (23:13 +0200)] 
Update libiberty demangler

Update the libiberty demangler using the auxprogs/update-demangler
script to gcc git commit ca2f7c84927f85b95f0f48f82b93f1460c372db4.

This update includes:

* c++: mangle noexcept-expr [PR70790]
* c++: Fix templated convertion operator demangling
* c++: constrained hidden friends [PR109751]
* c++: mangle function template constraints
* Update copyright years.
* c++, demangle: Implement
  https://github.com/itanium-cxx-abi/cxx-abi/issues/148
  non-proposal
* libiberty: Invoke D demangler when --format=auto

16 months agoregtest: Add arm64 dir to DIST_SUBDIR
Paul Floyd [Wed, 3 Apr 2024 18:03:29 +0000 (20:03 +0200)] 
regtest: Add arm64 dir to DIST_SUBDIR

New directory was missing in memcheck/tests/Makefile.am

16 months agoBug 484935 - [patch] Valgrind reports false "Conditional jump or move depends on...
Paul Floyd [Wed, 3 Apr 2024 06:32:12 +0000 (08:32 +0200)] 
Bug 484935 - [patch] Valgrind reports false "Conditional jump or move depends on uninitialised value" errors for aarch64 signal handlers

Patch contributed by Peter Edwards <peadar@arista.com>

Testcase modified and added to a new directory, memcheck/tests/arm64

16 months agolinux regtest: merge the two prereq lines in memcheck sys-preadv2_pwritev2.vgtest
Paul Floyd [Tue, 2 Apr 2024 17:15:47 +0000 (19:15 +0200)] 
linux regtest: merge the two prereq lines in memcheck sys-preadv2_pwritev2.vgtest

I think only the last one gets used.

16 months agoregtest: fixes for old GCC versions
Paul Floyd [Tue, 2 Apr 2024 11:36:31 +0000 (13:36 +0200)] 
regtest: fixes for old GCC versions

Seen on arm64 with GCC 4.8.2

16 months agoregtest: one last change to none fdleak filter for arm64 linux
Paul Floyd [Mon, 1 Apr 2024 18:06:32 +0000 (20:06 +0200)] 
regtest: one last change to none fdleak filter for arm64 linux

16 months agoregtest: another fdleak filter in none/tests
Paul Floyd [Mon, 1 Apr 2024 17:59:20 +0000 (19:59 +0200)] 
regtest: another fdleak filter in none/tests

16 months agoFreeBSD DRD and Helgrind: add sem_clockwait_np wrappers
Paul Floyd [Sun, 31 Mar 2024 16:04:04 +0000 (18:04 +0200)] 
FreeBSD DRD and Helgrind: add sem_clockwait_np wrappers

Helgrind wrapper was complicated because sem_wait calls
sem_clockwait_np.

16 months agoDarwin: fix warning about unused Helgrind sem_timedwait wrapper
Paul Floyd [Sun, 31 Mar 2024 09:23:49 +0000 (11:23 +0200)] 
Darwin: fix warning about unused Helgrind sem_timedwait wrapper

16 months agoBug 484480 - False positives when using sem_trywait
Paul Floyd [Sat, 30 Mar 2024 15:31:12 +0000 (16:31 +0100)] 
Bug 484480 - False positives when using sem_trywait

16 months agoSolaris regtest: fix build of none socket_close
Paul Floyd [Sat, 30 Mar 2024 14:16:55 +0000 (15:16 +0100)] 
Solaris regtest: fix build of none socket_close

Also add to filter_fdleak