]> git.ipfire.org Git - thirdparty/valgrind.git/log
thirdparty/valgrind.git
6 months agoMinor changes to the documentation and commends related to demangling.
Philippe Waroquiers [Wed, 25 Dec 2024 15:08:04 +0000 (16:08 +0100)] 
Minor changes to the documentation and commends related to demangling.

6 months agoregtest: callgrind bug497723 again, order of output can vary
Paul Floyd [Mon, 23 Dec 2024 08:22:45 +0000 (09:22 +0100)] 
regtest: callgrind bug497723 again, order of output can vary

The filter was picking up two mangled names but the order
of thw two can vary between systems. So just filter one of them.

6 months agoregtest: add check for -Wl,--no-warn-execstack
Paul Floyd [Sun, 22 Dec 2024 15:49:11 +0000 (16:49 +0100)] 
regtest: add check for -Wl,--no-warn-execstack

6 months agoAdd missing zstd.h to coregrind Makefile.am noinst_HEADERS
Florian Krohm [Sun, 22 Dec 2024 09:53:03 +0000 (10:53 +0100)] 
Add missing zstd.h to coregrind Makefile.am noinst_HEADERS

The header was missing from dist tarballs

6 months agoBug 497723 - tweak awk filter in regtest
Paul Floyd [Sun, 22 Dec 2024 07:37:12 +0000 (08:37 +0100)] 
Bug 497723 - tweak awk filter in regtest

6 months agoBug 497723 - forgot to restore callgrind output cleanup
Paul Floyd [Sat, 21 Dec 2024 20:32:19 +0000 (21:32 +0100)] 
Bug 497723 - forgot to restore callgrind output cleanup

6 months agoCommand line help - demangling isn't just for C++
Paul Floyd [Sat, 21 Dec 2024 20:30:45 +0000 (21:30 +0100)] 
Command line help - demangling isn't just for C++

Make the first line generic and add a list of languages
that are suppoted.

6 months agoBug 497723 - improve filter
Paul Floyd [Sat, 21 Dec 2024 20:27:23 +0000 (21:27 +0100)] 
Bug 497723 - improve filter

Just print out the function names. Previously it was unstable.

6 months agoBug 497723 - Enabling Ada demangling breaks callgrind differentiation between overloa...
Paul Floyd [Sat, 21 Dec 2024 19:46:40 +0000 (20:46 +0100)] 
Bug 497723 - Enabling Ada demangling breaks callgrind differentiation between overloaded functions and procedures

6 months agoregtest: turn off exec stack warning
Paul Floyd [Sat, 21 Dec 2024 16:18:35 +0000 (17:18 +0100)] 
regtest: turn off exec stack warning

Rather than turning off exec stack.

6 months agoImplement the new GDB 16.0 'x addr,len' packet.
Philippe Waroquiers [Sat, 21 Dec 2024 14:45:20 +0000 (15:45 +0100)] 
Implement the new GDB 16.0 'x addr,len' packet.

GDB can read memory faster with this packet than with the 'm addr,len' packet.

6 months agoVEX/priv/ir_opt.c: Also fold Iop_And1 expressions when possible
Mark Wielaard [Sun, 15 Dec 2024 20:26:21 +0000 (21:26 +0100)] 
VEX/priv/ir_opt.c: Also fold Iop_And1 expressions when possible

Treat Iop_And1 just like And16/And32/And64. Fold fully constant And1
expressions and handle And1(x,True), And1(True,x), And1(x,False),
And1(False,x) and And1(x,x).

Make sure isOnesU handles Ico_U1 (isZerosU and sameIRExprs already
did).

https://bugs.kde.org/show_bug.cgi?id=468575#c52

6 months agoUse Ints for fds in PRE and POST sys_close_range
Mark Wielaard [Sat, 14 Dec 2024 22:34:12 +0000 (22:34 +0000)] 
Use Ints for fds in PRE and POST sys_close_range

The double_close_range test failed on riscv64-linux because the
close_range wrapper is using unsigned int and the ARG regwords
directly. Which causes the ARG2 == ~0U check to fail. Explicitly
using Int for the fd arguments fixes this. I am not clear on why
this was only an issue for the riscv port. It seems this patch is
OK for other arches (tested on amd64 and i386).

6 months agoAdd 469782 to NEWS
Paul Floyd [Tue, 17 Dec 2024 19:14:05 +0000 (20:14 +0100)] 
Add 469782 to NEWS

6 months agoBug 497455 - Update drd/scripts/download-and-build-gcc
Paul Floyd [Sun, 15 Dec 2024 14:10:33 +0000 (15:10 +0100)] 
Bug 497455 - Update drd/scripts/download-and-build-gcc

The other script also are likely to need some attention.
This one is probably the most useful for users that want to test OpenMP
aplications with DRD or Helgrind.

6 months agoFreeBSD: add a suppression for reachable from __cxa_exit
Paul Floyd [Sat, 14 Dec 2024 06:31:30 +0000 (07:31 +0100)] 
FreeBSD: add a suppression for reachable from __cxa_exit

6 months agoFreeBSD regtest: update getrlimit for FreeBSD 14.2
Paul Floyd [Tue, 10 Dec 2024 07:49:04 +0000 (08:49 +0100)] 
FreeBSD regtest: update getrlimit for FreeBSD 14.2

More output and memory counts are quite variable.

6 months agoRecognize new DWARF5 DW_LANG constants
Mark Wielaard [Fri, 6 Dec 2024 14:39:25 +0000 (15:39 +0100)] 
Recognize new DWARF5 DW_LANG constants

When using --read-var-info=yes readdwarf3 will try to read and
interpret the CU DW_AT_langauge attribute. Since DWARF5 was released a
number if new language constants have been introduced. See
https://dwarfstd.org/languages.html

GCC15 might start emitting some of these when switching to C23 by
default.

When valgrind --read-var-info=yes encounters an unknown DW_LANG
constant it will produce an error and stop processing any further
DWARF.

Recognize all currently known language constants. In particular
recognize DW_LANG_C17, DW_LANG_C23, DW_LANG_C_plus_plus_17,
DW_LANG_C_plus_plus_20, DW_LANG_C_plus_plus_23, DW_LANG_Fortran18,
DW_LANG_Fortran23, DW_LANG_Ada2005, DW_LANG_Ada2012 and DW_LANG_Rust.

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

6 months agoregtest: fix a warning building none/tests/nestedfns on some platforms
Paul Floyd [Fri, 6 Dec 2024 20:24:50 +0000 (21:24 +0100)] 
regtest: fix a warning building none/tests/nestedfns on some platforms

6 months agos390x: Update instruction list with arch15 insns
Andreas Arnez [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
s390x: Update instruction list with arch15 insns

Recent commits in Binutils added arch15 instructions to s390-opc.txt.
Since then, the script s390-check-opcodes.pl complains about many insns
that are not known to Valgrind.

Update Valgrind's instruction list to be in synch with Binutils again.
Add the new instructions to s390-opcodes.csv and declare them as "not
implemented".

6 months agoBug 495817 - s390x: Fix disassembly for SEL[G]R and SELFHR
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
Bug 495817 - s390x: Fix disassembly for SEL[G]R and SELFHR

The disassemblies of selr, selgr, and selfhr have their register operands
mixed up, and no extended mnemonics are used.  Fix this.

6 months agoBug 495817 - s390x: Fix disassembly for compare-and-branch/trap insns
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
Bug 495817 - s390x: Fix disassembly for compare-and-branch/trap insns

The insns C[L][G]R[BJ], C[L][G]I[BJ], CL[G]T, and CL[FG]IT are
disassembled incorrectly.  Fix this.

Replace s390_format_RIEv1 with s390_format_R0UU and s390_format_R0IU.
Handling both a signed and unsigned immediate constant field with the same
s390_format_... function does not work.

Add function s390_format_RSY_R0RD for CLT and CLGT.  Those opcodes have
extended mnemonics.  So adjusting the formerly used s390_format_RSY_RURD
wasn't an option as that function is also used for CLM[HY], STCM[HY], and
ICM[HY] which don't have extended mnemonics.

6 months agoBug 495817 - s390x: Fix disassembly for BC[R], BR[C]L, and BIC
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
Bug 495817 - s390x: Fix disassembly for BC[R], BR[C]L, and BIC

The disassembly of the conditional branch insns bc, bcr, brl, brcl, and
bic differs from objdump's output.  Some examples:

*** mismatch VEX: |bic 20,0|               vs objdump: |bic      0,20|
*** mismatch VEX: |bic 20(%r6),0|          vs objdump: |bic      0,20(%r6)|
*** mismatch VEX: |bic 20(%r4),0|          vs objdump: |bic      0,20(%r4,%r0)|
*** mismatch VEX: |bih 20(%r12)|           vs objdump: |bih      20(%r12,%r0)|
*** mismatch VEX: |nopr|                   vs objdump: |nopr     %r6|
*** mismatch VEX: |b         12(%r11)|     vs objdump: |b        12(%r11,%r0)|
*** mismatch VEX: |blh       12(%r11)|     vs objdump: |blh      12(%r11,%r0)|
*** mismatch VEX: |brc       0,.+0|        vs objdump: |jnop     c|
*** mismatch VEX: |brcl      0,.+0|        vs objdump: |jgnop    c|

All fixed with this patch.

Note that the issue with the base register sometimes being suppressed
affects various other insns as well.

6 months agoBug 495817 - s390x: Disassemble cksm, mvcl, and clcl
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
Bug 495817 - s390x: Disassemble cksm, mvcl, and clcl

There is no output from the disassembler for cksm, mvcl, and clcl.  Fix
this.

6 months agoBug 495816 - s390x: Fix disassembler segfault for C[G]RT and CL[G]RT
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
Bug 495816 - s390x: Fix disassembler segfault for C[G]RT and CL[G]RT

The function s390_format_RRF_U0RR() is called with one of the following
xmnm_kind parameters:

   S390_XMNM_CAB     when constructing IR for C[G]RT or CL[G]RT
   S390_XMNM_LOCFHR  for LOCFHR
   S390_XMNM_LOCGR   for LOCGR
   S390_XMNM_LOCR    for LOCR

In all cases it invokes the disassembler without providing a mnemonic:

     if (UNLIKELY(vex_traceflags & VEX_TRACE_FE))
        s390_disasm(ENC3(XMNM, GPR, GPR), xmnm_kind, m3, r1, r2);

But in the first case s390_disasm() processes these arguments as if there
was one:

     case S390_XMNM_CAB:
        mnm  = va_arg(args, HChar *);  // <--- m3
        mask = va_arg(args, UInt);     // <--- r1
        p  += vex_sprintf(p, "%s", mnemonic(cab_operand(mnm, mask)));

Thus, m3 is interpreted as a string which then causes the segfault.

Fix this by

(1) replacing all of S390_XMNM_LOC* and S390_XMNM_STOC* by S390_XMNM_CLS,
(2) passing down the mnemonic to s390_disasm, and
(3) changing function cls_operand() to be symmetric with cab_operand() by
    also taking in the base mnemonic.

Apart from s390_format_RRF_U0RR(), further "load/store on condition"
instructions are handled via s390_format_RIE_RUPIX() and
s390_format_RSY_RDRM().  Adjust these functions accordingly as well.

6 months agos390x: Add `--check-formats' flag to s390-check-opcodes.pl
Florian Krohm [Wed, 4 Dec 2024 15:53:17 +0000 (16:53 +0100)] 
s390x: Add `--check-formats' flag to s390-check-opcodes.pl

Enhance the script s390-check-opcodes.pl: Add the command line option
`--check-formats' to print mismatches in the opcode formats between
guest_s390_toIR.c and s390-opc.txt.

6 months agoFix typo in FAQ.
Paul Floyd [Sun, 1 Dec 2024 20:13:18 +0000 (21:13 +0100)] 
Fix typo in FAQ.

7 months agoAdd bug 494246 to NEWS
Mark Wielaard [Tue, 26 Nov 2024 20:32:59 +0000 (21:32 +0100)] 
Add bug 494246 to NEWS

Bug 494246 syscall fsopen not wrapped was fixed in commit 4044bcea0.
"Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux
syswraps"

7 months agoAdd open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux syswraps
Mark Wielaard [Tue, 26 Nov 2024 18:00:34 +0000 (19:00 +0100)] 
Add open_tree, move_mount, fsopen, fsconfig, fsmount, fspick linux syswraps

Shared linux syscalls implementing various file system mount tasks.
Since linux kernel version 5.2.

Check arguments and track file descriptors.

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

7 months agoManual: C23 is now officially released
Paul Floyd [Tue, 26 Nov 2024 07:08:37 +0000 (08:08 +0100)] 
Manual: C23 is now officially released

7 months agoRemove standard headers from zstddeclib.c
Paul Floyd [Mon, 25 Nov 2024 20:27:56 +0000 (21:27 +0100)] 
Remove standard headers from zstddeclib.c

Not needed and safer without them.

7 months agoAdd support for landlock_create_ruleset (444), landlock_add_rule (445) and landlock_r...
Peter Seiderer [Mon, 8 Jul 2024 09:05:47 +0000 (11:05 +0200)] 
Add support for landlock_create_ruleset (444), landlock_add_rule (445) and landlock_restrict_self (446) syscalls

- add support for landlock_create_ruleset (444) syscall
- add support for landlock_add_rule (445) syscall
- add support for landlock_restrict_self (446) syscall

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

Signed-off-by: Peter Seiderer <ps.report@gmx.net>
7 months agocoregrind/m_gdbserver/server.h: define memcpy and memset to VG_ variants
Mark Wielaard [Sun, 24 Nov 2024 12:28:14 +0000 (13:28 +0100)] 
coregrind/m_gdbserver/server.h: define memcpy and memset to VG_ variants

Then use memset/memcpy in the coregrind/m_gdbserver code instead of
the VG_ variants.

7 months agoSolaris and Illumos: fix build due to use of memset in zstd code.
Paul Floyd [Sun, 24 Nov 2024 07:36:32 +0000 (08:36 +0100)] 
Solaris and Illumos: fix build due to use of memset in zstd code.

7 months agoAdd additional exp-ppc64le files to EXTRA_DIST
Paul Floyd [Sun, 24 Nov 2024 07:10:51 +0000 (08:10 +0100)] 
Add additional exp-ppc64le files to EXTRA_DIST

7 months agonone/tests/bug234814.c: sa_handler take an int as argument
Mark Wielaard [Sat, 23 Nov 2024 21:59:21 +0000 (22:59 +0100)] 
none/tests/bug234814.c: sa_handler take an int as argument

GCC15 will turn this warning into an error:

bug234814.c: In function 'main':
bug234814.c:20:18: error: assignment to '__sighandler_t' {aka 'void (*)(int)'} from incompatible pointer type 'void (*)(void)' [-Wincompatible-pointer-types]
   20 |    sa.sa_handler = mysigbus;
      |                  ^

7 months agodrd/tests/swapcontext.c: Rename typedef struct thread_local to threadlocal
Mark Wielaard [Sat, 23 Nov 2024 21:48:03 +0000 (22:48 +0100)] 
drd/tests/swapcontext.c: Rename typedef struct thread_local to threadlocal

Since C23 thread_local is a keyword (thread storage duration).

swapcontext.c:23:16: error: expected '{' before 'thread_local'
   23 | typedef struct thread_local {
      |                ^~~~~~~~~~~~
swapcontext.c:23:16: warning: 'thread_local' is not at beginning of declaration [-Wold-style-declaration]
swapcontext.c:23:16: error: 'thread_local' used with 'typedef'
swapcontext.c:26:3: warning: data definition has no type or storage class
   26 | } thread_local_t;
      |   ^~~~~~~~~~~~~~

7 months agohelgrind/tests/tc17_sembar.c: Remove bool typedef
Mark Wielaard [Sat, 23 Nov 2024 21:37:14 +0000 (22:37 +0100)] 
helgrind/tests/tc17_sembar.c: Remove bool typedef

Since C23 bool is a keyword. Also bool wasn't actually used.

tc17_sembar.c:45:14: error: both 'long' and '_Bool' in declaration specifiers
   45 | typedef long bool;
      |              ^~~~
tc17_sembar.c:45:1: warning: useless type name in empty declaration
   45 | typedef long bool;
      | ^~~~~~~

7 months agoAdd exp and supp patterns for missing main frame for ppc64le
Mark Wielaard [Sat, 23 Nov 2024 20:28:13 +0000 (21:28 +0100)] 
Add exp and supp patterns for missing main frame for ppc64le

In some cases on ppc64le we are missing the main frame.
Add alternative .exp-ppc64le variants for socket_close_xml,
fdleak_cmsg_xml and fdleak_ipv4_xml. And extra suppressions
without a main frame for fdleak_cmsg_supp.

See also commit 04d30049b "Filter away "main" differences in filter_fdleak"

7 months agoBug 496571 - False positive for null key passed to bpf_map_get_next_key syscall.
Ryan Mack [Sat, 23 Nov 2024 17:02:21 +0000 (18:02 +0100)] 
Bug 496571 - False positive for null key passed to bpf_map_get_next_key syscall.

No regtest added because BPF requires privileges. See the bugzilla item
for example usage.

7 months agoTurn off unused result warnings
Paul Floyd [Sat, 23 Nov 2024 07:14:15 +0000 (08:14 +0100)] 
Turn off unused result warnings

7 months agoFreeBSD: fix a few warnings when building with GCC
Paul Floyd [Sat, 23 Nov 2024 07:13:05 +0000 (08:13 +0100)] 
FreeBSD: fix a few warnings when building with GCC

7 months agoregtest: add a fdleak filter for write on write on linux arm64
Paul Floyd [Thu, 21 Nov 2024 07:44:04 +0000 (08:44 +0100)] 
regtest: add a fdleak filter for write on write on linux arm64

7 months agoHelgrind: fix unused result of write warnings
Paul Floyd [Thu, 21 Nov 2024 07:24:35 +0000 (08:24 +0100)] 
Helgrind: fix unused result of write warnings

Thanks to GCC deciding that we can't ignore wur annotated
functions by casting to void we need to do otherwise. It was
either pragmas or adding an annotated unused local. Pragmas
seem to be the least awful.

7 months agoBug 469782 - Valgrind does not support zstd-compressed debug sections
Mikhail Gorodetsky [Sun, 17 Nov 2024 20:14:17 +0000 (21:14 +0100)] 
Bug 469782 - Valgrind does not support zstd-compressed debug sections

7 months agodrd: Split handle_client_request()
Bart Van Assche [Mon, 18 Nov 2024 21:15:36 +0000 (13:15 -0800)] 
drd: Split handle_client_request()

Make handle_client_request() easier to read by splitting it into two
functions: one for Valgrind core client requests and one for thread-
related client requests.

7 months agodrd: Reorder functions
Bart Van Assche [Mon, 18 Nov 2024 21:08:29 +0000 (13:08 -0800)] 
drd: Reorder functions

Reorder two functions such that a forward declaration can be removed.

7 months agodrd: Remove a superfluous if-statement
Bart Van Assche [Mon, 18 Nov 2024 00:20:39 +0000 (16:20 -0800)] 
drd: Remove a superfluous if-statement

Check the client request ID once instead of twice.

7 months agoSolaris - fix a couple of warnings for message formatting
Paul Floyd [Sun, 17 Nov 2024 18:47:24 +0000 (19:47 +0100)] 
Solaris - fix a couple of warnings for message formatting

7 months agoIllumos regtest: turn off memcheck/tests/x86/bug487993
Paul Floyd [Sun, 17 Nov 2024 10:08:34 +0000 (11:08 +0100)] 
Illumos regtest: turn off memcheck/tests/x86/bug487993

For some reason GCC 13.3 on Illumos does not use aligned operator
new when compiling this testcase. So turn it off.

7 months agoarm: hook kcmp syscall
Lucas Stach [Thu, 14 Nov 2024 15:58:23 +0000 (16:58 +0100)] 
arm: hook kcmp syscall

7 months agocoregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy
Mark Wielaard [Thu, 14 Nov 2024 11:25:27 +0000 (12:25 +0100)] 
coregrind/m_gdbserver/remote-utils.c (prepare_resume_reply): Use memcpy

GCC8 (but apparently not later versions) complain about the use of
strncpy when not actually copying a string:

remote-utils.c:1140:14: warning: 'char* strncpy(char*, const char*, size_t)' output truncated before terminating nul copying 6 bytes from a string of the same length [-Wstringop-truncation]
          strncpy (buf, "watch:", 6);
          ~~~~~~~~^~~~~~~~~~~~~~~~~~

This is "harmless" because buf is large enough and we will add more
chars (including a zero terminator) later. But using strncpy here is a
bit odd because we don't really want to copy a string, but an array of
6 chars. So use memcpy here to do so, simplyfing the code.

7 months agoIllumos regtest: x86 mdb diffs wrt Solaris
Paul Floyd [Thu, 14 Nov 2024 07:57:37 +0000 (08:57 +0100)] 
Illumos regtest: x86 mdb diffs wrt Solaris

7 months agovgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write
Mark Wielaard [Tue, 12 Nov 2024 12:34:09 +0000 (13:34 +0100)] 
vgdb.c (fork_and_exec_valgrind): Fix another off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced another off-by-one issue trying to write
back the error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is when the child needs to do a chdir and that chdir fails. If
that happens the parent would have gotten the wrong error code.

7 months agovgdb.c (fork_and_exec_valgrind): Fix off-by-one error write
Mark Wielaard [Tue, 12 Nov 2024 12:23:03 +0000 (13:23 +0100)] 
vgdb.c (fork_and_exec_valgrind): Fix off-by-one error write

commit 646978d9adc5 ("vgdb: Handle EINTR and EAGAIN more
consistently") introduced an off-by-one issue trying to write back the
error from child to parent.

Instead of +1 it should have been +written (which initially is zero).

This is in an "should never happen" path, so hopefully didn't really
cause issues. But if it did happen the parent would have gotten the
wrong error code.

7 months agoIllumos regtest: updates in none/tests/amd64-solaris
Paul Floyd [Mon, 11 Nov 2024 08:23:34 +0000 (09:23 +0100)] 
Illumos regtest: updates in none/tests/amd64-solaris

Add a filter for an extra level in a callstack.
Add an expected for changed mdb output.

7 months agoAdd 494218 to NEWS
Paul Floyd [Sun, 10 Nov 2024 15:52:32 +0000 (16:52 +0100)] 
Add 494218 to NEWS

This went in 3.24.

7 months agoIllumos regtest: Add suppressions to none fdleak_cmsg_supp.supp
Paul Floyd [Sat, 9 Nov 2024 20:05:15 +0000 (21:05 +0100)] 
Illumos regtest: Add suppressions to none fdleak_cmsg_supp.supp

7 months agoIllumos regtest: filter more signal messages from bash
Paul Floyd [Sat, 9 Nov 2024 19:05:03 +0000 (20:05 +0100)] 
Illumos regtest: filter more signal messages from bash

7 months agoIllumos regtest: a couple of fixes to none fd tests
Paul Floyd [Sat, 9 Nov 2024 17:43:20 +0000 (18:43 +0100)] 
Illumos regtest: a couple of fixes to none fd tests

7 months agoIllumos regtest: add filters to gdbserver tests
Paul Floyd [Sat, 9 Nov 2024 17:20:26 +0000 (18:20 +0100)] 
Illumos regtest: add filters to gdbserver tests

7 months agoIllumos: Don't call ML_(fd_allowed) from PRE(sys_fstat)
Paul Floyd [Sat, 9 Nov 2024 17:17:26 +0000 (18:17 +0100)] 
Illumos: Don't call ML_(fd_allowed) from PRE(sys_fstat)

This was causing many false positives with --track-fds=yes

7 months agos390x regtest: Add missing memory clobbers in mvc.c
Andreas Arnez [Fri, 8 Nov 2024 13:52:11 +0000 (14:52 +0100)] 
s390x regtest: Add missing memory clobbers in mvc.c

The s390x test case `mvc' was seen to fail when using gcc -O3 with GCC
11.4.1 on Ubuntu:

   mvc: mvc.c:48: main: Assertion `full[i] == 'x'' failed.

In this case the compiler optimized the assertion check away, because it
doesn't consider `full' to be affected by the inline assembly.

Add memory clobbers to fix this.

7 months agos390x regtest: Add missing register clobber in misc3.c
Andreas Arnez [Fri, 8 Nov 2024 13:52:11 +0000 (14:52 +0100)] 
s390x regtest: Add missing register clobber in misc3.c

Depending on compiler options, the translation of test_mvcrl() in
`misc3.c' can misbehave because the inline assembly writes to r0 and
doesn't declare that.

Add a register clobber to fix this.  Also, tell the compiler the actual
length of `from' and `to' instead of the decremented value.

7 months agoCompiler warning: unused label on non-FreeBSD platforms
Paul Floyd [Mon, 4 Nov 2024 12:13:21 +0000 (13:13 +0100)] 
Compiler warning: unused label on non-FreeBSD platforms

Used by a goto to jump over the POST mutex lock userreq,
but only on FreeBSD.

7 months agoHelgrind regtest: fix wrong updates to tc04_free_lock expecteds
Paul Floyd [Mon, 4 Nov 2024 07:06:17 +0000 (08:06 +0100)] 
Helgrind regtest: fix wrong updates to tc04_free_lock expecteds

7 months agoBug 494327 - Crash when running Helgrind built with #define TRACE_PTH_FNS 1
Paul Floyd [Sun, 3 Nov 2024 19:42:43 +0000 (20:42 +0100)] 
Bug 494327 - Crash when running Helgrind built with #define TRACE_PTH_FNS 1

Use write() rather than 'fprintf()' for the TRACE_PTH_FNS blocks for
pthread_mutex_lock and pthread_mutex_lock. Mixing FILE and fd isn't
great, but this is to stderr which gets flushed on every line, and
it is only for developer builds that modify that TRACE_PTH_FNS macro.

7 months agoHelgrind FreeBSD: make previous hack conditonal on version
Paul Floyd [Sun, 3 Nov 2024 19:00:33 +0000 (20:00 +0100)] 
Helgrind FreeBSD: make previous hack conditonal on version

Don't want to ignore any pthread_mutex_lock calls on FreeBSD
14.1 and earlier.

7 months agoBug 494337 - All threaded applications cause still holding lock errors
Paul Floyd [Sun, 3 Nov 2024 18:47:12 +0000 (19:47 +0100)] 
Bug 494337 - All threaded applications cause still holding lock errors

Don't count the first call to pthread_mutex_lock() from exit().

Needed to update a couple of expecteds as exit() is now wrapped
so it turns up in the callstacks.

This is only for FreeBSD.

7 months agoFreeBSD regtest: update x86 scalar expected
Paul Floyd [Sun, 3 Nov 2024 13:18:12 +0000 (14:18 +0100)] 
FreeBSD regtest: update x86 scalar expected

7 months agoFreeBSD regtest: spaces not quite right in scalar fakes
Paul Floyd [Sun, 3 Nov 2024 11:00:52 +0000 (12:00 +0100)] 
FreeBSD regtest: spaces not quite right in scalar fakes

7 months agoclangd fixes
Paul Floyd [Sun, 3 Nov 2024 10:25:47 +0000 (11:25 +0100)] 
clangd fixes

Mainly useless casts and consistent function prototype and
definition arg names.

7 months agoCorrect typos and spelling mistakes
Paul Floyd [Sun, 3 Nov 2024 09:55:57 +0000 (10:55 +0100)] 
Correct typos and spelling mistakes

7 months agoBug 495488 - Add FreeBSD getrlimitusage syscall wrapper
Paul Floyd [Sun, 3 Nov 2024 09:17:17 +0000 (10:17 +0100)] 
Bug 495488 - Add FreeBSD getrlimitusage syscall wrapper

7 months agoFix compiler warnings produced by clang 19.
Paul Floyd [Sun, 3 Nov 2024 08:50:37 +0000 (09:50 +0100)] 
Fix compiler warnings produced by clang 19.

7 months agoAdd /none/tests/use_after_close to .gitignore
Paul Floyd [Sun, 3 Nov 2024 08:12:13 +0000 (09:12 +0100)] 
Add /none/tests/use_after_close to .gitignore

7 months agoFreeBSD syscall: fix syscall name used in kcmp traces.
Paul Floyd [Sat, 2 Nov 2024 21:22:10 +0000 (22:22 +0100)] 
FreeBSD syscall: fix syscall name used in kcmp traces.

7 months agoFreeBSD regtest: add _write to none filter_fdleak
Paul Floyd [Fri, 1 Nov 2024 07:59:19 +0000 (08:59 +0100)] 
FreeBSD regtest: add _write to none filter_fdleak

Also bump up news and configure to 3.25 git.

7 months ago-> 3.24.0 final VALGRIND_3_24_0
Mark Wielaard [Fri, 1 Nov 2024 04:19:38 +0000 (05:19 +0100)] 
-> 3.24.0 final

7 months agoMake const OpenFd *ML_(find_OpenFd) static
Mark Wielaard [Fri, 1 Nov 2024 03:40:22 +0000 (04:40 +0100)] 
Make const OpenFd *ML_(find_OpenFd) static

7 months agoDRM_IOCTLs SYNCOBJ_HANDLE_TO_FD, PRIME_HANDLE_TO_FD and MODE_CREATE_LEASE
Mark Wielaard [Fri, 1 Nov 2024 03:26:45 +0000 (04:26 +0100)] 
DRM_IOCTLs SYNCOBJ_HANDLE_TO_FD, PRIME_HANDLE_TO_FD and MODE_CREATE_LEASE

These three DRM_IOCTLs create new file descriptors, so track them using
ML_(record_fd_open_nameless).

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

7 months agogsl19test does not work properly when /bin/sh is /bin/dash
Florian Krohm [Thu, 31 Oct 2024 23:31:27 +0000 (00:31 +0100)] 
gsl19test does not work properly when /bin/sh is /bin/dash

There were 2 issues:

1) The output redirect operators seem to be bash specific. All output
   went to the terminal.....

2) When invoking valgrind the 'eval' needs to precede
  GSL_TEST_VERBOSE=1. Otherwise that environment variable is not seen
  by valgrind.

Two tweaks:

1) Determine the number of available processors and use that in make
   -j when building gsl-1.9

2) Replace -v with -q in the valgrind invocation. The file out-V is
   already quite large (approx 600 MB). It would be enormous with -v.

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

7 months agoReport track-fd errors for fd used which was not opened or already closed
Alexandra Hájková [Wed, 16 Oct 2024 17:38:48 +0000 (13:38 -0400)] 
Report track-fd errors for fd used which was not opened or already closed

Add (optional) pathname, description, where_closed and where_opened
fields to struct FdBadUse. Print those fields when set in fd_pp_Error.

Add a new function ML_(find_OpenFd) that provides a recorded OpenFd
given an fd (or NULL when the fd was never recorded).

In ML_(fd_allowed) when using a file descriptor use ML_(find_OpenFd)
to see if the fd was ever created, if not create an "was never
created" FdBadUse error. If it was created, but already closed create
an "was closed already", filling in as much details as we can.

Add none/tests/use_after_close.vgtest to test, already closed, never
created, invalid, double (double) close and invalid close issues.

Adjust error message in none/tests/fdbaduse.stderr.exp.

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

7 months agoIllumos: fix wartnings
Paul Floyd [Tue, 29 Oct 2024 20:02:38 +0000 (21:02 +0100)] 
Illumos: fix wartnings

Macro redefinition, calculating the size of an array and printf
format specifiers.

7 months agomacOS: compiler warnings
Paul Floyd [Tue, 29 Oct 2024 19:31:06 +0000 (20:31 +0100)] 
macOS: compiler warnings

Debug traces in vgdb.

7 months agoBug 495470 - s390x: Add s390-opcodes.csv to distribution
Andreas Arnez [Tue, 29 Oct 2024 16:43:15 +0000 (17:43 +0100)] 
Bug 495470 - s390x: Add s390-opcodes.csv to distribution

Include s390-opcodes.csv in the distribution, since it is referenced in
README.s390.

7 months agoBug 493959 - s390x: Fix regtest failure for op00 with /bin/dash
Florian Krohm [Tue, 29 Oct 2024 15:24:31 +0000 (16:24 +0100)] 
Bug 493959 - s390x: Fix regtest failure for op00 with /bin/dash

On different machines /bin/sh may be impersonated by different shells, and
those behave differently as to whether they write "Illegal instruction ..."
to stderr.  While newer versions of bash do not, dash does.

For the op00 test case this means that an additional line may be written
to `op00.stderr.out', depending on which shell is being used.  Hence
adding "Illegal instruction ..." as an expected line to `op00.stderr.exp'
wouldn't work on all systems.

Instead, fix this issue by adding the case of "illegal instruction" to the
general filtering logic in filter_stderr_basic.in, where various other
messages of this kind are already filtered out.

Reviewed-by: Andreas Arnez <arnez@linux.ibm.com>
7 months agomacOS Helgrind: fix wrong wrapper for sem_trywait.
Paul Floyd [Mon, 28 Oct 2024 21:10:30 +0000 (22:10 +0100)] 
macOS Helgrind: fix wrong wrapper for sem_trywait.

7 months agoBug 495469 - aligned_alloc and posix_memalign missing MALLOC_TRACE with returned...
Paul Floyd [Mon, 28 Oct 2024 19:36:17 +0000 (20:36 +0100)] 
Bug 495469 - aligned_alloc and posix_memalign missing MALLOC_TRACE with returned pointer

7 months agoLinux regtest: update arm64 expected with sigaltstack extra details.
Paul Floyd [Mon, 28 Oct 2024 18:56:37 +0000 (19:56 +0100)] 
Linux regtest: update arm64 expected with sigaltstack extra details.

7 months agoSet version to 3.24.0-RC1
Mark Wielaard [Sun, 27 Oct 2024 23:13:19 +0000 (00:13 +0100)] 
Set version to 3.24.0-RC1

Also update vg-lifespan which is used for documentation copyright years.

7 months agoFreeBSD regtest: final part of scalar rationalisation, x86 expected
Paul Floyd [Sun, 27 Oct 2024 21:58:32 +0000 (22:58 +0100)] 
FreeBSD regtest: final part of scalar rationalisation, x86 expected

7 months agoFreeBSD regtest: add fakes for older versions in scalar
Paul Floyd [Sun, 27 Oct 2024 20:54:55 +0000 (21:54 +0100)] 
FreeBSD regtest: add fakes for older versions in scalar

Syscalls added for FreeBSD 15 or thereabouts.

7 months agoFreeBSD regtest: remove scalar for version 15+
Paul Floyd [Sun, 27 Oct 2024 20:21:51 +0000 (21:21 +0100)] 
FreeBSD regtest: remove scalar for version 15+

Now also merged into scalar.c

7 months agoFreeBSD regtest: remove test for version 13+ syscalls
Paul Floyd [Sun, 27 Oct 2024 19:17:03 +0000 (20:17 +0100)] 
FreeBSD regtest: remove test for version 13+ syscalls

Now merged into main scalar.c

7 months agoFreeBSD regtest: add fakes for FreeBSD < 13
Paul Floyd [Sun, 27 Oct 2024 17:59:12 +0000 (18:59 +0100)] 
FreeBSD regtest: add fakes for FreeBSD < 13

Also try again to make mprotect fail. It doesn't fail
with a bogus 'prot' on FreeBSD 12.4.

7 months agoFreeBSD regtest: start removing versioned scalar variants
Paul Floyd [Sun, 27 Oct 2024 17:14:20 +0000 (18:14 +0100)] 
FreeBSD regtest: start removing versioned scalar variants

7 months agoFreeBSD: put back stacktrace hack for syscalls in older versions
Paul Floyd [Sun, 27 Oct 2024 16:48:58 +0000 (17:48 +0100)] 
FreeBSD: put back stacktrace hack for syscalls in older versions

7 months agoFreeBSD regtest: x86 scalar expected
Paul Floyd [Sun, 27 Oct 2024 14:27:38 +0000 (15:27 +0100)] 
FreeBSD regtest: x86 scalar expected

8 months agoFreeBSD regtest: cleanup scalar
Paul Floyd [Sun, 27 Oct 2024 13:22:58 +0000 (14:22 +0100)] 
FreeBSD regtest: cleanup scalar

Make more tests fail. Add a few more tests. Add some asserts
for tests that don't return -1 on failure.