]> sourceware.org Git - valgrind.git/log
valgrind.git
13 months agoDarwin: add missing define for VKI_AT_FDCWD
Paul Floyd [Mon, 20 Nov 2023 12:18:22 +0000 (13:18 +0100)]
Darwin: add missing define for VKI_AT_FDCWD

13 months agoBug 390269 - unhandled amd64-darwin syscall: unix:464 (openat_nocancel)
Paul Floyd [Mon, 20 Nov 2023 11:59:12 +0000 (12:59 +0100)]
Bug 390269 - unhandled amd64-darwin syscall: unix:464 (openat_nocancel)

Copied from https://github.com/LouisBrunner/valgrind-macos.git

Regtest to come shortly

13 months agoBug 428364 - Signals inside io_uring_enter not handled
Paul Floyd [Sat, 18 Nov 2023 12:02:30 +0000 (13:02 +0100)]
Bug 428364 - Signals inside io_uring_enter not handled

Patch provide by
    Andrew Soutar kdebugtraq@andrewsoutar.com
Thanks!

I haven't added the reproducers as they require interrupting
the Valgrind process. Maybe the tests can be adapted to use
fork and have the parent kill the child running io_uring.

13 months agolinux helgrind: broaden __printf_buffer_write suppression
Paul Floyd [Sat, 18 Nov 2023 10:34:09 +0000 (11:34 +0100)]
linux helgrind: broaden __printf_buffer_write suppression

On Fedora 39 pth_mempcpy_false_races was failing because
the callstack now has an extra inline and memcpy is versioned

13 months agoBug 466884 - Missing writev uninit padding suppression for _XSend
Paul Floyd [Sat, 18 Nov 2023 08:38:25 +0000 (09:38 +0100)]
Bug 466884 - Missing writev uninit padding suppression for _XSend

13 months agoBug 476548 - valgrind 3.22.0 fails on assertion when loading debuginfo file produced...
Paul Floyd [Sat, 18 Nov 2023 07:49:34 +0000 (08:49 +0100)]
Bug 476548 - valgrind 3.22.0 fails on assertion when loading debuginfo file produced by mold

13 months agoFreeBSD: make warnings about casting away volatile go away
Paul Floyd [Sat, 18 Nov 2023 07:30:56 +0000 (08:30 +0100)]
FreeBSD: make warnings about casting away volatile go away

13 months agofreebsd: unused variable warning
Paul Floyd [Sat, 18 Nov 2023 07:23:08 +0000 (08:23 +0100)]
freebsd: unused variable warning

still not sure what to do in aio_cancel

13 months agodarwin: syswrap-darwin.c warning cleanup
Paul Floyd [Sat, 18 Nov 2023 07:21:52 +0000 (08:21 +0100)]
darwin: syswrap-darwin.c warning cleanup

13 months agoDarwin: remove global variable used in aio_return
Paul Floyd [Sat, 18 Nov 2023 06:34:00 +0000 (07:34 +0100)]
Darwin: remove global variable used in aio_return

This was using a global variable to signify a read success
between pre- and post- aio_return. I don't think that this
was safe. There could be multiple calls to aio_return on
different threads. The global aiocpb_table is safe enough
as the pointers to control block are unique. However if two
threads manipulate was_a_successful_aio_read there's no way
of telling them apart. Rather than trying to make
was_a_successful_aio_read thread safe I did the same as on
FreeBSD and removed post- aio_return and now do everything
in pre- aio_return. No global variable, no thread hazard.

13 months agoFreeBSD regtest: unused variable warning
Paul Floyd [Sat, 18 Nov 2023 06:05:42 +0000 (07:05 +0100)]
FreeBSD regtest: unused variable warning

And ensure that the output string is always terminated.

13 months agosyswrap renameat2 on ppc32, mips32 and mips64 linux
Mark Wielaard [Sat, 18 Nov 2023 01:43:36 +0000 (02:43 +0100)]
syswrap renameat2 on ppc32, mips32 and mips64 linux

13 months agosyswrap preadv2 and pwritev2 also on ppc32-linux
Mark Wielaard [Sat, 18 Nov 2023 01:31:02 +0000 (02:31 +0100)]
syswrap preadv2 and pwritev2 also on ppc32-linux

13 months agos390x-linux also has memfd_secret, syswrap it
Mark Wielaard [Sat, 18 Nov 2023 01:23:10 +0000 (02:23 +0100)]
s390x-linux also has memfd_secret, syswrap it

13 months agosyswrap openat2 for all linux arches
Mark Wielaard [Sat, 18 Nov 2023 01:07:35 +0000 (02:07 +0100)]
syswrap openat2 for all linux arches

13 months agosupport pidfd_getfd
Ali Polatel [Wed, 18 Oct 2023 12:55:12 +0000 (12:55 +0000)]
support pidfd_getfd

Signed-off-by: Ali Polatel <alip@chesswob.org>
13 months agovalgrind-monitor.py regular expressions should use raw strings
Mark Wielaard [Fri, 17 Nov 2023 12:31:52 +0000 (13:31 +0100)]
valgrind-monitor.py regular expressions should use raw strings

With python 3.12 gdb will produce the following SyntaxWarning when
loading valgrind-monitor-def.py:

  /usr/share/gdb/auto-load/valgrind-monitor-def.py:214:
  SyntaxWarning: invalid escape sequence '\['
    if re.fullmatch("^0x[0123456789ABCDEFabcdef]+\[[^\[\]]+\]$", arg_str):

In a future python version this will become an SyntaxError.

Use a raw strings for the regular expression.

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

13 months agofreebsd regtest: update expected
Paul Floyd [Fri, 17 Nov 2023 07:04:14 +0000 (08:04 +0100)]
freebsd regtest: update expected

hadn't rebuilt the test exe after changes

13 months agoBug 476887 - WARNING: unhandled amd64-freebsd syscall: 578
Paul Floyd [Thu, 16 Nov 2023 20:33:33 +0000 (21:33 +0100)]
Bug 476887 - WARNING: unhandled amd64-freebsd syscall: 578

Adds syscall wrappers for aio_readv and aio_writev
Also rewrote the wrappers for aio_read, aio_write and aio_return
as they weren't correctly checking the async memory.

The code is similar th that of Darwin with one exception.
Darwin uses a global variable to communicate between the
pre- and post- aio_return wrappers. I don't think that is
safe when there are multiple aio reads in flight. Instead
I put everything in the pre- aio_return wrapper.

13 months agoFix memcheck/tests/darwin/Makefile.am EXTRA_DIST typo
Mark Wielaard [Tue, 14 Nov 2023 22:57:04 +0000 (23:57 +0100)]
Fix memcheck/tests/darwin/Makefile.am EXTRA_DIST typo

bug437790.stderr.out should have been bug437790.stdout.exp

13 months agoBug 437790 - valgrind reports "Conditional jump or move depends on uninitialised...
Paul Floyd [Tue, 14 Nov 2023 07:30:05 +0000 (08:30 +0100)]
Bug 437790 - valgrind reports "Conditional jump or move depends on uninitialised value" in memchr of macOS 10.12-10.15

13 months agolinux regtest: typo in EXTRA_DIST
Paul Floyd [Mon, 13 Nov 2023 12:33:26 +0000 (13:33 +0100)]
linux regtest: typo in EXTRA_DIST

13 months agoBug 476780 - Extend strlcat and strlcpy wrappers to GNU libc (part 2)
Paul Floyd [Sun, 12 Nov 2023 21:11:52 +0000 (22:11 +0100)]
Bug 476780 - Extend strlcat and strlcpy wrappers to GNU libc (part 2)

Linux regtest

13 months agoBug 476780 - Extend strlcat and strlcpy wrappers to GNU libc
Paul Floyd [Sun, 12 Nov 2023 17:07:52 +0000 (18:07 +0100)]
Bug 476780 - Extend strlcat and strlcpy wrappers to GNU libc

Will add Linux regtest soon

13 months agoBug 476787 - Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is defined
Paul Floyd [Fri, 10 Nov 2023 16:56:52 +0000 (17:56 +0100)]
Bug 476787 - Build of Valgrind 3.21.0 fails when SOLARIS_PT_SUNDWTRACE_THRP is defined

Patch provided by
   Jakub Kulik kulikjak@gmail.com

13 months agoBug 460616 - Add support for aarch64 dotprod instructions
William Ashley [Fri, 10 Nov 2023 16:51:12 +0000 (17:51 +0100)]
Bug 460616 - Add support for aarch64 dotprod instructions

This change adds support for the FEAT_DotProd instructions
SDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.4B[<index>]
SDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.<Tb>
UDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.4B[<index>]
UDOT <Vd>.<Ta>, <Vn>.<Tb>, <Vm>.<Tb>

13 months agoregtest: bug401284.c should never cast the return of malloc in C
Paul Floyd [Fri, 10 Nov 2023 06:39:00 +0000 (07:39 +0100)]
regtest: bug401284.c should never cast the return of malloc in C

13 months agofilter out dl-start.S: No such file or directory in gdbserver_tests
Mark Wielaard [Thu, 9 Nov 2023 22:42:37 +0000 (23:42 +0100)]
filter out dl-start.S: No such file or directory in gdbserver_tests

On some aarch64 GNU/Linux systems gdb will be unable to find the
dl-start.S file and complain. Filter out this message to make the
tests pass.

13 months agoBug 401284 - False positive "Source and destination overlap in strncat"
Paul Floyd [Thu, 9 Nov 2023 21:19:43 +0000 (22:19 +0100)]
Bug 401284 - False positive "Source and destination overlap in strncat"

Need to also look at strlcat and plain strcat.

13 months agoregtest: add a deliberately false address to drd and helgrind getaddrinfo
Paul Floyd [Thu, 9 Nov 2023 19:43:55 +0000 (20:43 +0100)]
regtest: add a deliberately false address to drd and helgrind getaddrinfo

Make sure that at least one call fails.

13 months agolinux regtest: reallocarray was only added in glibc 2.29
Paul Floyd [Thu, 9 Nov 2023 19:16:10 +0000 (20:16 +0100)]
linux regtest: reallocarray was only added in glibc 2.29

Add a feature check

13 months agoBug 475498 - Add reallocarray wrapper
Paul Floyd [Thu, 9 Nov 2023 06:58:02 +0000 (07:58 +0100)]
Bug 475498 - Add reallocarray wrapper

13 months agomassif regtest: add an existence check to overloaded-new
Paul Floyd [Mon, 6 Nov 2023 07:10:27 +0000 (08:10 +0100)]
massif regtest: add an existence check to overloaded-new

For old old compilers that don't have aligned new

13 months agomassif regtest: add 'pool' to ignore functions for Arch Linux
Paul Floyd [Sun, 5 Nov 2023 13:00:51 +0000 (13:00 +0000)]
massif regtest: add 'pool' to ignore functions for Arch Linux

13 months agomassif regtest: typo in Makefile.am
Paul Floyd [Sun, 5 Nov 2023 12:45:59 +0000 (13:45 +0100)]
massif regtest: typo in Makefile.am

13 months agoBug 476535 - Difference in allocation size for massif/tests/overloaded-new between...
Paul Floyd [Sun, 5 Nov 2023 12:35:01 +0000 (13:35 +0100)]
Bug 476535 - Difference in allocation size for massif/tests/overloaded-new between clang++/libc++ and g++/libstdc++

In the end all I could do was filter the results.

libc++ and libstdc++ allocate different sizes of stuff for their own usr.
That means that when we get to allocating aligned blocks there is some
slop (up to the alignment size) that gets counted. And the amount of
that slop depends on the prior (internal) allocations.

13 months agomassif regtest: stray space in expected
Paul Floyd [Sun, 5 Nov 2023 10:03:16 +0000 (11:03 +0100)]
massif regtest: stray space in expected

13 months agomassif regtest: make verbose tests work on both 32bit and 64bit
Paul Floyd [Sun, 5 Nov 2023 09:59:43 +0000 (10:59 +0100)]
massif regtest: make verbose tests work on both 32bit and 64bit

Now alloc fns only have the appropriate new overloads which
means 32bit has unsigned size but 64bit has unsigned long.
Filter the unsigned long to unsigned.

13 months agomassif regtest: update aloc fns in verbose expecteds
Paul Floyd [Sun, 5 Nov 2023 09:25:09 +0000 (10:25 +0100)]
massif regtest: update aloc fns in verbose expecteds

13 months agomassif regtest: try adding a new expected for overloaded-new
Paul Floyd [Sun, 5 Nov 2023 09:06:56 +0000 (09:06 +0000)]
massif regtest: try adding a new expected for overloaded-new

Added a filter for "pool" that's used on Arch Linux
I'm not too confident that the new expected will work for
all architectures or even versions of libstdc++

13 months agomassif: clean up alloc functions
Paul Floyd [Sun, 5 Nov 2023 08:30:18 +0000 (09:30 +0100)]
massif: clean up alloc functions

Missed out aligned_alloc
Left in the alignment argument name and didn't use east const for
nothrow.

13 months agomassif regtest: keep churning with overloaded-new test
Paul Floyd [Sat, 4 Nov 2023 15:35:05 +0000 (16:35 +0100)]
massif regtest: keep churning with overloaded-new test

Solaris 11.3 doesn't have aligned_alloc so remove it.

In any case I think it's better to use dummy allocators since
that means there is no risk of accidentally falling through
to malloc/free.

13 months agomassif regtest: use the correct aligned delete overloads
Paul Floyd [Sat, 4 Nov 2023 07:26:57 +0000 (08:26 +0100)]
massif regtest: use the correct aligned delete overloads

Still trying to see why libstdc++ and libc++ allocate different amounts

13 months agomassif regtest: remove overloaded-new.post.exp-freebsd
Paul Floyd [Fri, 3 Nov 2023 21:41:03 +0000 (22:41 +0100)]
massif regtest: remove overloaded-new.post.exp-freebsd

There was a duplicate at the end of the list

13 months agomassif regtest: fix building aligned new overloads with pre-C++17 compilers
Paul Floyd [Fri, 3 Nov 2023 21:23:26 +0000 (22:23 +0100)]
massif regtest: fix building aligned new overloads with pre-C++17 compilers

13 months agoFreeBSD: remove some massif regtest expecteds
Paul Floyd [Fri, 3 Nov 2023 20:46:13 +0000 (21:46 +0100)]
FreeBSD: remove some massif regtest expecteds

These were added mainly to have a cleanish slate with GCC on FreeBSD.
Unfortunately FreeBSD doesn't have dependent packages, so no debuginfo
for libstdc++ and the GCC port libstdc++ is stripped. That means that
the filters for internal GCC allocations don't work.

Since I hardly use GCC any more I'm getting rid of these expecteds.

13 months agomassif: add C++ aligned operator new to allocator functions
Paul Floyd [Fri, 3 Nov 2023 20:40:22 +0000 (21:40 +0100)]
massif: add C++ aligned operator new to allocator functions

Also make the unsigned (32bit) and unsigned long (64bit) for size_t
conditional on the wordsize.

13 months agoDo not run memcheck/tests/x86-linux/scalar when root
Mark Wielaard [Thu, 2 Nov 2023 18:50:07 +0000 (19:50 +0100)]
Do not run memcheck/tests/x86-linux/scalar when root

The test expects some syscalls to fail, but when run as root
the user actually has permission to do silly things. So skip
the test if we notice we are root.

13 months agoNon-FreeBSD regtest: fix build of memcheck/tests/x86/pcmpgt
Paul Floyd [Wed, 1 Nov 2023 19:20:38 +0000 (19:20 +0000)]
Non-FreeBSD regtest: fix build of memcheck/tests/x86/pcmpgt

As suggested by Mark Wielaard. It looks like AM conditionals
behave as though they have an implicit, empty, else.

13 months agoBug 476320 - Build failure with GCC
Paul Floyd [Wed, 1 Nov 2023 09:59:08 +0000 (10:59 +0100)]
Bug 476320 - Build failure with GCC

A few fixes for building regression tests with GCC on FreeBSD.

13 months agoUpdate version to 3.23.0.GIT, split NEWS files and create NEWS.older
Paul Floyd [Wed, 1 Nov 2023 09:56:39 +0000 (10:56 +0100)]
Update version to 3.23.0.GIT, split NEWS files and create NEWS.older

13 months ago-> 3.22.0 final VALGRIND_3_22_0
Mark Wielaard [Tue, 31 Oct 2023 17:19:05 +0000 (18:19 +0100)]
-> 3.22.0 final

13 months agoregtest: run memcheck overlap test on non-linux amd64 platforms
Paul Floyd [Tue, 31 Oct 2023 08:00:19 +0000 (09:00 +0100)]
regtest: run memcheck overlap test on non-linux amd64 platforms

13 months agoDisable memcpy overlap check and test on amd64 linux
Mark Wielaard [Mon, 30 Oct 2023 22:30:06 +0000 (23:30 +0100)]
Disable memcpy overlap check and test on amd64 linux

Almost all newer distros have ifunc based memcpy/memmove glibc
implementation which cause false positives. Disable the overlap check
and test on these systems for now.

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

13 months agoClear vbits after the test is done.
Eyal Soha [Mon, 30 Oct 2023 16:46:38 +0000 (10:46 -0600)]
Clear vbits after the test is done.

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

13 months agobug340392 doesn't work on power because of bug352364
Mark Wielaard [Mon, 30 Oct 2023 20:41:57 +0000 (21:41 +0100)]
bug340392 doesn't work on power because of bug352364

Add a prereq to bug340392.vgtest to skip on Power for now.

13 months agoSet version to 3.22.0-RC2
Mark Wielaard [Thu, 26 Oct 2023 12:33:16 +0000 (14:33 +0200)]
Set version to 3.22.0-RC2

13 months agos390x regtest: Activate 128 bit SIMD tests for s390x in vbit-test
Andreas Arnez [Thu, 26 Oct 2023 12:00:52 +0000 (14:00 +0200)]
s390x regtest: Activate 128 bit SIMD tests for s390x in vbit-test

The vbit-test test case is currently configured to exclude s390x from the
platforms that execute the 128 bit SIMD irop tests.  Since there's no
known issue with those, they can be activated on s390x as well.

13 months agoAdd new exp files to EXTRA_DIST in memcheck/tests/Makefile.am
Mark Wielaard [Thu, 26 Oct 2023 11:40:59 +0000 (13:40 +0200)]
Add new exp files to EXTRA_DIST in memcheck/tests/Makefile.am

13 months agoAdd x86 variant of origin5-bz2.stderr.exp-glibc25-amd64-b
Mark Wielaard [Thu, 26 Oct 2023 11:17:13 +0000 (13:17 +0200)]
Add x86 variant of origin5-bz2.stderr.exp-glibc25-amd64-b

This matches the expected output on newer fedora 32bit x86.

13 months agoAdd 32bit variant of new_aligned_delete_default.stderr.exp
Mark Wielaard [Thu, 26 Oct 2023 10:51:57 +0000 (12:51 +0200)]
Add 32bit variant of new_aligned_delete_default.stderr.exp

On 32bit architectures sized delete takes an unsigned int instead of
an unsigned long as first argument.

13 months agovg_replace_malloc DELETE should not check size
Mark Wielaard [Thu, 26 Oct 2023 10:25:44 +0000 (12:25 +0200)]
vg_replace_malloc DELETE should not check size

The DELETE replacement functions check the size argument, but this
doesn't actually exist.  Only the DELETE_SIZED replacement functions
get a size (and should check it).

On i386 (fedora gnu/linux) this causes the following failures:

memcheck/tests/cxx17_aligned_new         (stderr)
memcheck/tests/leak_cpp_interior         (stderr)
memcheck/tests/mismatches                (stderr)
memcheck/tests/mismatches_xml            (stderr)
memcheck/tests/new_aligned_delete_default (stderr)
memcheck/tests/new_nothrow               (stderr)
memcheck/tests/realloc_size_zero_mismatch (stderr)

All showing "size" being undefined:

+Conditional jump or move depends on uninitialised value(s)
+   at 0x........: ...operator delete[]... (vg_replace_malloc.c:...)

or

+Mismatched new/delete size value: 4
+   at 0x........: ...operator delete... (vg_replace_malloc.c:...)

Oddly no other architecture seems to show issues. Maybe we just got lucky?

This patch fixes the issues on i386 (and shows no regressions on x86_64)

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

14 months agoChange the vbit test specification for Iop_CmpGT64Ux2
Carl Love [Wed, 25 Oct 2023 15:20:30 +0000 (11:20 -0400)]
Change the vbit test specification for Iop_CmpGT64Ux2

The test should be specified as UNDEF_UNKNOWN not UNDEF_ALL_64x2.
No architectures should be enaabled for the test.

14 months agoRevert "Bug 476025 - Powerpc, update expected results for the vbit-test"
Carl Love [Tue, 24 Oct 2023 20:33:34 +0000 (16:33 -0400)]
Revert "Bug 476025 - Powerpc, update expected results for the vbit-test"

This reverts commit 5396fc8d0197e843657736ef8f7d9774400980c9.

The commited expect file is completely wrong.

14 months agoBug 476025 - Powerpc, update expected results for the vbit-test
Carl Love [Mon, 23 Oct 2023 23:15:00 +0000 (19:15 -0400)]
Bug 476025 - Powerpc, update expected results for the vbit-test

In commit:

  commit 26a3abd27db2ef63dafea1ecab00e8239f341f0f
  Author: Eyal Soha <eyalsoha@gmail.com>
  Date:   Thu Feb 10 09:52:54 2022 -0700

      Bug 432801 - Valgrind 3.16.1 reports a jump based on uninitialized
      memory somehow related to clang and signals

      Add support for precise computation of SIMD greater-than on
      amd64 and x86.

      This adds support for 64bit, 16bit, and 8bit to the existing 32bit
      support.

The Iop_CmpGT64Ux2 is only supported on PPC32 and PPC64.  The above
commit adds a more precise method, expensiveCmpGT, for setting the
vibits for the Iop_CmpGT64Ux2 Iop.

The expected results for the vbit test were not updated to the new more
precise results.  This patch updates the expected results for the Iop.

Patch tested on Power 10.

14 months agoAdd arm-linux build artifacts to .gitignore
Mark Wielaard [Thu, 19 Oct 2023 14:34:54 +0000 (16:34 +0200)]
Add arm-linux build artifacts to .gitignore

14 months agoAdd new drd/tests/thrd_create test to .gitignore
Mark Wielaard [Thu, 19 Oct 2023 14:26:34 +0000 (16:26 +0200)]
Add new drd/tests/thrd_create test to .gitignore

14 months agos390x: Adjust .gitignore after commit 7cf98163adb3f
Andreas Arnez [Thu, 19 Oct 2023 13:06:38 +0000 (15:06 +0200)]
s390x: Adjust .gitignore after commit 7cf98163adb3f

The executable of the new test case memcheck/tests/s390x/cli hasn't been
added to .gitignore yet.  Do this now.

14 months agoUpdate NEWS to reflect Clang support for s390x
Andreas Arnez [Thu, 19 Oct 2023 12:16:08 +0000 (14:16 +0200)]
Update NEWS to reflect Clang support for s390x

Small update in NEWS to reflect that Bug 465782 is fixed.

14 months agos390x regtest: Fix memcheck tests for cu21 and cu42 with Clang
Andreas Arnez [Thu, 19 Oct 2023 12:17:35 +0000 (14:17 +0200)]
s390x regtest: Fix memcheck tests for cu21 and cu42 with Clang

When compiled with Clang, the s390x memcheck tests for cu21 and cu42 yield
different line number information for the inline assemblies.  Using gcc,
the inline assemblies do not receive updated line number information
because they are phrased as if they were data, not code.  See also the
discussion in https://sourceware.org/bugzilla/show_bug.cgi?id=30206

Fix this by rephrasing the inline assemblies in cu21 and cu42 to normal
instructions, using the respective mnemonics.  Since this affects the line
number information, adjust the expected test output files as well.

14 months agos390x: Fix memcheck false positives with certain comparisons
Andreas Arnez [Tue, 16 May 2023 18:29:33 +0000 (20:29 +0200)]
s390x: Fix memcheck false positives with certain comparisons

Consider this structure definition:

  struct s {
    unsigned b : 1;
    unsigned c : 1;
  } x;

Then certain compiler optimizations for a big-endian system may transform
the test

  if (x.b || x.c)
     ...

into a comparison `> 0x3f' of the structure's first byte.  Indeed, the
result of this comparison only depends on the two highest bits of the
byte.  Thus, even if the lower bits are undefined, memcheck shouldn't
complain, but it does.

For certain cases this can be fixed.  Do this by detecting comparisons
like this in the condition code helper for S390_CC_OP_UNSIGNED_COMPARE and
transforming them to a test for the selected bits instead.  Add a small
test to verify the fix.

14 months agoSet version to 3.22.0-RC1
Mark Wielaard [Tue, 17 Oct 2023 22:28:45 +0000 (00:28 +0200)]
Set version to 3.22.0-RC1

14 months agoBug 475652 - Missing suppression for __wcsncpy_avx2 (strncpy-avx2.S:308)?
Paul Floyd [Mon, 16 Oct 2023 21:14:39 +0000 (23:14 +0200)]
Bug 475652 - Missing suppression for __wcsncpy_avx2 (strncpy-avx2.S:308)?

Adds a replace strmem wrapper for wcsncpy

Whilst doing this I noticed that

memcheck/tests/filter_memcheck

wasn't filtering memcheck/tests/freebsd/timingsafe properly.
That's because before filtering vg_replace_strmem.c and
vg_replace_malloc.c there's a check that the test exe filename
does not match the line. In this case the test exe was "timingsafe",
but line contained "timingsafe_memcmp", which matched leaving
vg_replace_strmem.c unfiltered. So I just renamed the testcase.

14 months agoconfigure.ac: Convert the thrd_create() test from C++ to C
Bart Van Assche [Mon, 16 Oct 2023 13:30:55 +0000 (06:30 -0700)]
configure.ac: Convert the thrd_create() test from C++ to C

14 months agodrd/tests/thrd_create: Convert from C++ to C
Bart Van Assche [Mon, 16 Oct 2023 13:21:03 +0000 (06:21 -0700)]
drd/tests/thrd_create: Convert from C++ to C

14 months agoFreeBSD regtest: add required library for C11 threads
Paul Floyd [Sun, 15 Oct 2023 18:42:29 +0000 (20:42 +0200)]
FreeBSD regtest: add required library for C11 threads

14 months agodrd: Add support for C11 thrd_create()
Bart Van Assche [Sun, 15 Oct 2023 14:36:33 +0000 (07:36 -0700)]
drd: Add support for C11 thrd_create()

14 months agoillumos: finish refactoring of DRD internal client requests.
Paul Floyd [Wed, 11 Oct 2023 06:38:43 +0000 (08:38 +0200)]
illumos: finish refactoring of DRD internal client requests.

14 months agomemcheck: add checking that new aligned is not deallocated by plain delete
Paul Floyd [Tue, 10 Oct 2023 22:01:40 +0000 (00:01 +0200)]
memcheck: add checking that new aligned is not deallocated by plain delete

14 months agomemcheck: Fix a typo in aligned alloc error suppression check
Paul Floyd [Tue, 10 Oct 2023 19:24:01 +0000 (21:24 +0200)]
memcheck: Fix a typo in aligned alloc error suppression check

Also update corresponding testcase

14 months agoDHAT: only handle own user reqs, ignore others
Paul Floyd [Mon, 9 Oct 2023 20:54:30 +0000 (22:54 +0200)]
DHAT: only handle own user reqs, ignore others

Make other tools consistent with this as well
(using memcheck as the model). Also refactored
the DRD user req names to make it clearer which
are Valgrind user reqs, which are DRD public
user reqs and which are DRD internal user reqs.

14 months agocoverity: last of the unsigned >= 0 warnings
Paul Floyd [Mon, 9 Oct 2023 06:10:01 +0000 (08:10 +0200)]
coverity: last of the unsigned >= 0 warnings

Also a bit of struct space saving thanks to pahole

14 months agoBug 390871 - ELF debug info reader confused with multiple .rodata* sections
Paul Floyd [Sat, 7 Oct 2023 14:02:24 +0000 (16:02 +0200)]
Bug 390871 - ELF debug info reader confused with multiple .rodata* sections

14 months agoRevert "Bug 390871 - ELF debug info reader confused with multiple .rodata* sections"
Paul Floyd [Sun, 8 Oct 2023 07:43:15 +0000 (09:43 +0200)]
Revert "Bug 390871 - ELF debug info reader confused with multiple .rodata* sections"

This reverts commit 5472a7a54000692f9f58e9b551d36b8c68c44873.

14 months agoBug 390871 - ELF debug info reader confused with multiple .rodata* sections
Jogn Reiser [Sat, 7 Oct 2023 14:02:24 +0000 (16:02 +0200)]
Bug 390871 - ELF debug info reader confused with multiple .rodata* sections

14 months agocoverity: most of the remaining unsigned comparisons >= 0 warnings
Paul Floyd [Sun, 8 Oct 2023 07:21:12 +0000 (09:21 +0200)]
coverity: most of the remaining unsigned comparisons >= 0 warnings

14 months agoMinor tweaks for Python tooling updates.
Nicholas Nethercote [Mon, 2 Oct 2023 21:11:42 +0000 (08:11 +1100)]
Minor tweaks for Python tooling updates.

Annoying that these are necessary, but that seems to be standard for
this stuff.

14 months agoImplement DW_OP_{bregx,consts,const8s,const8u,constu} in dwarfexpr_to_dag
Mark Wielaard [Sun, 1 Oct 2023 22:37:24 +0000 (00:37 +0200)]
Implement DW_OP_{bregx,consts,const8s,const8u,constu} in dwarfexpr_to_dag

readdwarf.c (dwarfexpr_to_dag) didn't hanle various DW_OP expressions
causing Warning: DWARF2 CFI reader: unhandled DW_OP_ opcode and errors
m_debuginfo/readdwarf.c:2822 (copy_convert_CfiExpr_tree): Assertion
'srcix >= 0 && srcix < VG_(sizeXA)(srcxa)' failed.

Implement DW_OP_bregx and DW_OP_consts as reported in bug #461074.
Also add implementations for DW_OP_const8s, DW_OP_const8u and
DW_OP constu.

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

14 months agocoverity: most of the remaining unsigned >= 0 comparison warnings
Paul Floyd [Sun, 1 Oct 2023 18:51:59 +0000 (20:51 +0200)]
coverity: most of the remaining unsigned >= 0 comparison warnings

14 months agocachegrind: exit with error if line size or associativity is zero
Paul Floyd [Sat, 30 Sep 2023 19:54:21 +0000 (21:54 +0200)]
cachegrind: exit with error if line size or associativity is zero

Detected with Coverity

14 months agocoverity: use some event tags and ensure some shift expression size promotion
Paul Floyd [Sat, 30 Sep 2023 15:35:54 +0000 (17:35 +0200)]
coverity: use some event tags and ensure some shift expression size promotion

The shifts are protected by tests so there was no risk.

14 months agocoverity: mostly unsigned >= 0 comparisons
Paul Floyd [Sat, 30 Sep 2023 14:34:45 +0000 (16:34 +0200)]
coverity: mostly unsigned >= 0 comparisons

14 months agocoverity: lots of checks that unsigned are >= 0 which is always true
Paul Floyd [Fri, 29 Sep 2023 20:45:32 +0000 (22:45 +0200)]
coverity: lots of checks that unsigned are >= 0 which is always true

Also put back the isFF flag initialization (used for FreeBSD
non-fixed RO ELF segmentd) . I had intended to delete it but
in the end kept it for traces but had already deleted the init code.

14 months agos390x: Make z16 machine model known to Valgrind
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x: Make z16 machine model known to Valgrind

The z16 machine model hasn't been fully introduced to Valgrind yet.  Add
the missing support:

* Add z16 to the list of machine models in each of `libvex.h',
  `tests/s390x_features.c', and `s390-check-opcodes.pl'.

* Starting with z16, the "store facility list extended" (STFLE)
  instruction can write four instead of three words.  Reflect this in the
  STFLE-helper and in the `stfle' test case.

* Pass the new STFLE-bits unchanged, except for the vector-packed-decimal
  facility, which is unsupported by Valgrind.

14 months agos390x regtest: Adjust vec2_float for Clang
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x regtest: Adjust vec2_float for Clang

The vec2_float test case doesn't compile with Clang, due to two issues:

* Clang doesn't correctly support `long double' vectors, as documented in
  this GitHub issue: https://github.com/llvm/llvm-project/issues/61291

* llvm-as behaves differently from gas for the reserved field in the
  `.insn vrr' directive.  Instead of inserting the given data from the
  first operand, it initializes the reserved field with zeros.

Circumvent these issues.

14 months agos390x regtest: Additional test case fixes
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x regtest: Additional test case fixes

While fixing Clang compilation issues, I noticed additional problematic
constructs in s390x test cases, some of which are uncovered with compiler
optimization options such as -O3:

* `bic.c' relies on an int to be sign-extended when passing it in a
  register to an inline-assembly.

* `cksm.c' clobbers a register in an inline assembly without specifying
  that.

* `cu12.c' and `cu14.c' read the variable `pattern1' beyond its size.

* `mvst.c' modifies input operands in inline assemblies.

* `srnmb.c' relies on Valgrind's error message for a bad rounding mode to
  point to the line number where get_rounding_mode() is called, not to the
  function itself.

* `stfle.c' has a code path with an uninitialized variable that may cause
  a compiler warning.

* `stmg.c' modifies r15 in an inline assembly and doesn't expect the
  compiler to use r15 as the base address for an input operand.

* Various inline assemblies use the "=m" constraint even when the
  instruction only supports more restricted address operands.

Fix all of the above.  For consistency and clarity, avoid the "=m"
constraint even when it would be applicable.

14 months agos390x regtest: Refactor mul test cases for Clang support
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x regtest: Refactor mul test cases for Clang support

The mul test case crashes when compiled with clang because of register
clashes in some inline assemblies.  Obviously clang does not treat
register clobbers as "early clobbers", but sometimes uses the same
registers for inputs as well.

Rewrite the inline assemblies in mul.h to avoid this issue.  Also, reduce
the code duplication in the process.  Adjust mul_GE.c accordingly.  Keep
the expected output for all mul test cases the same as before.

14 months agos390x regtest: Adjust op00 and op_exception tests for Clang
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x regtest: Adjust op00 and op_exception tests for Clang

As part of fixing Bug 465782, adjust the op00 and op_exception tests.

The op00 test case doesn't compile with clang because the .hword assembler
directive is not known to llvm-as.  When replacing it with .short, the
test case fails because clang/llvm-as generates different line number
information from gcc/gas.  Using gcc, Valgrind's error message locates the
unrecognised instruction

   at 0x........: main (op00.c:3)

whereas with clang, it shows:

   at 0x........: main (op00.c:4)

The asm statement in op00.c is indeed located at line 4, so when compiling
with gcc, the indicated line number is just wrong.  This is because gas
only updates line number information for instruction directives, not for
directives like `.short' as used here.  See also the discussion in
https://sourceware.org/bugzilla/show_bug.cgi?id=30206

The same applies to the op_exception test case, where `.long' is used to
emit illegal instructions.

Make these test cases independent from this difference, by replacing the
`.short' and `.long' directives by equivalent `.insn' directives.  Also
drop the unnecessary duplication of op00.stderr.exp.

14 months agos390x regtest: Adjust various test cases for Clang
Andreas Arnez [Fri, 29 Sep 2023 14:11:31 +0000 (16:11 +0200)]
s390x regtest: Adjust various test cases for Clang

There are various issues when compiling the s390x test cases with
Clang (see Bug 465782):

* Bugs in inline assemblies tolerated/obscured by GCC:

  - "d" (or "r") constraint instead of "a" where a register from 1-15 is
    needed
  - mix-up between vector register and general register in inline assembly
  - too unspecific constraints such as "m" or "g"
  - use of input operand for output
  - missing register clobber declaration

* Missing Clang features:

  - "%R" (register) and "%O" (offset) modifiers with address constraints
    in inline assemblies
  - variable-length array within a struct

* Use of the -mlong-double-128 command line option -- has been redundant
  for some time with GCC, and Clang only supports 128-bit long double

* Bad definition of _FPU_SETCW/_FPU_GETCW in <fpu_control.h>
  (See https://sourceware.org/bugzilla/show_bug.cgi?id=30130)

* Use of pow() function without linking libm -- GCC optimizes the call
  away, while Clang keeps a reference to pow()

Perform appropriate changes to the test cases such that they can be
compiled both with Clang and with GCC.

14 months agoREADME / comments: update debugging advice
Paul Floyd [Fri, 29 Sep 2023 06:57:42 +0000 (08:57 +0200)]
README / comments: update debugging advice

And add an explanation for the odd FreeBSD amd64 startup stack alignment.

This page took 0.06562 seconds and 5 git commands to generate.