]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
16 months agofdleaks: remove a VG(printf)
Paul Floyd [Fri, 15 Mar 2024 07:01:30 +0000 (08:01 +0100)] 
fdleaks: remove a VG(printf)

This was causing a few regtest failures for me

16 months agoregtest: un-inline fdleak close_inherited
Paul Floyd [Thu, 14 Mar 2024 07:12:23 +0000 (08:12 +0100)] 
regtest: un-inline fdleak close_inherited

I don't understand why but clang on FreeBSD arm64 seemed to
optimize away the 'stat' check. That caused failures due
to incorrect duplicate close errors.

16 months agoFreeBSD DRD: remove pthread_create suppression
Paul Floyd [Wed, 13 Mar 2024 21:16:31 +0000 (22:16 +0100)] 
FreeBSD DRD: remove pthread_create suppression

This is far too general. If a suppression is needed it needs to be much
more specific.

16 months agoFreeBSD syscall: improve closefrom to make it similar to cloase_range
Paul Floyd [Wed, 13 Mar 2024 20:34:08 +0000 (21:34 +0100)] 
FreeBSD syscall: improve closefrom to make it similar to cloase_range

Was missing ML_(record_fd_close) calls for the fds.

16 months agoUpdate gitignore for fdleak tests
Paul Floyd [Wed, 13 Mar 2024 19:32:40 +0000 (20:32 +0100)] 
Update gitignore for fdleak tests

16 months agoFreeBSD regtest: update filters for fdleak tests
Paul Floyd [Wed, 13 Mar 2024 19:30:47 +0000 (20:30 +0100)] 
FreeBSD regtest: update filters for fdleak tests

16 months agos390x: Fix definedness of syscall return value register
Andreas Arnez [Wed, 13 Mar 2024 16:47:59 +0000 (17:47 +0100)] 
s390x: Fix definedness of syscall return value register

The memcheck test case for the close_range syscall showed that Valgrind on
s390x doesn't correctly set the definedness of the return value register
after having invoked a system call.  Fix this.

16 months agoWith --track-fds=yes warn when file descriptor is closed a second time
Alexandra Hájková [Wed, 28 Feb 2024 08:02:15 +0000 (09:02 +0100)] 
With --track-fds=yes warn when file descriptor is closed a second time

We moved the record_fd_close call from POST to PRE sys_close handler,
because the POST handler is only called on success. Even if the close
syscall fails the file descriptor is still really closed/invalid.
In the PRE handler the file descriptor is about to be closed, but hasn't
been yet so we can capture also the description.

This patch add new field fd_closed to OpenFd structure to record if
the file descriptor was already closed.

We now capture a backtrace when closing file descriptors to be able to
print it in a case of a double close.  Always add '<' brackets '>' around
"unbound" in the description for consistency.

getsockdetails now takes and returns a buffer describing the socket
because we want to record it, not just print it.

Note that close_range is handled similar to closing each descriptor
individually. But the case when the close_range is called with an
infinite end (~0U) is treated special. Add a new record_fd_close_range
function which handles close_range with an infinite end so double
close by close_range isn't an error because we don't want to loop
over such a wide range.

Add a new test cases:
 - none/tests/socket_close.vgtest
   - tests double closing a socket
 - none/tests/double_close_range.vgtest
   - uses close_range to double close the file descriptors
 - none/tests/file_dclose.vgtest
   - double closing regular file with regular close syscall

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

Co-Authored-By: Mark Wielaard <mark@klomp.org>
16 months agoFreeBSD: fixed file mappings revisited
Paul Floyd [Wed, 13 Mar 2024 08:06:31 +0000 (09:06 +0100)] 
FreeBSD: fixed file mappings revisited

Revert to using the ELF fixed file flag, but keep the first
mapping so that it gets recorded to keep parse_procselfmaps
and ML_(read_elf_object) happy with what they see.

16 months agoFreeBSD regtest: make get_set_context platform independent with a filter
Paul Floyd [Sat, 9 Mar 2024 14:34:52 +0000 (15:34 +0100)] 
FreeBSD regtest: make get_set_context platform independent with a filter

Don't want to keep adding expecteds

16 months agoRegtest: add a prereq to check that close_range built
Paul Floyd [Fri, 8 Mar 2024 21:13:43 +0000 (22:13 +0100)] 
Regtest: add a prereq to check that close_range built

16 months agoFreeBSD syscall: fix PRE_MEM_READ for utrace
Paul Floyd [Fri, 8 Mar 2024 11:48:22 +0000 (12:48 +0100)] 
FreeBSD syscall: fix PRE_MEM_READ for utrace

16 months agoRegtest: fix a warning with older gcc with memcheck memalign_args
Paul Floyd [Fri, 8 Mar 2024 07:00:10 +0000 (08:00 +0100)] 
Regtest: fix a warning with older gcc with memcheck memalign_args

I guess that newer GCC extensions include more stuff.

16 months agoMove close_range in .gitignore
Paul Floyd [Thu, 7 Mar 2024 21:01:27 +0000 (22:01 +0100)] 
Move close_range in .gitignore

16 months agoMove close_range test from memcheck/tests/freebsd to memcheck/tests
Mark Wielaard [Thu, 7 Mar 2024 16:40:54 +0000 (17:40 +0100)] 
Move close_range test from memcheck/tests/freebsd to memcheck/tests

The close_range call is also available under linux and we already
have an appropriate configure call to test it. The only difference
is how the syscall arguments are called.

16 months agoFreeBSD syscall: fixes for semctl
Paul Floyd [Wed, 6 Mar 2024 20:19:23 +0000 (21:19 +0100)] 
FreeBSD syscall: fixes for semctl

On FreeBSD, the libc semctl function takes a union semun argument
for commands that take 4 arguments. It then gets that argument
via va_args and takes a pointer to it. That's what gets passed
to the sysctl - a pointer to union semun.

Previously we were handling the 4th argument as if it were
directly a union semun. This seems to have worked OK for years,
possibly due to luck concerning the way that va_args works
and/or the fact that the union is basically a union of
pointers. Recently I've been working on arm64 and there it
most definitely does not work.

17 months agoFreeBSD and macOS: change detection of when carry flag is being set
Paul Floyd [Mon, 4 Mar 2024 20:09:16 +0000 (21:09 +0100)] 
FreeBSD and macOS: change detection of when carry flag is being set

FreeBSD and macOS syscalls both have two return registers and
use the carry flag for the status. So syscall for client
needs to set the carry flag in the VexGuestArchState. That's
a bit much to do all in asm so we call VEX funtions.

But that doesn't play well with interrupts. There are labels
in ML_(do_syscall_for_client_WRK) so that we can work out
what to do if we get interrupted there. But there are no asm
labels in the VEX functions. Getting the address of the start
of the extern function is easy. There's no way in C to get
the length, and getting the address for the static helpers
is also messy.

I did bodge a solution whereby I put a dummy function in the
source file and scientifically crossed my fingers and hoped
that the compiler would lay out the object file in the same
way. And it did, at least for amd64 FreeBSD amd64 Darwin and
x86 FreeBSD (I don't have easy access to Darwin with working
x86).

Still, it's UB.

I recently tried the same thing for arm64 FreeBSD. And there
the functions are all over the shop in the object file.

So, time to do something a bit cleaner. I've removed all of
the hacky dummy functions and put a flag in the guest vex
state. For both amd64 and x86 there were spare padding
UInts that I've used. Arm64 won't be so lucky when I get there,
no spare padding words.

17 months agoFreeBSD regtest: add wildcards to none/tests/freebsd diffs
Paul Floyd [Sat, 2 Mar 2024 17:16:34 +0000 (18:16 +0100)] 
FreeBSD regtest: add wildcards to none/tests/freebsd diffs

17 months agoComment: explain why v.info location no longer detects stack guard pages on FreeBSD
Paul Floyd [Wed, 28 Feb 2024 21:00:37 +0000 (22:00 +0100)] 
Comment: explain why v.info location no longer detects stack guard pages on FreeBSD

Workaround: sysctl security.bsd.stack_guard_page=0

17 months agoFreeBSD regtest: fix value of CLOSE_RANGE_CLOEXEC in close_range test
Paul Floyd [Wed, 28 Feb 2024 19:01:05 +0000 (20:01 +0100)] 
FreeBSD regtest: fix value of CLOSE_RANGE_CLOEXEC in close_range test

Spotted by Mark Wielaard, thanks.

17 months agoFreeBSD regtest: add a test with sanity lvel 3 and threads
Paul Floyd [Wed, 28 Feb 2024 18:57:05 +0000 (19:57 +0100)] 
FreeBSD regtest: add a test with sanity lvel 3 and threads

17 months agoFreeBSD regtest: filter sanity level >= 3 warnings about transparent stack mmaps
Paul Floyd [Wed, 28 Feb 2024 18:37:02 +0000 (19:37 +0100)] 
FreeBSD regtest: filter sanity level >= 3 warnings about transparent stack mmaps

17 months agoAdd Unlicense to coregrind/m_debuginfo/tinfl.c
Mark Wielaard [Tue, 27 Feb 2024 12:36:39 +0000 (13:36 +0100)] 
Add Unlicense to coregrind/m_debuginfo/tinfl.c

The tinfl.c file comes from the public domain miniz project.
Upstream added an explicit Public Domain declaration using
the Unlicense. No other changes were made, so all our valgrind
specific changes still apply. This doesn't really change the
license as used for our derived version, which is distributed
under GPLv2+. But it adds some history and a legal statement
that is more clear than just saying "public domain".

This is the upstream commit:

commit e8dfb6599a2294584571ad4806dc4e300323858c
Author: Rich Geldreich <richgel99@gmail.com>
Date:   Sat May 28 22:15:49 2011 +0000

    added unlicense.org statement

17 months agoFreeBSD: experimental fix for --sanity-level=3 and above
Paul Floyd [Sun, 25 Feb 2024 18:10:37 +0000 (19:10 +0100)] 
FreeBSD: experimental fix for --sanity-level=3 and above

Previously this failed due to split mmap mappings for MAP_STACK.
This change tries to piece together such stack mappings. This
mainly affects multithreaded apps when they create their thread
stacks.

17 months agoFreeBSD: clean up guest stack creation code
Paul Floyd [Sun, 25 Feb 2024 13:50:57 +0000 (14:50 +0100)] 
FreeBSD: clean up guest stack creation code

At one time I thought of using sysctls to get the same stack
max size and growth size as the OS uses. But that won't work
for x86 on amd64. So I've just cleaned the code a bit and
added more comments explaining what is going on.

17 months agolinux arm64: fix a couple of clang warnings about word length
Paul Floyd [Sat, 24 Feb 2024 12:57:58 +0000 (13:57 +0100)] 
linux arm64: fix a couple of clang warnings about word length

17 months agoarm64 regtest: add regtest leftovers to gitignore
Paul Floyd [Sat, 24 Feb 2024 12:56:22 +0000 (13:56 +0100)] 
arm64 regtest: add regtest leftovers to gitignore

17 months agolinux regtest: helgrind bar_bad expected for ppc64le
Paul Floyd [Sat, 24 Feb 2024 08:03:35 +0000 (09:03 +0100)] 
linux regtest: helgrind bar_bad expected for ppc64le

17 months agolinux regtest: update helgrind bar_bad
Paul Floyd [Fri, 23 Feb 2024 21:04:02 +0000 (22:04 +0100)] 
linux regtest: update helgrind bar_bad

17 months agoFreeBSD: another load of changes for FreeBSD 15
Paul Floyd [Fri, 23 Feb 2024 20:43:16 +0000 (21:43 +0100)] 
FreeBSD: another load of changes for FreeBSD 15

One more default suppession.

The new libsys.so was causing problems, and it needs to be
loaded before libthr.so in order to be able to get the tid
for the main thread on startup.

The bar_bad testcase for both helgrind and drd was giving a lot of
trouble (inclusing an assert in DRD_(barrier_pre_wait) ). The
sleeps in the testcase were not assuring the expected order.
So I changed the sleeps to 1ms nanosleeps in loops. That's a
bit more realistic and it also gives much more chances to the
scheduler to context switch.

I'll update the Linux expected shortly.

17 months agoFreeBSD: updates for FreeBSD 15 libsys
Paul Floyd [Fri, 23 Feb 2024 19:07:53 +0000 (20:07 +0100)] 
FreeBSD: updates for FreeBSD 15 libsys

FreeBSD 15 has moved all libc functions that are just syscall
wrappers into libsys. That changes quite a few callstacks, so
I've added a load of filtering to make it look like the old
libc callstacks.

I'm also seeing new conflicts in _umtx_op_err for both DRD
and Helgrind that needed supressing.

17 months agoFreeBSD regtest: disable SYS_sbrk for FreeBSD
Paul Floyd [Fri, 23 Feb 2024 13:08:45 +0000 (14:08 +0100)] 
FreeBSD regtest: disable SYS_sbrk for FreeBSD

This syscall has been obsoleted.

17 months agoFreeBSD: set client stack perms from ExeInfo
Paul Floyd [Fri, 23 Feb 2024 12:23:56 +0000 (13:23 +0100)] 
FreeBSD: set client stack perms from ExeInfo

Was hard coded RWX, will now use PT_GNU_STACK from the elf
program headers, if present.

17 months agoFreeBSD: changes for building with GCC
Paul Floyd [Fri, 23 Feb 2024 08:33:24 +0000 (09:33 +0100)] 
FreeBSD: changes for building with GCC

Use MARK_STACK_NO_EXEC (it's a null macro on non-linux platforms).
GCC complains if it's not used.

parse_procselfmaps yet again.

The hack that I added in 6fdd59afb5e473b30e7ad1fbadcf9a397253fed4
only works for clang/ld.lld. This change makes it also work with
GCC/ld.bfd. Still a hack though.

17 months agoBug 369723 - __builtin_longjmp not supported in clang/llvm on Android arm64 target
Paul Floyd [Thu, 22 Feb 2024 15:56:22 +0000 (16:56 +0100)] 
Bug 369723 - __builtin_longjmp not supported in clang/llvm on Android arm64 target

Made the functions out-of-line, more like other platforms.

17 months agodebug messages: make VG_(sigframe_destroy) consistent
Paul Floyd [Tue, 20 Feb 2024 21:44:55 +0000 (22:44 +0100)] 
debug messages: make VG_(sigframe_destroy) consistent

Probably functions changed names but not the debug messages.

17 months agoFreeBSD: add -v -v tracing for usrstackbase and usrstacklim
Paul Floyd [Mon, 19 Feb 2024 12:58:01 +0000 (13:58 +0100)] 
FreeBSD: add -v -v tracing for usrstackbase and usrstacklim

17 months agoSolaris: add a Helgrind suppression
Paul Floyd [Sun, 18 Feb 2024 06:44:53 +0000 (07:44 +0100)] 
Solaris: add a Helgrind suppression

For a C++ lock guard

17 months agoDarwin: various fixes
Paul Floyd [Sat, 17 Feb 2024 20:37:00 +0000 (21:37 +0100)] 
Darwin: various fixes

Fix building a couple of regtests.
bmi.c - Apple clang puts a funky underscore before symbols which you
have to add explicitly in asm.
mmap_o_direct.c - there is no O_DIRECT on macOS
syswrap - make csrctl messages a bit more userland-y rather than
kernel-y

17 months agomusl regtest: fix crash in helgrind getaddrinfo
Paul Floyd [Sat, 17 Feb 2024 17:49:31 +0000 (18:49 +0100)] 
musl regtest: fix crash in helgrind getaddrinfo

musl doesn't like it if you pass in NULL to freeaddrinfo.

17 months agomusl: updates to suppressions and drd pthread detection script
Paul Floyd [Sat, 17 Feb 2024 17:24:36 +0000 (18:24 +0100)] 
musl: updates to suppressions and drd pthread detection script

Mostly for DRD.

17 months agolinux arm DRD: add an expected for tc19_shadowmem
Paul Floyd [Sat, 17 Feb 2024 13:23:26 +0000 (14:23 +0100)] 
linux arm DRD: add an expected for tc19_shadowmem

Probably because rpi 3 and later run an aarch64 kernel but arm32
userland this testcase gives results very similar to the 64bit
expected.

17 months agolinux arm regtest: update memcheck partiallydefinedeq
Paul Floyd [Sat, 17 Feb 2024 12:34:16 +0000 (13:34 +0100)] 
linux arm regtest: update memcheck partiallydefinedeq

On my rpi 5 this only gives 2 errors, like s390.
Haven't dug into the asm.

17 months agoBug 466762 - Add redirs for C23 free_sized() and free_aligned_sized()
Paul Floyd [Sat, 17 Feb 2024 10:56:32 +0000 (11:56 +0100)] 
Bug 466762 - Add redirs for C23 free_sized() and free_aligned_sized()

No testcase for the moment - I still need to link with a non-system
to be able to test

17 months agodebug options: add more description for sanity-level
Paul Floyd [Sat, 17 Feb 2024 07:23:57 +0000 (08:23 +0100)] 
debug options: add more description for sanity-level

And make usage more consistent. There was a mix of > and >=, now
it is all >=.

17 months agolinux arm regtest: add an expected for origin5-bz2
Paul Floyd [Fri, 16 Feb 2024 21:26:37 +0000 (22:26 +0100)] 
linux arm regtest: add an expected for origin5-bz2

Ninth one for this test.

17 months agolinux arm regtest: leak_cpp_interior try again
Paul Floyd [Fri, 16 Feb 2024 21:05:45 +0000 (22:05 +0100)] 
linux arm regtest: leak_cpp_interior try again

Hope it isn't nondetermiistic.

17 months agolinux arm regtest: add an expected for leak_cpp_interior
Paul Floyd [Fri, 16 Feb 2024 20:35:11 +0000 (21:35 +0100)] 
linux arm regtest: add an expected for leak_cpp_interior

For this code

  ptr2 = new MyClass[0]; // "interior but exterior ptr".
  // ptr2 points after the chunk, is wrongly considered by memcheck as definitely leaked.

there's a possible leak rather than a definite one.
I tried adding the clobber macro but that didn't change anything.
So I'm still not too sure why memcheck is finding the pointer for
this.

17 months agolinux arm regtest: fix memcheck leak-segv-jmp
Paul Floyd [Fri, 16 Feb 2024 19:58:01 +0000 (20:58 +0100)] 
linux arm regtest: fix memcheck leak-segv-jmp

The hand rolled asm syscall to mprotect was failing.
At least it now passes on my rpi.

17 months agolnux helgrind: broaden suppression in libnss_mdns4
Paul Floyd [Fri, 16 Feb 2024 12:46:55 +0000 (13:46 +0100)] 
lnux helgrind: broaden suppression in libnss_mdns4

17 months agolinux arm regtest: fix test and stdout expected
Paul Floyd [Fri, 16 Feb 2024 12:08:03 +0000 (13:08 +0100)] 
linux arm regtest: fix test and stdout expected

The three diffs that I noticed earlier were really due to typos
in the testcase. They should have been using d0 d1 d2 d3 but
instead were using d0 d1 d2 d4.

17 months agoUpdate README_PACKAGERS
Paul Floyd [Thu, 15 Feb 2024 19:48:07 +0000 (20:48 +0100)] 
Update README_PACKAGERS

Give another example of why stripping the binaries is a bad idea.

17 months agoFreeBSD: add suppressions for reachable memory in libthr.so
Paul Floyd [Thu, 15 Feb 2024 19:35:03 +0000 (20:35 +0100)] 
FreeBSD: add suppressions for reachable memory in libthr.so

17 months agoFix gdbserver tests failing due to 'warning: ' prefix in syscall-template.S line
Philippe Waroquiers [Sun, 11 Feb 2024 15:14:54 +0000 (16:14 +0100)] 
Fix gdbserver tests failing due to 'warning: ' prefix in syscall-template.S line

At least on debina 12.5, with GDB 13.1 and GDB 14.1, 2 gdbserver tests
fails due to a 'warning: ' word appearing in from of a line
giving the syscall-template.S filename.

Fix this by allowing an optional 'warning: ' regexp at the beginning of the line.

Tested on debian 12.5, with GDB 12.1/13.1/14.1 and 15.0.50.20240211-git

17 months agoFreeBSD regtest: improve memcheck filtering for varinfo5
Paul Floyd [Sat, 10 Feb 2024 10:29:09 +0000 (11:29 +0100)] 
FreeBSD regtest: improve memcheck filtering for varinfo5

Now only one real difference between clang and GCC.

17 months agoFreeBSD regtest: updates for memcheck varinfo5
Paul Floyd [Sat, 10 Feb 2024 08:08:16 +0000 (09:08 +0100)] 
FreeBSD regtest: updates for memcheck varinfo5

Two things:
Improvement in reading debuginfo for variables.
clang16 doing tail call optimization, so add -fno-optimize-sibling-calls

17 months agoBug 471036 - Add test for rorx with rip-relative address
Matthias Schwarzott [Fri, 9 Feb 2024 07:04:51 +0000 (08:04 +0100)] 
Bug 471036 - Add test for rorx with rip-relative address

17 months agoBug 471036 - Print more context for amd64 disasm rip mismatch
Matthias Schwarzott [Fri, 9 Feb 2024 07:22:58 +0000 (08:22 +0100)] 
Bug 471036 - Print more context for amd64 disasm rip mismatch

17 months agoBug 471036 - disInstr_AMD64: disInstr miscalculated next %rip on RORX imm8, m32/64...
Paul Floyd [Sat, 10 Feb 2024 07:19:20 +0000 (08:19 +0100)] 
Bug 471036 - disInstr_AMD64: disInstr miscalculated next %rip on RORX imm8, m32/64, r32/6

Patch contributed by redoste@redoste.xyz

17 months agoNEWS: add bug 481131
Paul Floyd [Fri, 9 Feb 2024 20:58:07 +0000 (21:58 +0100)] 
NEWS: add bug 481131

17 months agox86 regtest: fix clobber lists in generated asm statements
Gra??vydas Ignotas [Fri, 9 Feb 2024 17:02:23 +0000 (19:02 +0200)] 
x86 regtest: fix clobber lists in generated asm statements

Must add result registers also, or else code like this is generated:

      asm(
         "fsave %3\n"
         "movl %2, %%eax\n"
         "cdq\n"
         "movl %%edx, %0\n"
         "movl %%eax, %1\n"
         "frstor %3\n"
         "cld\n"
         : "=m" (result0), "=m" (result1)
         : "m" (preset0), "m" (state[0])
         : "eax"
      );

This crashes on my machine because gcc places some pointer in %%edx.

17 months agomanpage: a few changes for realloc size zero and give FreeBSD a few mentions
Paul Floyd [Fri, 9 Feb 2024 20:55:21 +0000 (21:55 +0100)] 
manpage: a few changes for realloc size zero and give FreeBSD a few mentions

17 months agocommand line help: move --realloc-zero-bytes-frees
Paul Floyd [Fri, 9 Feb 2024 20:20:40 +0000 (21:20 +0100)] 
command line help: move --realloc-zero-bytes-frees

It should be in the section on tools that replace malloc.

17 months agolinux arm regtest: update neon64 expected
Paul Floyd [Thu, 8 Feb 2024 20:53:44 +0000 (21:53 +0100)] 
linux arm regtest: update neon64 expected

I get the same output from both Valgrind and running the test
natively.

17 months agoBug 283429 - ARM leak checking needs CLEAR_CALLER_SAVED_REGS
Paul Floyd [Thu, 8 Feb 2024 13:09:15 +0000 (14:09 +0100)] 
Bug 283429 - ARM leak checking needs CLEAR_CALLER_SAVED_REGS

Unfortunately it took over 12 years to reinvent the wheel and
fix this item.

See also
d91042c29dd3fbe2971f36f35b08e9735327f50a
and
b0015f7572bf42ee4ac1296884f5e7640ec1e5dc

17 months agoFreeBSD _umtx_op: fix bad wrapper for robust lists
Paul Floyd [Thu, 8 Feb 2024 07:34:42 +0000 (08:34 +0100)] 
FreeBSD _umtx_op: fix bad wrapper for robust lists

Was a half-baked copy and paste from the mutex version.

17 months agoAdd missing gitignore for none arm64 ldxp_stxp
Paul Floyd [Thu, 8 Feb 2024 06:15:22 +0000 (07:15 +0100)] 
Add missing gitignore for none arm64 ldxp_stxp

17 months agoTypo in comment
Paul Floyd [Wed, 7 Feb 2024 20:18:51 +0000 (21:18 +0100)] 
Typo in comment

17 months agoAdd myself to AUTHORS
Paul Floyd [Wed, 7 Feb 2024 20:11:53 +0000 (21:11 +0100)] 
Add myself to AUTHORS

17 months agolinux aarch64: an extra Helgrind printf suppression and dix a couple of warnings
Paul Floyd [Wed, 7 Feb 2024 20:06:52 +0000 (21:06 +0100)] 
linux aarch64: an extra Helgrind printf suppression and dix a couple of warnings

The existing suppression begins with

   fun:memcpy*

but I'm seeing the first one as

   fun:__GI_memcpy

so I just made that *memcpy*

17 months agolinux regtest: add prereq for bug480706
Paul Floyd [Wed, 7 Feb 2024 12:54:34 +0000 (13:54 +0100)] 
linux regtest: add prereq for bug480706

For systems without openssl

17 months agoFreeBSD regtest: feature test for aio_readv
Paul Floyd [Tue, 6 Feb 2024 14:53:36 +0000 (15:53 +0100)] 
FreeBSD regtest: feature test for aio_readv

Doesn't exist on FreeBSD 12.4 and earlier.
Also clean up configure output - was missing a few yes/nos.

17 months agoLinux regtest: link for bug480706
Paul Floyd [Tue, 6 Feb 2024 14:17:23 +0000 (15:17 +0100)] 
Linux regtest: link for bug480706

Needed to use LDADD not LDFLAGS

17 months agoLinux PPC32: fix typo
Paul Floyd [Tue, 6 Feb 2024 13:33:49 +0000 (14:33 +0100)] 
Linux PPC32: fix typo

Full stop instead of a comma.

17 months agoBug 480706 - Unhandled syscall 325 (mlock2)
Paul Floyd [Mon, 5 Feb 2024 21:14:33 +0000 (22:14 +0100)] 
Bug 480706 - Unhandled syscall 325 (mlock2)

17 months agoFreeBSD: updates for FreeBSD 14.0
Paul Floyd [Mon, 5 Feb 2024 12:21:28 +0000 (13:21 +0100)] 
FreeBSD: updates for FreeBSD 14.0

Added some filtering. Removed a few compiler warnings.
memcheck manuel1 has an extra error somewhere within
the printf calltree - sensitive to libc changes.

I still get
== 853 tests, 2 stderr failures, 0 stdout failures, 0 stderrB failures, 0 stdoutB failures, 0 post failures ==
memcheck/tests/descr_belowsp             (stderr)
memcheck/tests/varinfo5                  (stderr)

descr_belowsp no longer mentions the guard page. Back in commit

121374b287ce39ef0e42e45dfc27ae0949e6f528

I said about FreeBSD 14 adding ASLR

"    Some more work will be needed for the stack size."

Looks like that has now come home to roost.

varinfo5 has lost some inline info but gained info on variable names.

18 months agoBug 476331 - clean up generated/distributed filter scripts
Paul Floyd [Fri, 2 Feb 2024 21:27:25 +0000 (22:27 +0100)] 
Bug 476331 - clean up generated/distributed filter scripts

18 months agoMakefiles: bug 476331 cleanup
Paul Floyd [Fri, 2 Feb 2024 20:17:49 +0000 (21:17 +0100)] 
Makefiles: bug 476331 cleanup

Quick test with one script to see if buildbot is happy.

18 months agoregtest: some missing AM_CFLAGS and AM_CXXFLAGS
Paul Floyd [Thu, 1 Feb 2024 12:55:59 +0000 (13:55 +0100)] 
regtest: some missing AM_CFLAGS and AM_CXXFLAGS

In all cases, these caused problems for 32on64 builds.

In a few cases extra CFLAGS were needed but AM_CFLAGS not used.

And it seems as though autoconf needs explicit else branches. So

if FOO
test_CFLAGS = ${AM_CFLAGS} -hide-some-warnings
endif

doesn't set test_CFLAGS to the default when FOO is false.
(I'm sure I've seen that before, and forgotten).

18 months agoLinux PPC: fix the constant used for O_DIRECT
Paul Floyd [Wed, 31 Jan 2024 06:48:52 +0000 (07:48 +0100)] 
Linux PPC: fix the constant used for O_DIRECT

There are two defined

$ grep -rI O_DIRECT /usr/include/* | grep -v ORY | grep -v __
/usr/include/asm/fcntl.h:#define O_DIRECT       0400000 /* direct disk access hint */
/usr/include/asm-generic/fcntl.h:#define O_DIRECT       00040000        /* direct disk access hint */

and of course I used the wrong one. The non-generic value is the right one.

18 months agoBug 480405 - valgrind 3.22.0 "m_debuginfo/image.c:586 (set_CEnt): Assertion '!sr_isEr...
Paul Floyd [Tue, 30 Jan 2024 21:02:21 +0000 (22:02 +0100)] 
Bug 480405 - valgrind 3.22.0 "m_debuginfo/image.c:586 (set_CEnt): Assertion '!sr_isError(sr)' failed."

18 months agoBug 480488 - Add support for FreeBSD 13.3
Paul Floyd [Tue, 30 Jan 2024 20:23:48 +0000 (21:23 +0100)] 
Bug 480488 - Add support for FreeBSD 13.3

18 months agoFreeBSD ioctl: add handling for FIODGNAME
Paul Floyd [Mon, 29 Jan 2024 07:03:52 +0000 (08:03 +0100)] 
FreeBSD ioctl: add handling for FIODGNAME

Up til now FreeBSD ioctl coverage was conspicuous by its absence
relying entirely on the generic wrapper. Time to start improving
that.

Example provided by Kyle Evans.

18 months agoRevert compiler flags for armv7
Paul Floyd [Sun, 28 Jan 2024 20:04:08 +0000 (21:04 +0100)] 
Revert compiler flags for armv7

18 months agoARM: handle v6 to v8 in configure.ac
Paul Floyd [Sun, 28 Jan 2024 14:34:27 +0000 (15:34 +0100)] 
ARM: handle v6 to v8 in configure.ac

Some changes based on first patch in
https://bugs.kde.org/show_bug.cgi?id=276897
Bug 276897 ARM v6 legacy patches
contributed by "JW"

I've also modified the GCC flags for a few tests in none/tests/arm

We probably need more arm feature tests in configure.ac.

18 months agoDRD regtest: add ARM expecteds for annotate_trace_memory
Paul Floyd [Sun, 28 Jan 2024 09:09:41 +0000 (10:09 +0100)] 
DRD regtest: add ARM expecteds for annotate_trace_memory

The diff is that one 8byte access is being split into two 4byte
acceses.

18 months agoFreeBSD regtest: make memcheck varinfo3 filtering consistent
Paul Floyd [Sun, 28 Jan 2024 08:47:36 +0000 (09:47 +0100)] 
FreeBSD regtest: make memcheck varinfo3 filtering consistent

Same formar for static_local_def

18 months agomemcheck regtest arm: add a clobber to r0
Paul Floyd [Sun, 28 Jan 2024 08:23:18 +0000 (09:23 +0100)] 
memcheck regtest arm: add a clobber to r0

This fixes a few of the leak testcases

18 months agoregtest gdbserver: add an extra filter for Raspberry Pi OS select
Paul Floyd [Sat, 27 Jan 2024 16:07:30 +0000 (17:07 +0100)] 
regtest gdbserver: add an extra filter for Raspberry Pi OS select

18 months agoHelgrind: add suppression for libnss from getaddrinfo
Paul Floyd [Sat, 27 Jan 2024 07:00:34 +0000 (08:00 +0100)] 
Helgrind: add suppression for libnss from getaddrinfo

Seems as though Raspberry Pi OS doesn't have a debuginfo package
for libnss_mdns4 so we need to suppress based on the obj name.

There is still one error in the Helgrind getaddrinfo test, but that
is in the somewhat malformed libarmmem library (which does have
debuginfo but Valgrind can't read it because there is no ELF type
or size info). I think that suppressing that would be too broad.

18 months agogdbserver_tests/filter_gdb.in: delete thread exiting
Mark Wielaard [Mon, 22 Jan 2024 13:08:30 +0000 (14:08 +0100)] 
gdbserver_tests/filter_gdb.in: delete thread exiting

The hginfo testcase would fail with GDB 14.1 because it would output
an extra line saying: [Thread .... exited]

18 months agoBug 480126 - Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8
Paul Floyd [Sun, 21 Jan 2024 20:33:06 +0000 (21:33 +0100)] 
Bug 480126 - Build failure on Raspberry Pi 5 / OS 6.1.0-rpi7-rpi-v8

The problem is that the Pi 3+ with raspbian has a 64bit aarch64 OS
but a 32bit gnueabihf userland. If you just run "configure" the
result will be an attempt to use 32-bit GCC with the ARM64 Valgrind
platform, which will fail.

This can be fixed by using the appropriate --host= option.
I've updated README.aarch64 with a description of this.

I've also changed configure.ac to take "arm*" for the
ARM platform (previously it was "armv7*"). That's been
a patch on Debian for a while. It will allow building
on older arm hardware and also armv8 (used on the
Raspberry Pi 3 and later models).

18 months agoBug 480052 - WARNING: unhandled amd64-freebsd syscall: 580
Paul Floyd [Sat, 20 Jan 2024 20:14:37 +0000 (21:14 +0100)] 
Bug 480052 - WARNING: unhandled amd64-freebsd syscall: 580

18 months agoFreeBSD: revert a change for debugging ifunctions and correct a couple of typos
Paul Floyd [Sat, 20 Jan 2024 17:53:01 +0000 (18:53 +0100)] 
FreeBSD: revert a change for debugging ifunctions and correct a couple of typos

19 months agoregtest: try to make cachegrind/tests/ann-merge2.vgtest deterministic
Paul Floyd [Thu, 28 Dec 2023 20:50:06 +0000 (21:50 +0100)] 
regtest: try to make cachegrind/tests/ann-merge2.vgtest deterministic

Add a touch of the cgout files so that they are more recent than the
source file. git clone seems to sometimes timestamp the source
after the cgout files which generates a warning and a post failure.
At least with FreeBSD on ZFS.

19 months agoFix unused variable warning
Paul Floyd [Thu, 28 Dec 2023 11:08:40 +0000 (12:08 +0100)] 
Fix unused variable warning

19 months agoDarwin: Fix another bad merge of coregrind/m_debuginfo/debuginfo.c
Paul Floyd [Thu, 28 Dec 2023 09:47:29 +0000 (10:47 +0100)] 
Darwin: Fix another bad merge of coregrind/m_debuginfo/debuginfo.c

19 months agoDarwin: Fix bad merge of coregrind/m_debuginfo/debuginfo.c
Paul Floyd [Thu, 28 Dec 2023 09:41:54 +0000 (10:41 +0100)] 
Darwin: Fix bad merge of coregrind/m_debuginfo/debuginfo.c

19 months agoAdd Bug 479041 to NEWS
Paul Floyd [Thu, 28 Dec 2023 09:35:52 +0000 (10:35 +0100)] 
Add Bug 479041 to NEWS

19 months agoBug 479041 - Executables without RW sections do not trigger debuginfo reading
Paul Floyd [Thu, 28 Dec 2023 09:27:18 +0000 (10:27 +0100)] 
Bug 479041 - Executables without RW sections do not trigger debuginfo reading

The main change is to not assume that there is always 1 and only 1 RW segment.
Now the rw segment count is obtained from the macho segments.

I've had to make several changes to remove asserts that checked
that there is always 1 or more rw segments. I don't think that this
really affects 'normal' C and C++ compiled binaries. There is one
exp-bbv testcase (x86/million) that is written in assembler and
was failing until I removed all of the asserts.

There's still a bit more work to do.
1. Handle fat binaries - are these still a thing (with "apple silicon")?
2. Use a dynamically sized buffer for the segments rather than just 4k.