]> sourceware.org Git - valgrind.git/log
valgrind.git
21 months agoMake cg_annotate independent of python3 install location
Paul Floyd [Wed, 22 Mar 2023 19:43:30 +0000 (20:43 +0100)]
Make cg_annotate independent of python3 install location

21 months agocachegrind/tests/Makefile.am EXTRA_DIST add ann3.{{post,stderr}.exp,vgtest}
Mark Wielaard [Wed, 22 Mar 2023 10:41:53 +0000 (11:41 +0100)]
cachegrind/tests/Makefile.am EXTRA_DIST add ann3.{{post,stderr}.exp,vgtest}

21 months agoRewrite `cg_annotate` in Python.
Nicholas Nethercote [Thu, 9 Mar 2023 04:41:31 +0000 (15:41 +1100)]
Rewrite `cg_annotate` in Python.

Perl was a reasonable choice for `cg_annotate` in 2002, but not in 2023.
Also, the existing structure of the code is not good. These two things
make it hard to modify `cg_annotate` in any significant way.

Benefits of the change:
- Now written in a language that is (a) nice, and (b) not moribund.
- Easier to maintain, due to (a) abovementioned better language, (b)
  better code structure, and (c) better language tooling, such as
  formatters, type checkers, and linters.
- The new version is a little shorter.
- It runs about 2x faster.
- Argument handling is more standard. E.g. things like `--context 2`,
  `--auto`, `--no-auto` are supported. (The old forms that require `=`
  are still supported, though the `=yes`/`=no` forms are deprecated.)

The behaviour and output of the new version is identical for typical
uses, but there are some very minor changes for edge cases, which nobody
is likely to notice. For example:
- The file format is slightly changed: I removed support for '.'
  counts, which had the same meaning as '0'. This was a feature that
  Cachegrind never used, and the old script handled it inconsistently.
- The new version will abort on a malformed data line. The old version
  would just print a warning and continue.

The commit also adds a new test `ann3` that tests many parts of
`cg_annotate` that weren't tested previously, and tweaks the existing
`ann2` test.

21 months agoSolaris: fix build, another aligned alloc typo
Paul Floyd [Tue, 21 Mar 2023 21:11:11 +0000 (22:11 +0100)]
Solaris: fix build, another aligned alloc typo

22 months agoBug 467482 - Build failure on aarch64 Alpine
Paul Floyd [Fri, 17 Mar 2023 18:48:08 +0000 (19:48 +0100)]
Bug 467482 - Build failure on aarch64 Alpine

Patch submitted by
fanquake@gmail.com

22 months agocoverity: a couple of potential buffer overruns
Paul Floyd [Sun, 12 Mar 2023 10:12:29 +0000 (11:12 +0100)]
coverity: a couple of potential buffer overruns

22 months agocoverity: printf args format mismatch
Paul Floyd [Sun, 12 Mar 2023 08:39:35 +0000 (09:39 +0100)]
coverity: printf args format mismatch

22 months agocoverity: copy paste error
Paul Floyd [Sun, 12 Mar 2023 08:22:10 +0000 (09:22 +0100)]
coverity: copy paste error

22 months agoFreeBSD: fix a syswrap compiler warning
Paul Floyd [Sun, 12 Mar 2023 07:21:55 +0000 (08:21 +0100)]
FreeBSD: fix a syswrap compiler warning

22 months agoregtest: add an s390 expected for sized_aligned_new_delete_args
Paul Floyd [Sun, 12 Mar 2023 07:20:57 +0000 (08:20 +0100)]
regtest: add an s390 expected for sized_aligned_new_delete_args

22 months agodoc: Add asan equivalent to --realloc-zero-bytes-frees to manual-core
Paul Floyd [Sat, 11 Mar 2023 15:47:56 +0000 (16:47 +0100)]
doc: Add asan equivalent to --realloc-zero-bytes-frees to manual-core

22 months agoRefactor: reorder a few structs to make them more compact
Paul Floyd [Sat, 11 Mar 2023 15:31:43 +0000 (16:31 +0100)]
Refactor: reorder a few structs to make them more compact

Used pahole to find candidates. Don't have any performance
measurements, but it won't do any harm.

22 months agoregtest: update one expected after fixing realloc_size_zero_mismatch.cpp
Paul Floyd [Sat, 11 Mar 2023 07:07:06 +0000 (08:07 +0100)]
regtest: update one expected after fixing realloc_size_zero_mismatch.cpp

22 months agoregtest: build failure on Linux ppc64le, missing header
Paul Floyd [Sat, 11 Mar 2023 05:49:13 +0000 (06:49 +0100)]
regtest: build failure on Linux ppc64le, missing header

22 months agoBug 436413 - Warn about realloc of size zero
Paul Floyd [Fri, 10 Mar 2023 20:55:14 +0000 (21:55 +0100)]
Bug 436413 - Warn about realloc of size zero

Adds a new warning to memcheck when realloc is used with a size of 0.
For a long time this has been "implementation defined" and so
non-portable. With C23 it will become UB.

Also adds a switch to turn off the error generation and a
second switch to select between the most common
"implementation" behaviours. The defaults for this second
switch are baked in at build time.

22 months agoRename memcheck/tests/sized_aligned_new_delete_args.stderr.exp-glibc
Paul Floyd [Fri, 10 Mar 2023 17:41:26 +0000 (18:41 +0100)]
Rename memcheck/tests/sized_aligned_new_delete_args.stderr.exp-glibc

It's for GCC / libstdc++ really

22 months agodarwin regtest: fix unused variable warning
Paul Floyd [Fri, 10 Mar 2023 17:39:05 +0000 (18:39 +0100)]
darwin regtest: fix unused variable warning

Copied and paster from old posix_memalign test

22 months agoMised one aligned alloc wrapper on Linux
Paul Floyd [Fri, 10 Mar 2023 07:40:40 +0000 (08:40 +0100)]
Mised one aligned alloc wrapper on Linux

Need different expected for GCC / libstdc++

And I think that the 32bit expected will also need updating.

22 months agoMalloc replacements: add some C++14/17 comments
Paul Floyd [Thu, 9 Mar 2023 19:58:12 +0000 (20:58 +0100)]
Malloc replacements: add some C++14/17 comments

Rearrange the code to group C++ 14 operator deeltes together.

22 months agoregtest: try to fix bad merge of memalign_args expected on ppc64
Paul Floyd [Thu, 9 Mar 2023 07:31:12 +0000 (08:31 +0100)]
regtest: try to fix bad merge of memalign_args expected on ppc64

22 months agoregtest: update sized_aligned_new_delete_args expected
Paul Floyd [Thu, 9 Mar 2023 07:02:19 +0000 (08:02 +0100)]
regtest: update sized_aligned_new_delete_args expected

Don't quite understand how I managed to generate the original
expected.

22 months agoMake operator new aligned more like the standalone versions
Paul Floyd [Wed, 8 Mar 2023 22:10:22 +0000 (23:10 +0100)]
Make operator new aligned more like the standalone versions

If the alignment is not a power of two return nullptr for the
nothrow overload and bomb for the throwing overload.

22 months agoregtest: add an arm expected for memalign_args
Paul Floyd [Wed, 8 Mar 2023 20:33:36 +0000 (21:33 +0100)]
regtest: add an arm expected for memalign_args

22 months agoregtest: fix warning in memalign_args and add debug info to sized_aligned_new_delete_args
Paul Floyd [Wed, 8 Mar 2023 07:59:38 +0000 (08:59 +0100)]
regtest: fix warning in memalign_args and add debug info to sized_aligned_new_delete_args

22 months agoauxchecks: fix building on FreeBSD
Paul Floyd [Tue, 7 Mar 2023 22:49:22 +0000 (23:49 +0100)]
auxchecks: fix building on FreeBSD

FreeBSD has a sha256sum that doesn't take long args (--check)
GNU sha256sum exists as gsha256sum so add a check for that to
configure.ac

22 months agoFix compile failure on Linux
Paul Floyd [Tue, 7 Mar 2023 22:19:04 +0000 (23:19 +0100)]
Fix compile failure on Linux

Use SizeT rather than size_t
Also make tests quieter with -q

22 months agoAdd 32bit version of sized_aligned_new_delete_args expected
Paul Floyd [Tue, 7 Mar 2023 21:58:57 +0000 (22:58 +0100)]
Add 32bit version of sized_aligned_new_delete_args expected

Asl add some parens to shut up clangd

22 months agoAdd checks to all new / delete overload arguments
Paul Floyd [Tue, 7 Mar 2023 21:47:19 +0000 (22:47 +0100)]
Add checks to all new / delete overload arguments

22 months agoauxchecks: use outer configure make and compilers
Paul Floyd [Tue, 7 Mar 2023 07:00:03 +0000 (08:00 +0100)]
auxchecks: use outer configure make and compilers

On FreeBSD the hard coded 'make' will switch to BSD make rather
than the outer configure make - GNU make.

Similarly for systems with gcc and clang installed then an outer
'configure CC=clang' and then make auxchecks doesn't propagate
the CC to the inner gsl configure, which will use gcc.

Still need some work on the tarball checksum calculation.

22 months agoBug 466104 - aligned_alloc problems, part 1
Paul Floyd [Mon, 6 Mar 2023 20:50:01 +0000 (21:50 +0100)]
Bug 466104 - aligned_alloc problems, part 1

I think that these are all now done.
This commit refactors memalign and updates manual-core.xml
to say some behaviour of Valgrind depends on the build time
OS and libraries.

22 months agoLinux musl: fix code refactor that missed one usage
Paul Floyd [Sun, 5 Mar 2023 16:41:27 +0000 (17:41 +0100)]
Linux musl: fix code refactor that missed one usage

22 months agoDarwin regtest: again, forgot to delete errno
Paul Floyd [Sun, 5 Mar 2023 16:22:59 +0000 (17:22 +0100)]
Darwin regtest: again, forgot to delete errno

Setting errno on Darwin not supported on Valgrind.

22 months agoDarwin regtest: remove test that aligned_alloc fails with huge alignment
Paul Floyd [Sun, 5 Mar 2023 16:20:23 +0000 (17:20 +0100)]
Darwin regtest: remove test that aligned_alloc fails with huge alignment

Needs more debugging.

22 months agoLinux musl: one more iteration for aligned_alloc, assert in wrong place
Paul Floyd [Sun, 5 Mar 2023 15:49:12 +0000 (16:49 +0100)]
Linux musl: one more iteration for aligned_alloc, assert in wrong place

22 months agoLinux musl: corrections for aligned_alloc test
Paul Floyd [Sun, 5 Mar 2023 15:43:25 +0000 (16:43 +0100)]
Linux musl: corrections for aligned_alloc test

22 months agoFix a compiler warning
Paul Floyd [Sun, 5 Mar 2023 15:34:50 +0000 (16:34 +0100)]
Fix a compiler warning

22 months agoLinux musl: alligned_alloc accepts alignment of zero
Paul Floyd [Sun, 5 Mar 2023 15:30:44 +0000 (16:30 +0100)]
Linux musl: alligned_alloc accepts alignment of zero

22 months agoSolaris regtest: final iteration for aligned_alloc
Paul Floyd [Sun, 5 Mar 2023 15:24:44 +0000 (16:24 +0100)]
Solaris regtest: final iteration for aligned_alloc

22 months agoSolaris: bump alignment to next power of two for aligned_alloc
Paul Floyd [Sun, 5 Mar 2023 15:13:09 +0000 (16:13 +0100)]
Solaris: bump alignment to next power of two for aligned_alloc

I'm not changing the Valgrind allocator to fit Solaris, too bad.

22 months agoSolaris: copy paste error in alignment check for aligned_alloc
Paul Floyd [Sun, 5 Mar 2023 15:01:23 +0000 (16:01 +0100)]
Solaris: copy paste error in alignment check for aligned_alloc

22 months agoSolaris: adapt to aligned_alloc only enforcing a multiple of 4
Paul Floyd [Sun, 5 Mar 2023 14:42:39 +0000 (15:42 +0100)]
Solaris: adapt to aligned_alloc only enforcing a multiple of 4

22 months agoMake aligned_alloc behave more like the underlying platform aligned_alloc
Paul Floyd [Sun, 5 Mar 2023 14:25:51 +0000 (15:25 +0100)]
Make aligned_alloc behave more like the underlying platform aligned_alloc

This is the third part of
Bug 466104 aligned_alloc problems, part 1

Shouldn't affect Linux glibc.

22 months agoBug 449309 - Missing loopback device ioctl(s)
Paul Floyd [Sun, 5 Mar 2023 07:38:34 +0000 (08:38 +0100)]
Bug 449309 -  Missing loopback device ioctl(s)

Patch provided by:
    Faheem Sheikh <faheem.sheikh@bmw.de>

Note that the testcase provided with this report hasn't
been added as it requires privileges.

22 months agoLinux PPC regtest: forgot to add the new expected
Paul Floyd [Wed, 1 Mar 2023 07:20:46 +0000 (08:20 +0100)]
Linux PPC regtest: forgot to add the new expected

22 months agoLinux PPC regtest: add a specific expected for memalign_args
Paul Floyd [Wed, 1 Mar 2023 07:18:09 +0000 (08:18 +0100)]
Linux PPC regtest: add a specific expected for memalign_args

The number of errors for arguments that gets triggered depends
on how GCC optimzes and generates code for the vg_replace_malloc.c
wrappers. PPC seems to trigger more than amd64.

22 months agoDarwin regtest: no malloc.h header on Darwin
Paul Floyd [Wed, 1 Mar 2023 06:42:43 +0000 (07:42 +0100)]
Darwin regtest: no malloc.h header on Darwin

22 months agoTypo in comment
Paul Floyd [Tue, 28 Feb 2023 22:27:22 +0000 (23:27 +0100)]
Typo in comment

22 months agoFix Darwin compilation
Paul Floyd [Tue, 28 Feb 2023 21:58:14 +0000 (22:58 +0100)]
Fix Darwin compilation

Removed memalign wrapper on Darwin, so valloc can't use it any more.

22 months agoBug 445743 - "The impossible happened: mutex is locked simultaneously by two threads...
Paul Floyd [Tue, 28 Feb 2023 21:17:25 +0000 (22:17 +0100)]
Bug 445743 - "The impossible happened: mutex is locked simultaneously by two threads" while using mutexes with priority inheritance and signals

Been using the same fix in FreeBSD for quite a while, so I think
it's safe to apply to Linux and close the bugzi item.

22 months agoRemove unused helgrind expected
Paul Floyd [Tue, 28 Feb 2023 20:52:54 +0000 (21:52 +0100)]
Remove unused helgrind expected

I don't think that this can match any more.

22 months agoChange behaviour of posix_memalign for Solaris
Paul Floyd [Tue, 28 Feb 2023 20:21:05 +0000 (21:21 +0100)]
Change behaviour of posix_memalign for Solaris

It returns NULL and 0 status whilst most other platforms
allocatae some undefined amount of memory (which is allowed
by posix).

Update the posix_memalign test as well.

Finally remove some clang warnings about alignment.

22 months agoPut back Darwin zone memalign
Paul Floyd [Tue, 28 Feb 2023 18:56:52 +0000 (19:56 +0100)]
Put back Darwin zone memalign

I had another look at the XNU source and this does seem to exist.
The manpage says that it is the zone version of posix_memalign,
though that's probably more because Darwin has no memalign.

22 months agoMake memalign behave more like the underlying platform memalign
Paul Floyd [Tue, 28 Feb 2023 12:17:24 +0000 (13:17 +0100)]
Make memalign behave more like the underlying platform memalign

This is the first part of
Bug 466104 aligned_alloc problems, part 1

The bulk of this change is try try to get memalign to be more
platform aware. Previously the Valgrind implementation only
reflected the glibc implementation. That meant non-power of
two alignment values would silently get bumped up to the
next largest power of two. Most other platforms return NULL
and set errno to EINVAL.

There are a few other changes. A couple of the other aligned alloc
functions like valloc were caling the Valgrind memalign. This meant
that there weould be an extra Valgrind memalign in any error
callstacks. Now these functions call the allocator directly.

The memcheck memalign2 testcase has been redone. The memalign
parts moved out to per-platform versions and the tescase
itdelf renamed to posix_memalign, since that is all that is left.
I also modified the testcase so that it checks that the
memalign calls check for non-NULL returns, and on platforms
that set errno that it is correctly set. Previously the
test only worked on non-glibc because NULL & alignment is
zero.  The platform versions have been tested on glibc,
MUSL, FreeBSD and OpenIndiana and should hopefully run OK
both under memcheck and standalone.

There is stil quite a lot that is NOT done

1. I'm not certain that implementations allocate more memory
   and/or use a wider alignment. It doesn't help that almost
   universally the memalign implementations are badly
   documented, undocumented or buggy.
2. We don't handle very large alignment requests well.
   Most implementations will fail and set EINVAL if the
   alignment is over half the memory space. Valgrind will
   core panic if an aligmnt of over 16Mbytes is requested.
3. We don't generate any memcheck errors for invalid values
   of alignment. That's planned in Part 2.
4. The code is static and fixed at compile time. That means that
   if you are using MUSL with a glibc-built Valgrind you
   will still get glibc memalign behaviour.
   I'll wait to see if there are any requests before trying
   to make the behaviour selectable at runtime.

22 months agoAnd here is the updated expected for FreeBSD scalar x86 mknodat
Paul Floyd [Sat, 25 Feb 2023 15:12:14 +0000 (16:12 +0100)]
And here is the updated expected for FreeBSD scalar x86 mknodat

22 months agoFreeBSD mknodat syscall dev arg is 64bits so the syscall needs splitting into amd64...
Paul Floyd [Sat, 25 Feb 2023 15:09:41 +0000 (16:09 +0100)]
FreeBSD mknodat syscall dev arg is 64bits so the syscall needs splitting into amd64 and x86 versions

22 months agoSmall update to FreeBSD x86 scalar expected
Paul Floyd [Sat, 25 Feb 2023 15:08:40 +0000 (16:08 +0100)]
Small update to FreeBSD x86 scalar expected

22 months agoFreeBSD: make rfork() fail more gracefully
Paul Floyd [Sat, 25 Feb 2023 14:16:35 +0000 (15:16 +0100)]
FreeBSD: make rfork() fail more gracefully

rfork() is barely used in base FreeBSD. The main use
is in posix_spawn(). If rfork() fails with EINVAL
then it falls back to using vfork(). This is preferable
to Valgrind bombing.

ksh93 uses posix_spawn. I tested bash and csh and they had
no problems.

Also add 'hello world" smoke tests for bash csh and ksh

22 months agobug465435 - m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit...
Paul Floyd [Fri, 24 Feb 2023 20:31:35 +0000 (21:31 +0100)]
bug465435 - m_libcfile.c:66 (vgPlain_safe_fd): Assertion 'newfd >= VG_(fd_hard_limit)' failed.

22 months agoOne small typo
Paul Floyd [Thu, 23 Feb 2023 21:15:59 +0000 (22:15 +0100)]
One small typo

22 months agomusl regtest : fix warnings and badly initialized struct msghdr
Paul Floyd [Tue, 21 Feb 2023 22:05:22 +0000 (23:05 +0100)]
musl regtest : fix warnings and badly initialized struct msghdr

22 months agoTry to correct configure script for warning flags with values
Paul Floyd [Tue, 21 Feb 2023 21:05:13 +0000 (22:05 +0100)]
Try to correct configure script for warning flags with values

Some -W flags come with and without an =
(usually for warning levels)
But some only have the form -Wfoo=42 and -Wno-foo

22 months agomusl: fix a couple of warnings
Paul Floyd [Tue, 21 Feb 2023 20:29:18 +0000 (21:29 +0100)]
musl: fix a couple of warnings

musl doesn't have sys/poll.h

GCC moans and then uses poll.h

On glibc linux and FreeBSD poll.h is a symlink to sys/poll.h
Illumos poll.h includes sys/poll.h

22 months agoregtest: remove compiler warnings with clang
Paul Floyd [Sun, 19 Feb 2023 09:10:59 +0000 (10:10 +0100)]
regtest: remove compiler warnings with clang

22 months agoDRD aarch64: Add some suppressions for DRD libstdc++
Paul Floyd [Fri, 17 Feb 2023 21:25:41 +0000 (22:25 +0100)]
DRD aarch64: Add some suppressions for DRD libstdc++

Also fix building drd/tests/std_mutex, needs -pthread.

23 months agoREADME_DEVELOPERS: Explain how to set VALGRIND_LIB to gdb valgrind
Mark Wielaard [Thu, 16 Feb 2023 12:44:08 +0000 (13:44 +0100)]
README_DEVELOPERS: Explain how to set VALGRIND_LIB to gdb valgrind

23 months agoDarwin: try to fix assert in DRD
Paul Floyd [Wed, 8 Feb 2023 21:54:57 +0000 (22:54 +0100)]
Darwin: try to fix assert in DRD

The hard coded memory mapping trigger drd_start_using_mem_w_perms
which will lead to tl_assert(vg_tid != VG_INVALID_THREADID);

But vg_tid was just set to VG_INVALID_THREADID before the
hard coded memory map.

23 months agoRegtest: rationalize filters for new/delete
Paul Floyd [Sun, 5 Feb 2023 11:50:13 +0000 (12:50 +0100)]
Regtest: rationalize filters for new/delete

23 months agoDarwin regtest: add filtering for zone functions and realloc
Paul Floyd [Sun, 5 Feb 2023 10:35:28 +0000 (11:35 +0100)]
Darwin regtest: add filtering for zone functions and realloc

For test of C++17 new/delete variations

23 months agoDRD regtest: try to make timed_mutex more reliable
Paul Floyd [Fri, 3 Feb 2023 18:27:39 +0000 (19:27 +0100)]
DRD regtest: try to make timed_mutex more reliable

On RHEL 7.6 ARM I see this with the lock returning false
but without the 11 second timeout. Try adding some sleeps.

23 months agoDRD regtest: try to make timed_mutex more reliable
Paul Floyd [Fri, 3 Feb 2023 18:27:39 +0000 (19:27 +0100)]
DRD regtest: try to make timed_mutex more reliable

On RHEL 7.6 ARM I see this with the lock returning false
but without the 11 second timeout. Try adding some sleeps.

23 months agoDRD regtesat: update suppression file for std_threads2
Paul Floyd [Fri, 3 Feb 2023 18:10:50 +0000 (19:10 +0100)]
DRD regtesat: update suppression file for std_threads2

On RHEL 7.6 ARM glibc 2.17 is used which doesn't match the 2.2*
wildard, so widen the wildcard to just 2.*

23 months agoFreeBSD: fix internal sysctlbyname
Paul Floyd [Fri, 3 Feb 2023 12:51:04 +0000 (13:51 +0100)]
FreeBSD: fix internal sysctlbyname

I used the libc interface rather than the syscall interface.
The syscall also has the name length which libc adds.

23 months agoRegtest: foix warning from drd test pth_mutex_signal.c
Paul Floyd [Fri, 3 Feb 2023 12:48:22 +0000 (13:48 +0100)]
Regtest: foix warning from drd test pth_mutex_signal.c

GCC on RHEL 7.6 ARM complains about the empty init list.

I also noticed that we are using the SA_NOTIFY form of sigaction
(with that union member and handler prototype) but not setting the
SA_NOTIFY flag. Seems harmless in this case as we don't use
the siginfo or context.

23 months agoFreeBSD: improve internal syscallbyname
Paul Floyd [Thu, 2 Feb 2023 21:06:38 +0000 (22:06 +0100)]
FreeBSD: improve internal syscallbyname

Post FreeBSD 12.2 this is a syscall that does everything
(rather than needing an undocumented syscall).

23 months agoGDB regtest: add filter for gdb python load, RHEL 7.4 ARM
Paul Floyd [Thu, 2 Feb 2023 20:51:21 +0000 (21:51 +0100)]
GDB regtest: add filter for gdb python load, RHEL 7.4 ARM

23 months agoAdd valgrind-monitor[-def].py to EXTRA_DIST
Mark Wielaard [Wed, 1 Feb 2023 22:52:59 +0000 (23:52 +0100)]
Add valgrind-monitor[-def].py to EXTRA_DIST

So as to make sure these get copied into the tarball.
Fixes make distcheck.

23 months agoFreeBSD: cleanup launcher
Paul Floyd [Wed, 1 Feb 2023 20:45:46 +0000 (21:45 +0100)]
FreeBSD: cleanup launcher

cppcheck spotted a bug in the skipping of whitespace between shebang
and interpreter command. This could potentially cause the platform
to be misidentified (for x86 on amd64).

23 months agoPack Lackey Event structure
Paul Floyd [Wed, 1 Feb 2023 20:44:31 +0000 (21:44 +0100)]
Pack Lackey Event structure

Seen by cppcheck. Will reduced size from 4 to 3 words on 64bit platforms.

23 months agoFreeBSD: cleanup and refactor syscalls readlink and readlinkat
Paul Floyd [Tue, 31 Jan 2023 20:52:36 +0000 (21:52 +0100)]
FreeBSD: cleanup and refactor syscalls readlink and readlinkat

There was some code to handle /proc/curproc/file (a symlink to
the exe that wee need to bodge as it refers to the tool exe).
But it was neither tested nor working.

Can't use the same technique as Linux and Solaris which have more
complete /proc filesystems where each pid has symlinks for
each open file, which we use for the guest. Instead need to
copy the path ourselves. So move sys_readlink out of generic.

Simplify the handling of the resolved guest exe name - store it in
a global like VG_(args_the_exename).

23 months agoRemove warning caused by D demangle testcase
Paul Floyd [Mon, 30 Jan 2023 20:13:13 +0000 (21:13 +0100)]
Remove warning caused by D demangle testcase

23 months agobug464969_d_demangle.cpp: Always print "Xa"
Mark Wielaard [Mon, 30 Jan 2023 09:21:01 +0000 (10:21 +0100)]
bug464969_d_demangle.cpp: Always print "Xa"

bug464969_d_demangle depends on producing an error about an
uninitialized variable. But it prints something different
to stdout based on the value of that variable. Which can
produce failures. Make sure to always print the same thing
to stdout.

23 months agodrd/tests/pth_mutex_signal: Port to Darwin
Bart Van Assche [Sun, 29 Jan 2023 22:42:17 +0000 (14:42 -0800)]
drd/tests/pth_mutex_signal: Port to Darwin

This patch includes a revert of commit 2e873534bb49 ("macOS: drd
pth_mutex_signal test doesn't build").

23 months agoBug 464969 - D language demangling
Paul Floyd [Sun, 29 Jan 2023 21:05:27 +0000 (22:05 +0100)]
Bug 464969 -  D language demangling

    Patch from witold.baryluk@gmail.com

(also added a testcase)

23 months agomacOS: drd pth_mutex_signal test doesn't build
Paul Floyd [Sun, 29 Jan 2023 17:00:59 +0000 (18:00 +0100)]
macOS: drd pth_mutex_signal test doesn't build

pth_mutex_signal.c:50:13: error: use of undeclared identifier 'SIGRTMAX'
  sigaction(NATIVE_IO_INTERRUPT_SIGNAL, &signalAction, NULL);

Put this target under a condition for the moment.

23 months agoCompiler warning expansion to defined
Paul Floyd [Sun, 29 Jan 2023 16:49:11 +0000 (17:49 +0100)]
Compiler warning expansion to defined

Clang doesn't like
m_debuginfo/tinfl.c:182:45: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined]

23 months agomacOS: Try to fix build, doesn't like .debug_gdb_scripts
Paul Floyd [Sun, 29 Jan 2023 16:35:08 +0000 (17:35 +0100)]
macOS: Try to fix build, doesn't like .debug_gdb_scripts

23 months agoRemove one lingering trace of tilegx
Paul Floyd [Sat, 28 Jan 2023 21:08:29 +0000 (22:08 +0100)]
Remove one lingering trace of tilegx

23 months agotsan_thread_wrappers_pthread.h: Only include cstdint for C++11
Mark Wielaard [Sat, 28 Jan 2023 20:53:44 +0000 (21:53 +0100)]
tsan_thread_wrappers_pthread.h: Only include cstdint for C++11

Fixes build on older g++.

23 months agoconfigure.ac: Update AC_PROG_CC checks
Mark Wielaard [Sat, 28 Jan 2023 20:11:35 +0000 (21:11 +0100)]
configure.ac: Update AC_PROG_CC checks

AM_PROG_CC_C_O has been obsolete since automake 1.14.
AC_PROG_CC does the same check. With autoconf 2.70 we
must use AC_PROG_CC (which will check for c11 and c99),
for earlier versions we'll use AC_PROG_CC_C99.

23 months agoIllumos: regtest filters and gitignore
Paul Floyd [Sat, 28 Jan 2023 17:27:16 +0000 (18:27 +0100)]
Illumos: regtest filters and gitignore

Filter for the gdb python autoload warnings
Filter for another variation of shell abort messages

23 months agoRegtest: broaden suppression for helgrind bug 392331
Paul Floyd [Fri, 27 Jan 2023 19:00:26 +0000 (20:00 +0100)]
Regtest: broaden suppression for helgrind bug 392331

Inlining differences on different Linux platforms.

23 months agoBug 382034 - Testcases build fixes for musl
Paul Floyd [Fri, 27 Jan 2023 07:42:06 +0000 (08:42 +0100)]
Bug 382034 - Testcases build fixes for musl

23 months agoBug 464859 - Build failures with GCC-13 (drd tsan_unittest)
Paul Floyd [Fri, 27 Jan 2023 07:30:41 +0000 (08:30 +0100)]
Bug 464859 - Build failures with GCC-13 (drd tsan_unittest)

Patch submitted by
Khem Raj <raj.khem@gmail.com>

23 months agoLinux regtest: some extra filtering for helgrind bug392331
Paul Floyd [Fri, 27 Jan 2023 07:22:19 +0000 (08:22 +0100)]
Linux regtest: some extra filtering for helgrind bug392331

Was failing on rhel 7.6

23 months agoLinux regtest: forgot prereq test for scalar_openat2
Paul Floyd [Fri, 27 Jan 2023 06:40:31 +0000 (07:40 +0100)]
Linux regtest: forgot prereq test for scalar_openat2

23 months agoFreeBSD: update comment about __sysctlbyname and kern.proc.pathname
Paul Floyd [Wed, 25 Jan 2023 07:31:09 +0000 (08:31 +0100)]
FreeBSD: update comment about __sysctlbyname and kern.proc.pathname

23 months agoFreeBSD: fix compile of auxv on FreeBSD 12
Paul Floyd [Tue, 24 Jan 2023 21:00:44 +0000 (22:00 +0100)]
FreeBSD: fix compile of auxv on FreeBSD 12

23 months agoFreeBSD: fix build on older OSes
Paul Floyd [Tue, 24 Jan 2023 20:54:09 +0000 (21:54 +0100)]
FreeBSD: fix build on older OSes

A bad copy-and-paste broke compilation on FreeBSD 12.

23 months agoFreeBSD: remove different reserved fds number
Paul Floyd [Tue, 24 Jan 2023 20:03:48 +0000 (21:03 +0100)]
FreeBSD: remove different reserved fds number

No idea where it originated. Causes no problems on
FreeBSD 13.1 amd64.

23 months agoFreeBSD: switch to FreeBSD 12 versions of syscalls for fstat etc
Paul Floyd [Tue, 24 Jan 2023 19:38:26 +0000 (20:38 +0100)]
FreeBSD: switch to FreeBSD 12 versions of syscalls for fstat etc

This was a change that enabled 64bit inodes (ino64).

Also a couple of typos in READMEs.

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