You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(122) |
Nov
(152) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(6) |
Feb
(25) |
Mar
(73) |
Apr
(82) |
May
(24) |
Jun
(25) |
Jul
(10) |
Aug
(11) |
Sep
(10) |
Oct
(54) |
Nov
(203) |
Dec
(182) |
2004 |
Jan
(307) |
Feb
(305) |
Mar
(430) |
Apr
(312) |
May
(187) |
Jun
(342) |
Jul
(487) |
Aug
(637) |
Sep
(336) |
Oct
(373) |
Nov
(441) |
Dec
(210) |
2005 |
Jan
(385) |
Feb
(480) |
Mar
(636) |
Apr
(544) |
May
(679) |
Jun
(625) |
Jul
(810) |
Aug
(838) |
Sep
(634) |
Oct
(521) |
Nov
(965) |
Dec
(543) |
2006 |
Jan
(494) |
Feb
(431) |
Mar
(546) |
Apr
(411) |
May
(406) |
Jun
(322) |
Jul
(256) |
Aug
(401) |
Sep
(345) |
Oct
(542) |
Nov
(308) |
Dec
(481) |
2007 |
Jan
(427) |
Feb
(326) |
Mar
(367) |
Apr
(255) |
May
(244) |
Jun
(204) |
Jul
(223) |
Aug
(231) |
Sep
(354) |
Oct
(374) |
Nov
(497) |
Dec
(362) |
2008 |
Jan
(322) |
Feb
(482) |
Mar
(658) |
Apr
(422) |
May
(476) |
Jun
(396) |
Jul
(455) |
Aug
(267) |
Sep
(280) |
Oct
(253) |
Nov
(232) |
Dec
(304) |
2009 |
Jan
(486) |
Feb
(470) |
Mar
(458) |
Apr
(423) |
May
(696) |
Jun
(461) |
Jul
(551) |
Aug
(575) |
Sep
(134) |
Oct
(110) |
Nov
(157) |
Dec
(102) |
2010 |
Jan
(226) |
Feb
(86) |
Mar
(147) |
Apr
(117) |
May
(107) |
Jun
(203) |
Jul
(193) |
Aug
(238) |
Sep
(300) |
Oct
(246) |
Nov
(23) |
Dec
(75) |
2011 |
Jan
(133) |
Feb
(195) |
Mar
(315) |
Apr
(200) |
May
(267) |
Jun
(293) |
Jul
(353) |
Aug
(237) |
Sep
(278) |
Oct
(611) |
Nov
(274) |
Dec
(260) |
2012 |
Jan
(303) |
Feb
(391) |
Mar
(417) |
Apr
(441) |
May
(488) |
Jun
(655) |
Jul
(590) |
Aug
(610) |
Sep
(526) |
Oct
(478) |
Nov
(359) |
Dec
(372) |
2013 |
Jan
(467) |
Feb
(226) |
Mar
(391) |
Apr
(281) |
May
(299) |
Jun
(252) |
Jul
(311) |
Aug
(352) |
Sep
(481) |
Oct
(571) |
Nov
(222) |
Dec
(231) |
2014 |
Jan
(185) |
Feb
(329) |
Mar
(245) |
Apr
(238) |
May
(281) |
Jun
(399) |
Jul
(382) |
Aug
(500) |
Sep
(579) |
Oct
(435) |
Nov
(487) |
Dec
(256) |
2015 |
Jan
(338) |
Feb
(357) |
Mar
(330) |
Apr
(294) |
May
(191) |
Jun
(108) |
Jul
(142) |
Aug
(261) |
Sep
(190) |
Oct
(54) |
Nov
(83) |
Dec
(22) |
2016 |
Jan
(49) |
Feb
(89) |
Mar
(33) |
Apr
(50) |
May
(27) |
Jun
(34) |
Jul
(53) |
Aug
(53) |
Sep
(98) |
Oct
(206) |
Nov
(93) |
Dec
(53) |
2017 |
Jan
(65) |
Feb
(82) |
Mar
(102) |
Apr
(86) |
May
(187) |
Jun
(67) |
Jul
(23) |
Aug
(93) |
Sep
(65) |
Oct
(45) |
Nov
(35) |
Dec
(17) |
2018 |
Jan
(26) |
Feb
(35) |
Mar
(38) |
Apr
(32) |
May
(8) |
Jun
(43) |
Jul
(27) |
Aug
(30) |
Sep
(43) |
Oct
(42) |
Nov
(38) |
Dec
(67) |
2019 |
Jan
(32) |
Feb
(37) |
Mar
(53) |
Apr
(64) |
May
(49) |
Jun
(18) |
Jul
(14) |
Aug
(53) |
Sep
(25) |
Oct
(30) |
Nov
(49) |
Dec
(31) |
2020 |
Jan
(87) |
Feb
(45) |
Mar
(37) |
Apr
(51) |
May
(99) |
Jun
(36) |
Jul
(11) |
Aug
(14) |
Sep
(20) |
Oct
(24) |
Nov
(40) |
Dec
(23) |
2021 |
Jan
(14) |
Feb
(53) |
Mar
(85) |
Apr
(15) |
May
(19) |
Jun
(3) |
Jul
(14) |
Aug
(1) |
Sep
(57) |
Oct
(73) |
Nov
(56) |
Dec
(22) |
2022 |
Jan
(3) |
Feb
(22) |
Mar
(6) |
Apr
(55) |
May
(46) |
Jun
(39) |
Jul
(15) |
Aug
(9) |
Sep
(11) |
Oct
(34) |
Nov
(20) |
Dec
(36) |
2023 |
Jan
(79) |
Feb
(41) |
Mar
(99) |
Apr
(169) |
May
(48) |
Jun
(16) |
Jul
(16) |
Aug
(57) |
Sep
(83) |
Oct
(89) |
Nov
(97) |
Dec
(30) |
2024 |
Jan
(25) |
Feb
(73) |
Mar
(76) |
Apr
(122) |
May
(46) |
Jun
(44) |
Jul
(27) |
Aug
(30) |
Sep
(33) |
Oct
(67) |
Nov
(91) |
Dec
(70) |
2025 |
Jan
(44) |
Feb
(36) |
Mar
(85) |
Apr
(100) |
May
(138) |
Jun
(55) |
Jul
(107) |
Aug
(56) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Mark W. <ma...@kl...> - 2024-07-06 18:08:15
|
On Sun, Jun 23, 2024 at 10:27:31PM +0200, Mark Wielaard wrote: > On Mon, Jun 10, 2024 at 05:04:00PM +0200, Mark Wielaard wrote: > > Hi developers and packagers, > > > > I updated the VALGRIND_3_23_BRANCH with some patches to unbreak mips, > > fix memccpy false positives, inotify_init syscall handling, add aarch64 > > frinta and frinta vector instructions and clean up the s390x extension > > mechanism and some testcases. > > > > I don't intent to do a full 3.23.1 release, but I hope distros will > > pick up these fixes. I have also added them to the Fedora package. > > I added 4 more commits to the 3.23 branch to fix an odd x86_64 prefix > issue, remove internal valgrind file descriptor leaking that could > result in false positives with --track-fds=yes and deny programs to > call fcntl on valgrind internal fds. And now 6 more. To fix mips64 syscall numbers. gdbserver testsuite filter updates. x86_64 AVX VMOVQ instruction emulation fix. arm64 rounding fix for the fcvtas instruction. And avoid dev/inode check on btrfs with --sanity-level=3. commit e1868cb600ce8f93f61c0c4cd692eba77396b492 Author: Petar Jovanovic <mip...@gm...> Date: Mon Jun 24 10:33:46 2024 +0000 mips: skip using shared syscall numbers for mips64 mips does not use shared syscall numbers, so we can not use vki-scnums-shared-linux.h. This fixes KDE #444781. Signed-off-by: Hauke Mehrtens <ha...@ha...> Signed-off-by: Aleksandar Rikalo <ar...@gm...> (cherry picked from commit efaa17e53a750d5f0f4c138b507b1b104729ed67) commit b48fcb0bff14044caece520611233feb157401bf Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 24 14:56:37 2024 +0200 gdbserver_tests filters remove python rpm module load warning gdb on Fedora will warn not being able to load the rpm python module. Unable to load 'rpm' module. Please install the python3-rpm package. Filter out that message so tests don't fail. (cherry picked from commit d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef) commit 0ddeadb018a19f4033dbf63aa336561c07074688 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 30 20:17:32 2024 +0200 Implement VMOVQ xmm1, xmm2/m64 We implemented the memory variant already, but not the reg variant. Add a separate avx-vmovq testcase, because avx-1 is already really big. https://bugs.kde.org/show_bug.cgi?id=391148 https://bugs.kde.org/show_bug.cgi?id=417572 https://bugs.kde.org/show_bug.cgi?id=489088 (cherry picked from commit 10a22445d747817932692b1c1ee3faa726121cb4) commit 323a62b56b828d59eece2336af9ee6abf473d712 Author: Bernhard Übelacker <ber...@ma...> Date: Thu Jun 27 22:51:09 2024 +0200 arm64: Fix fcvtas instruction. (cherry picked from commit de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2) commit fdd27bab5f134fda0098f9c3a5c36199e3205fea Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 18:04:18 2024 +0200 gdbserver_tests filters remove more verbose python rpm load warnings The rpm python load warnings on Fedora became even more verbose. Filter out all stderr messages related to them so tests don't fail. (cherry picked from commit d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d) commit a62058256f2c1bbc00757dfe89d505d5c6eb9906 Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 15:21:39 2024 +0200 Avoid dev/inode check on btrfs with --sanity-level=3 With --sanity-level=3 or higher the aspacemgr sanity checks the device/inode numbers from /proc/self/maps to the file stat results. These don't match on btrfs. So detect when a file is on a btrfs volume and ignore the check in that case. https://bugs.kde.org/show_bug.cgi?id=317127 (cherry picked from commit 3b06d458ffc5cc8de8d701926e5d86979185fa04) |
From: Mark W. <ma...@so...> - 2024-07-06 17:44:19
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a62058256f2c1bbc00757dfe89d505d5c6eb9906 commit a62058256f2c1bbc00757dfe89d505d5c6eb9906 Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 15:21:39 2024 +0200 Avoid dev/inode check on btrfs with --sanity-level=3 With --sanity-level=3 or higher the aspacemgr sanity checks the device/inode numbers from /proc/self/maps to the file stat results. These don't match on btrfs. So detect when a file is on a btrfs volume and ignore the check in that case. https://bugs.kde.org/show_bug.cgi?id=317127 (cherry picked from commit 3b06d458ffc5cc8de8d701926e5d86979185fa04) Diff: --- NEWS | 1 + coregrind/m_aspacemgr/aspacemgr-linux.c | 13 +++++++++++++ include/vki/vki-linux.h | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/NEWS b/NEWS index d1419b9d3c..c5fbc8699d 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak +317127 Fedora18/x86_64 --sanity-level=3 : aspacem segment mismatch 337388 fcntl works on Valgrind's own file descriptors 391148 Unhandled AVX instruction vmovq %xmm9,%xmm1 444781 MIPS: wrong syscall numbers used diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 83875e89b4..fb788e923e 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -883,6 +883,19 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot, /* hack apparently needed on MontaVista Linux */ if (filename && VG_(strstr)(filename, "/.lib-ro/")) cmp_devino = False; + + /* On linux systems we want to avoid dev/inode check on btrfs, + we can use the statfs call for that, except on nanomips + (which also doesn't have a sys_fstatfs syswrap). + See https://bugs.kde.org/show_bug.cgi?id=317127 */ +#if !defined(VGP_nanomips_linux) + struct vki_statfs statfs = {0}; + SysRes res = VG_(do_syscall2)(__NR_statfs, (UWord)filename, + (UWord)&statfs); + if (!sr_isError(res) && statfs.f_type == VKI_BTRFS_SUPER_MAGIC) { + cmp_devino = False; + } +#endif #endif /* If we are doing sloppy execute permission checks then we diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index be3d76690c..ccdb808af7 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -5455,6 +5455,12 @@ struct vki_open_how { #define VKI_CLOSE_RANGE_UNSHARE (1U << 1) #define VKI_CLOSE_RANGE_CLOEXEC (1U << 2) +//---------------------------------------------------------------------- +// From linux/magic.h +//---------------------------------------------------------------------- + +#define VKI_BTRFS_SUPER_MAGIC 0x9123683E + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ |
From: Mark W. <ma...@so...> - 2024-07-06 17:44:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fdd27bab5f134fda0098f9c3a5c36199e3205fea commit fdd27bab5f134fda0098f9c3a5c36199e3205fea Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 18:04:18 2024 +0200 gdbserver_tests filters remove more verbose python rpm load warnings The rpm python load warnings on Fedora became even more verbose. Filter out all stderr messages related to them so tests don't fail. (cherry picked from commit d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d) Diff: --- gdbserver_tests/filter_gdb.in | 5 ++++- gdbserver_tests/filter_vgdb.in | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index f0400fd18b..38a3803eb1 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -52,7 +52,10 @@ s/^\[?1034hReading symbols/Reading symbols/ /^Try: zypper install -C/d # Remove python rpm module load warning -/^Unable to load 'rpm' module. Please install the python3-rpm package./d +/^Unable to load /d +/^the RPM suggestions /d +/^installing missing debuginfo /d +/^please install /d # Remove vgdb message /relaying data between gdb and process/d diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index 71f1f70253..b32be68973 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -47,8 +47,11 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | $SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | -# Remove python rpm module load warning -$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" | +# Remove python rpm module load warnings +$SED -e "/^Unable to load /d" | +$SED -e "/^the RPM suggestions /d" | +$SED -e "/^installing missing debuginfo /d" | +$SED -e "/^please install /d" | # and filter out any remaining empty lines $SED -e '/^$/d' |
From: Mark W. <ma...@so...> - 2024-07-06 17:44:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=323a62b56b828d59eece2336af9ee6abf473d712 commit 323a62b56b828d59eece2336af9ee6abf473d712 Author: Bernhard Übelacker <ber...@ma...> Date: Thu Jun 27 22:51:09 2024 +0200 arm64: Fix fcvtas instruction. (cherry picked from commit de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2) Diff: --- NEWS | 1 + VEX/priv/guest_arm64_toIR.c | 74 +++++++++++++++++++++++++-------------------- VEX/priv/host_arm64_defs.c | 23 ++++++++------ VEX/priv/host_arm64_defs.h | 3 +- VEX/priv/host_arm64_isel.c | 12 +++++--- 5 files changed, 65 insertions(+), 48 deletions(-) diff --git a/NEWS b/NEWS index cd89e50829..d1419b9d3c 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ The following bugs have been fixed or resolved on this branch. 487439 SIGILL in JDK11, JDK17 488379 --track-fds=yes errors that cannot be suppressed with --xml-file= 489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5 +489338 arm64: Instruction fcvtas should round 322.5 to 323, but result is 322. n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c index 27d945d632..750383e1eb 100644 --- a/VEX/priv/guest_arm64_toIR.c +++ b/VEX/priv/guest_arm64_toIR.c @@ -15533,7 +15533,7 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn) } else { vassert(op == BITS3(1,0,0) || op == BITS3(1,0,1)); switch (rm) { - case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST; break; + case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST_TIE_AWAY_0; break; default: vassert(0); } } @@ -15557,45 +15557,53 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn) IROp iop = iops[ix]; // A bit of ATCery: bounce all cases we haven't seen an example of. if (/* F32toI32S */ - (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,S */ + (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,S */ + || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,S */ /* F32toI32U */ - || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,S */ + || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,S */ + || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,S */ /* F32toI64S */ - || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,S */ + || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,S */ + || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,S */ /* F32toI64U */ - || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,S */ + || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,S */ + || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,S */ /* F64toI32S */ - || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,D */ + || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,D */ + || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,D */ /* F64toI32U */ - || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,D */ + || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,D */ + || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,D */ /* F64toI64S */ - || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,D */ + || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,D */ + || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,D */ /* F64toI64U */ - || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,D */ + || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,D */ + || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,D */ ) { /* validated */ } else { diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c index 0b59c87cd3..dc5d198e0d 100644 --- a/VEX/priv/host_arm64_defs.c +++ b/VEX/priv/host_arm64_defs.c @@ -1142,13 +1142,14 @@ ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS ) { return i; } ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS, - UChar armRM ) { + UChar armRM, Bool tiesToAway ) { ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr)); i->tag = ARM64in_VCvtF2I; i->ARM64in.VCvtF2I.how = how; i->ARM64in.VCvtF2I.rD = rD; i->ARM64in.VCvtF2I.rS = rS; i->ARM64in.VCvtF2I.armRM = armRM; + i->ARM64in.VCvtF2I.tiesToAway = tiesToAway; vassert(armRM <= 3); return i; } @@ -4463,47 +4464,51 @@ Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc, ---------------- 01 -------------- FCVTP-------- (round to +inf) ---------------- 10 -------------- FCVTM-------- (round to -inf) ---------------- 11 -------------- FCVTZ-------- (round to zero) + ---------------- 00 100 ---------- FCVTAS------- (nearest, ties away) + ---------------- 00 101 ---------- FCVTAU------- (nearest, ties away) Rd is Xd when sf==1, Wd when sf==0 Fn is Dn when x==1, Sn when x==0 20:19 carry the rounding mode, using the same encoding as FPCR + 18 enable translation to FCVTA{S,U} */ UInt rD = iregEnc(i->ARM64in.VCvtF2I.rD); UInt rN = dregEnc(i->ARM64in.VCvtF2I.rS); ARM64CvtOp how = i->ARM64in.VCvtF2I.how; UChar armRM = i->ARM64in.VCvtF2I.armRM; + UChar bit18 = i->ARM64in.VCvtF2I.tiesToAway ? 4 : 0; /* Just handle cases as they show up. */ switch (how) { case ARM64cvt_F64_I32S: /* FCVTxS Wd, Dn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I32U: /* FCVTxU Wd, Dn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I64S: /* FCVTxS Xd, Dn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I64U: /* FCVTxU Xd, Dn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I32S: /* FCVTxS Wd, Sn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I32U: /* FCVTxU Wd, Sn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I64S: /* FCVTxS Xd, Sn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I64U: /* FCVTxU Xd, Sn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3) | bit18, X000000, rN, rD); break; default: diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h index e78d8045ff..f24a2f4ba6 100644 --- a/VEX/priv/host_arm64_defs.h +++ b/VEX/priv/host_arm64_defs.h @@ -816,6 +816,7 @@ typedef HReg rS; // src, a D or S register UChar armRM; // ARM encoded RM: // 00=nearest, 01=+inf, 10=-inf, 11=zero + Bool tiesToAway; } VCvtF2I; /* Convert between 32-bit and 64-bit FP values (both ways). (FCVT) */ struct { @@ -1062,7 +1063,7 @@ extern ARM64Instr* ARM64Instr_VLdStD ( Bool isLoad, HReg dD, HReg rN, extern ARM64Instr* ARM64Instr_VLdStQ ( Bool isLoad, HReg rQ, HReg rN ); extern ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS ); extern ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS, - UChar armRM ); + UChar armRM, Bool tiesToAway ); extern ARM64Instr* ARM64Instr_VCvtSD ( Bool sToD, HReg dst, HReg src ); extern ARM64Instr* ARM64Instr_VCvtHS ( Bool hToS, HReg dst, HReg src ); extern ARM64Instr* ARM64Instr_VCvtHD ( Bool hToD, HReg dst, HReg src ); diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c index 645358586f..34c5265590 100644 --- a/VEX/priv/host_arm64_isel.c +++ b/VEX/priv/host_arm64_isel.c @@ -1921,17 +1921,19 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e ) UInt irrm = arg1con->Ico.U32; /* Find the ARM-encoded equivalent for |irrm|. */ UInt armrm = 4; /* impossible */ + Bool tiesToAway = False; switch (irrm) { - case Irrm_NEAREST: armrm = 0; break; - case Irrm_NegINF: armrm = 2; break; - case Irrm_PosINF: armrm = 1; break; - case Irrm_ZERO: armrm = 3; break; + case Irrm_NEAREST: armrm = 0; break; + case Irrm_NegINF: armrm = 2; break; + case Irrm_PosINF: armrm = 1; break; + case Irrm_ZERO: armrm = 3; break; + case Irrm_NEAREST_TIE_AWAY_0: armrm = 0; tiesToAway = True; break; default: goto irreducible; } HReg src = (srcIsD ? iselDblExpr : iselFltExpr) (env, e->Iex.Binop.arg2); HReg dst = newVRegI(env); - addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm)); + addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm, tiesToAway)); return dst; } } /* local scope */ |
From: Mark W. <ma...@so...> - 2024-07-06 17:44:04
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0ddeadb018a19f4033dbf63aa336561c07074688 commit 0ddeadb018a19f4033dbf63aa336561c07074688 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 30 20:17:32 2024 +0200 Implement VMOVQ xmm1, xmm2/m64 We implemented the memory variant already, but not the reg variant. Add a separate avx-vmovq testcase, because avx-1 is already really big. https://bugs.kde.org/show_bug.cgi?id=391148 https://bugs.kde.org/show_bug.cgi?id=417572 https://bugs.kde.org/show_bug.cgi?id=489088 (cherry picked from commit 10a22445d747817932692b1c1ee3faa726121cb4) Diff: --- .gitignore | 1 + NEWS | 3 + VEX/priv/guest_amd64_toIR.c | 10 ++- none/tests/amd64/Makefile.am | 6 +- none/tests/amd64/avx-vmovq.c | 19 ++++ none/tests/amd64/avx-vmovq.stderr.exp | 0 none/tests/amd64/avx-vmovq.stdout.exp | 162 ++++++++++++++++++++++++++++++++++ none/tests/amd64/avx-vmovq.vgtest | 3 + 8 files changed, 200 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e13a9fa935..3d02863fb7 100644 --- a/.gitignore +++ b/.gitignore @@ -1660,6 +1660,7 @@ /none/tests/amd64/amd64locked /none/tests/amd64/asorep /none/tests/amd64/avx-1 +/none/tests/amd64/avx-vmovq /none/tests/amd64/avx2-1 /none/tests/amd64/avx_estimate_insn /none/tests/amd64/bmi diff --git a/NEWS b/NEWS index 9f4f697440..cd89e50829 100644 --- a/NEWS +++ b/NEWS @@ -8,7 +8,9 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak 337388 fcntl works on Valgrind's own file descriptors +391148 Unhandled AVX instruction vmovq %xmm9,%xmm1 444781 MIPS: wrong syscall numbers used +417572 vex amd64->IR: unhandled instruction bytes: 0xC5 0x79 0xD6 0xED 0xC5 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' @@ -16,6 +18,7 @@ The following bugs have been fixed or resolved on this branch. 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table 487439 SIGILL in JDK11, JDK17 488379 --track-fds=yes errors that cannot be suppressed with --xml-file= +489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5 n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 28c37f0922..57a8a434b8 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -27015,7 +27015,6 @@ Long dis_ESC_0F__VEX ( break; case 0xD6: - /* I can't even find any Intel docs for this one. */ /* Basically: 66 0F D6 = MOVQ -- move 64 bits from G (lo half xmm) to E (mem or lo half xmm). Looks like L==0(128), W==0 (WIG, maybe?) */ @@ -27024,8 +27023,15 @@ Long dis_ESC_0F__VEX ( UChar modrm = getUChar(delta); UInt rG = gregOfRexRM(pfx,modrm); if (epartIsReg(modrm)) { - /* fall through, awaiting test case */ /* dst: lo half copied, hi half zeroed */ + UInt rE = eregOfRexRM(pfx,modrm); + putXMMRegLane64( rE, 0, getXMMRegLane64( rG, 0 )); + /* zero bits 255:64 */ + putXMMRegLane64( rE, 1, mkU64(0) ); + putYMMRegLane128( rE, 1, mkV128(0) ); + DIP("vmovq %s,%s\n", nameXMMReg(rG), nameXMMReg(rE)); + delta += 1; + goto decode_success; } else { addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 ); storeLE( mkexpr(addr), getXMMRegLane64( rG, 0 )); diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index 83029c1559..e4d907c3dd 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.tool-tests.am dist_noinst_SCRIPTS = filter_cpuid filter_inf_nan filter_stderr gen_insn_test.pl -# Used by avx-1.c and avx_estimate_insn.c +# Used by avx-1.c, avx-vmovq and avx_estimate_insn.c noinst_HEADERS = avx_tests.h CLEANFILES = $(addsuffix .c,$(INSN_TESTS)) @@ -29,6 +29,7 @@ EXTRA_DIST = \ avx-1.vgtest avx-1.stdout.exp avx-1.stderr.exp \ avx_estimate_insn.vgtest avx_estimate_insn.stderr.exp \ avx_estimate_insn.stdout.exp avx_estimate_insn.stdout.exp-amd \ + avx-vmovq.vgtest avx-vmovq.stdout.exp avx-vmovq.stderr.exp \ avx2-1.vgtest avx2-1.stdout.exp avx2-1.stderr.exp \ asorep.stderr.exp asorep.stdout.exp asorep.vgtest \ bmi.stderr.exp bmi.stdout.exp bmi.vgtest \ @@ -131,7 +132,8 @@ endif if BUILD_AVX_TESTS if BUILD_VPCLMULQDQ_TESTS check_PROGRAMS += avx-1 \ - avx_estimate_insn + avx_estimate_insn \ + avx-vmovq endif if BUILD_FMA4_TESTS check_PROGRAMS += fma4 diff --git a/none/tests/amd64/avx-vmovq.c b/none/tests/amd64/avx-vmovq.c new file mode 100644 index 0000000000..da8a1959b3 --- /dev/null +++ b/none/tests/amd64/avx-vmovq.c @@ -0,0 +1,19 @@ +#include"avx_tests.h" + +GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_HIGH, + "vmovq %%xmm9, %%xmm7", + "vmovq %%xmm8, (%%rsi)") + +// xmm0 is scratch +GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_LOW_HIGH, + "vmovq %%xmm0, %%xmm7; vmovq %%xmm8, %%xmm0", + "vmovq %%xmm0, (%%rsi); vmovq %%xmm9, %%xmm0") + +int main ( void ) +{ + DO_D( VMOVQ_XMM_to_XMM_LOW_HIGH ); + DO_D( VMOVQ_XMM_to_XMM_LOW_LOW_HIGH ); + + return 0; +} + diff --git a/none/tests/amd64/avx-vmovq.stderr.exp b/none/tests/amd64/avx-vmovq.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/amd64/avx-vmovq.stdout.exp b/none/tests/amd64/avx-vmovq.stdout.exp new file mode 100644 index 0000000000..f5b45e54de --- /dev/null +++ b/none/tests/amd64/avx-vmovq.stdout.exp @@ -0,0 +1,162 @@ +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + 7d6528c5fa956a0d.69c3e9a6af27d13b.5175e39d19c9ca1e.98f24a4984175700 + b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50 + 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38 + cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5 + 56b01a12b0ca1583 + after + 0000000000000000.0000000000000000.0000000000000000.4a4bc43968bc40e5 + b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50 + 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38 + cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5 + 56b01a12b0ca1583 +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.f9dd4a29f8c093db + cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597 + f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17 + 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06 + 81f2a547be8d1811 + after + 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.d8bc5c6dee699597 + cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597 + f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17 + 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06 + 81f2a547be8d1811 + +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + f0350ca70523e0e4.5ba1ec54e87d39b3.019963bf7459630b.8d69483df7e8c6a9 + e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64 + c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e + e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3 + 96084deb9ed0411e + after + 0000000000000000.0000000000000000.0000000000000000.6262dd37727c80f3 + e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64 + c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e + e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3 + 96084deb9ed0411e +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.63483da65c8c49d0 + 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35 + ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4 + ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159 + 8404eb7f0cf4ca6f + after + 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.73a8f718a8c3ec35 + 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35 + ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4 + ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159 + 8404eb7f0cf4ca6f + +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + 5cdf726562b02dc2.b39925ba7d9d67bc.ff6f850f2c57ea2a.2c810e6dc1a1833d + 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f + f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66 + 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d + dc4c446c804bf950 + after + 0000000000000000.0000000000000000.0000000000000000.aa927a03090dfc6d + 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f + f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66 + 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d + dc4c446c804bf950 +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.f5304f3e3ad1a923 + 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c + 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685 + bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa + 8b5fccbef0e1e256 + after + 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.6ec34f98a2199d3c + 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c + 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685 + bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa + 8b5fccbef0e1e256 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 048612e51a468e36.c51cdd8f87e12ab4.acb722146c6cbfa9.ea4a022e1d3d7dbb + 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e + 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c + c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391 + 9d8e66ea90352a18 + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e + 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c + c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391 + 9d8e66ea90352a18 +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.14575775bc3a1202 + 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a + 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8 + 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268 + fbc4208894fdc0f5 + after + 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.2525252525252525 + 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a + 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8 + 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268 + fbc4208894fdc0f5 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 0aaa836b194e242c.c5fc3ae904033357.4e92f1b240a12214.1a366d352714867e + 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e + 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef + 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc + 2c3ffa1aebe6a4d2 + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e + 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef + 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc + 2c3ffa1aebe6a4d2 +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.02dd0e32eecfc5fa + 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c + 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda + 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60 + 16559ec50352a3d9 + after + f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.2525252525252525 + 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c + 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda + 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60 + 16559ec50352a3d9 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 742c3e9e2b92eef2.c569453ccd1b0fc4.0784892e9360315b.f0177599dbe14b46 + 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd + d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c + 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac + bc3127138b19183c + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd + d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c + 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac + bc3127138b19183c +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.e4450ababbfae0f9 + e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0 + 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9 + 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0 + 0194ddb82b49abf0 + after + 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.2525252525252525 + e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0 + 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9 + 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0 + 0194ddb82b49abf0 + diff --git a/none/tests/amd64/avx-vmovq.vgtest b/none/tests/amd64/avx-vmovq.vgtest new file mode 100644 index 0000000000..ba4f5caaf2 --- /dev/null +++ b/none/tests/amd64/avx-vmovq.vgtest @@ -0,0 +1,3 @@ +prog: avx-vmovq +prereq: test -x avx-vmovq && ../../../tests/x86_amd64_features amd64-avx +vgopts: -q |
From: Mark W. <ma...@so...> - 2024-07-06 17:43:59
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b48fcb0bff14044caece520611233feb157401bf commit b48fcb0bff14044caece520611233feb157401bf Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 24 14:56:37 2024 +0200 gdbserver_tests filters remove python rpm module load warning gdb on Fedora will warn not being able to load the rpm python module. Unable to load 'rpm' module. Please install the python3-rpm package. Filter out that message so tests don't fail. (cherry picked from commit d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef) Diff: --- gdbserver_tests/filter_gdb.in | 3 +++ gdbserver_tests/filter_vgdb.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index 497171732b..f0400fd18b 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -51,6 +51,9 @@ s/^\[?1034hReading symbols/Reading symbols/ # Remove some Suse package manager messages /^Try: zypper install -C/d +# Remove python rpm module load warning +/^Unable to load 'rpm' module. Please install the python3-rpm package./d + # Remove vgdb message /relaying data between gdb and process/d diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index 139aea2bcc..71f1f70253 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -47,5 +47,8 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | $SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | +# Remove python rpm module load warning +$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" | + # and filter out any remaining empty lines $SED -e '/^$/d' |
From: Mark W. <ma...@so...> - 2024-07-06 17:43:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e1868cb600ce8f93f61c0c4cd692eba77396b492 commit e1868cb600ce8f93f61c0c4cd692eba77396b492 Author: Petar Jovanovic <mip...@gm...> Date: Mon Jun 24 10:33:46 2024 +0000 mips: skip using shared syscall numbers for mips64 mips does not use shared syscall numbers, so we can not use vki-scnums-shared-linux.h. This fixes KDE #444781. Signed-off-by: Hauke Mehrtens <ha...@ha...> Signed-off-by: Aleksandar Rikalo <ar...@gm...> (cherry picked from commit efaa17e53a750d5f0f4c138b507b1b104729ed67) Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-mips64-linux.c | 1 + include/pub_tool_vkiscnums_asm.h | 1 - include/vki/vki-scnums-mips64-linux.h | 98 ++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 523380a98f..9f4f697440 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak 337388 fcntl works on Valgrind's own file descriptors +444781 MIPS: wrong syscall numbers used 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 24f2bcc939..b07b7da459 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -813,6 +813,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_pwritev2, sys_pwritev2), LINX_ (__NR_syncfs, sys_syncfs), LINXY (__NR_statx, sys_statx), + GENX_ (__NR_rseq, sys_ni_syscall), LINX_ (__NR_setns, sys_setns), LINXY (__NR_io_uring_setup, sys_io_uring_setup), LINXY (__NR_io_uring_enter, sys_io_uring_enter), diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h index d3d7dc19be..f97a3af3a1 100644 --- a/include/pub_tool_vkiscnums_asm.h +++ b/include/pub_tool_vkiscnums_asm.h @@ -70,7 +70,6 @@ # include "vki/vki-scnums-shared-linux.h" #elif defined(VGP_mips64_linux) -# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-mips64-linux.h" #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd) diff --git a/include/vki/vki-scnums-mips64-linux.h b/include/vki/vki-scnums-mips64-linux.h index 1ae7a5dbec..c5291e31c6 100644 --- a/include/vki/vki-scnums-mips64-linux.h +++ b/include/vki/vki-scnums-mips64-linux.h @@ -362,6 +362,45 @@ #define __NR_pkey_alloc (__NR_Linux + 324) #define __NR_pkey_free (__NR_Linux + 325) #define __NR_statx (__NR_Linux + 326) +#define __NR_rseq (__NR_Linux + 327) +#define __NR_io_pgetevents (__NR_Linux + 328) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) +#define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) +#define __NR_openat2 (__NR_Linux + 437) +#define __NR_pidfd_getfd (__NR_Linux + 438) +#define __NR_faccessat2 (__NR_Linux + 439) +#define __NR_process_madvise (__NR_Linux + 440) +#define __NR_epoll_pwait2 (__NR_Linux + 441) +#define __NR_mount_setattr (__NR_Linux + 442) +#define __NR_quotactl_fd (__NR_Linux + 443) +#define __NR_landlock_create_ruleset (__NR_Linux + 444) +#define __NR_landlock_add_rule (__NR_Linux + 445) +#define __NR_landlock_restrict_self (__NR_Linux + 446) +#define __NR_process_mrelease (__NR_Linux + 448) +#define __NR_futex_waitv (__NR_Linux + 449) +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) +#define __NR_cachestat (__NR_Linux + 451) +#define __NR_fchmodat2 (__NR_Linux + 452) +#define __NR_map_shadow_stack (__NR_Linux + 453) +#define __NR_futex_wake (__NR_Linux + 454) +#define __NR_futex_wait (__NR_Linux + 455) +#define __NR_futex_requeue (__NR_Linux + 456) +#define __NR_statmount (__NR_Linux + 457) +#define __NR_listmount (__NR_Linux + 458) +#define __NR_lsm_get_self_attr (__NR_Linux + 459) +#define __NR_lsm_set_self_attr (__NR_Linux + 460) +#define __NR_lsm_list_modules (__NR_Linux + 461) #elif defined(VGABI_N32) @@ -701,6 +740,65 @@ #define __NR_pkey_alloc (__NR_Linux + 328) #define __NR_pkey_free (__NR_Linux + 329) #define __NR_statx (__NR_Linux + 330) +#define __NR_rseq (__NR_Linux + 331) +#define __NR_io_pgetevents (__NR_Linux + 332) +#define __NR_clock_gettime64 (__NR_Linux + 403) +#define __NR_clock_settime64 (__NR_Linux + 404) +#define __NR_clock_adjtime64 (__NR_Linux + 405) +#define __NR_clock_getres_time64 (__NR_Linux + 406) +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +#define __NR_timer_gettime64 (__NR_Linux + 408) +#define __NR_timer_settime64 (__NR_Linux + 409) +#define __NR_timerfd_gettime64 (__NR_Linux + 410) +#define __NR_timerfd_settime64 (__NR_Linux + 411) +#define __NR_utimensat_time64 (__NR_Linux + 412) +#define __NR_pselect6_time64 (__NR_Linux + 413) +#define __NR_ppoll_time64 (__NR_Linux + 414) +#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +#define __NR_recvmmsg_time64 (__NR_Linux + 417) +#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +#define __NR_semtimedop_time64 (__NR_Linux + 420) +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +#define __NR_futex_time64 (__NR_Linux + 422) +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) +#define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) +#define __NR_openat2 (__NR_Linux + 437) +#define __NR_pidfd_getfd (__NR_Linux + 438) +#define __NR_faccessat2 (__NR_Linux + 439) +#define __NR_process_madvise (__NR_Linux + 440) +#define __NR_epoll_pwait2 (__NR_Linux + 441) +#define __NR_mount_setattr (__NR_Linux + 442) +#define __NR_quotactl_fd (__NR_Linux + 443) +#define __NR_landlock_create_ruleset (__NR_Linux + 444) +#define __NR_landlock_add_rule (__NR_Linux + 445) +#define __NR_landlock_restrict_self (__NR_Linux + 446) +#define __NR_process_mrelease (__NR_Linux + 448) +#define __NR_futex_waitv (__NR_Linux + 449) +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) +#define __NR_cachestat (__NR_Linux + 451) +#define __NR_fchmodat2 (__NR_Linux + 452) +#define __NR_map_shadow_stack (__NR_Linux + 453) +#define __NR_futex_wake (__NR_Linux + 454) +#define __NR_futex_wait (__NR_Linux + 455) +#define __NR_futex_requeue (__NR_Linux + 456) +#define __NR_statmount (__NR_Linux + 457) +#define __NR_listmount (__NR_Linux + 458) +#define __NR_lsm_get_self_attr (__NR_Linux + 459) +#define __NR_lsm_set_self_attr (__NR_Linux + 460) +#define __NR_lsm_list_modules (__NR_Linux + 461) #else #error unknown mips64 abi |
From: Mark W. <ma...@so...> - 2024-07-05 09:48:22
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=646978d9adc5e334c10ad691f89421eb5c90541a commit 646978d9adc5e334c10ad691f89421eb5c90541a Author: Mark Wielaard <ma...@kl...> Date: Wed Jul 3 15:51:06 2024 +0200 vgdb: Handle EINTR and EAGAIN more consistently Always handle EINTR or EAGAIN when calling read or write. Also be consistent in the use of size_t and ssize_t for arguments and return values. This should make vgdb more robust against receiving signals or a blocked pipe at the wrong time. https://bugs.kde.org/show_bug.cgi?id=489676 Diff: --- NEWS | 1 + coregrind/vgdb.c | 138 +++++++++++++++++++++++++++++++++++-------------------- 2 files changed, 89 insertions(+), 50 deletions(-) diff --git a/NEWS b/NEWS index dde8713d60..33284c60c1 100644 --- a/NEWS +++ b/NEWS @@ -55,6 +55,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 489040 massif trace change to show the location increasing the stack 489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5 489338 arm64: Instruction fcvtas should round 322.5 to 323, but result is 322. +489676 vgdb handle EINTR and EAGAIN more consistently To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index 0b84f28e42..f05a766e8c 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -409,9 +409,9 @@ void acquire_lock(int fd, int valgrind_pid) Returns the nr of characters read, -1 if error. desc is a string used in tracing */ static -int read_buf(int fd, char* buf, const char* desc) +size_t read_buf(int fd, char* buf, const char* desc) { - int nrread; + ssize_t nrread; DEBUG(2, "reading %s\n", desc); /* The file descriptor is on non-blocking mode and read_buf should only be called when poll gave us an POLLIN event signaling the file @@ -420,8 +420,8 @@ int read_buf(int fd, char* buf, const char* desc) again. */ do { nrread = read(fd, buf, PBUFSIZ); - } while (nrread == -1 && errno == EAGAIN); - if (nrread == -1) { + } while (nrread == -1 && (errno == EINTR || errno == EAGAIN)); + if (nrread < 0) { ERROR(errno, "error reading %s\n", desc); return -1; } @@ -436,16 +436,20 @@ int read_buf(int fd, char* buf, const char* desc) valgrind process that there is new data. Returns True if write is ok, False if there was a problem. */ static -Bool write_buf(int fd, const char* buf, int size, const char* desc, Bool notify) +Bool write_buf(int fd, const char* buf, size_t size, const char* desc, + Bool notify) { - int nrwritten; - int nrw; + size_t nrwritten; + ssize_t nrw; DEBUG(2, "writing %s len %d %.*s notify: %d\n", desc, size, size, buf, notify); nrwritten = 0; while (nrwritten < size) { nrw = write(fd, buf+nrwritten, size - nrwritten); - if (nrw == -1) { + if (nrw < 0) { + if (errno == EINTR || errno == EAGAIN) + continue; + ERROR(errno, "error write %s\n", desc); return False; } @@ -489,7 +493,7 @@ static Bool read_from_gdb_write_to_pid(int to_pid) { char buf[PBUFSIZ+1]; // +1 for trailing \0 - int nrread; + ssize_t nrread; Bool ret; nrread = read_buf(from_gdb, buf, "from gdb on stdin"); @@ -729,7 +733,13 @@ getpkt(char *buf, int fromfd, int ackfd) TSFPRINTF(stderr, "Bad checksum, sentsum=0x%x, csum=0x%x, buf=%s\n", (c1 << 4) + c2, csum, buf); - if (write(ackfd, "-", 1) != 1) + ssize_t res = 0; + while (res == 0) { + res = write(ackfd, "-", 1); + if (res == -1 && (errno == EINTR || errno == EAGAIN)) + res = 0; + } + if (res < 0) ERROR(errno, "error when writing - (nack)\n"); else add_written(1); @@ -931,12 +941,15 @@ char *decode_hexstring (const char *buf, size_t prefixlen, size_t len) } static Bool -write_to_gdb (const char *m, int cnt) +write_to_gdb (const char *m, size_t cnt) { - int written = 0; + size_t written = 0; while (written < cnt) { - int res = write (to_gdb, m + written, cnt - written); + ssize_t res = write (to_gdb, m + written, cnt - written); if (res < 0) { + if (errno == EINTR || errno == EAGAIN) + continue; + perror ("write_to_gdb"); return False; } @@ -987,12 +1000,12 @@ create_packet(const char *msg) return p; } -static int read_one_char (char *c) +static ssize_t read_one_char (char *c) { - int i; + ssize_t i; do i = read (from_gdb, c, 1); - while (i == -1 && errno == EINTR); + while (i < 0 && (errno == EINTR || errno == EAGAIN)); return i; } @@ -1000,7 +1013,7 @@ static int read_one_char (char *c) static Bool send_packet(const char *reply, int noackmode) { - int ret; + ssize_t ret; char c; send_packet_start: @@ -1026,10 +1039,10 @@ send_packet_start: // Skipping any other characters. // Returns the size of the packet, 0 for end of input, // or -1 if no packet could be read. -static int receive_packet(char *buf, int noackmode) +static ssize_t receive_packet(char *buf, int noackmode) { - int bufcnt = 0; - int ret; + size_t bufcnt = 0; + ssize_t ret; char c; char c1 = '\0'; char c2 = '\0'; @@ -1162,7 +1175,7 @@ static void count_len(char delim, char *buf, size_t *len) static void early_exit (int exit_code, const char* exit_info) { char buf[PBUFSIZ+1]; - int pkt_size; + ssize_t pkt_size; struct stat fdstat; if (fstat(from_gdb, &fdstat) != 0) @@ -1179,7 +1192,7 @@ static void early_exit (int exit_code, const char* exit_info) alarm(5); pkt_size = receive_packet(buf, 0); if (pkt_size <= 0) - DEBUG(1, "early_exit receive_packet: %d\n", pkt_size); + DEBUG(1, "early_exit receive_packet: %zd\n", pkt_size); else { DEBUG(1, "packet received: '%s'\n", buf); sprintf(buf, "E.%s", exit_info); @@ -1241,12 +1254,14 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir, // Otherwise the child sent us an errno code about what went wrong. close (pipefd[1]); + size_t nr_read = 0; while (err == 0) { - int r = read (pipefd[0], &err, sizeof (int)); + ssize_t r = read (pipefd[0], ((char *)&err) + nr_read, + sizeof (int) - nr_read); if (r == 0) // end of file, good pipe closed after execve break; if (r == -1) { - if (errno == EINTR) + if (errno == EINTR || errno == EAGAIN) continue; else { err = errno; @@ -1272,11 +1287,15 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir, err = errno; perror("chdir"); // We try to write the result to the parent, but always exit. - int written = 0; + size_t written = 0; while (written < sizeof (int)) { - int nrw = write (pipefd[1], &err, sizeof (int) - written); - if (nrw == -1) + int nrw = write (pipefd[1], ((char *)&err) + 1, + sizeof (int) - written); + if (nrw == -1) { + if (errno == EINTR || errno == EAGAIN) + continue; break; + } written += nrw; } _exit (-1); @@ -1347,11 +1366,15 @@ int fork_and_exec_valgrind (int argc, char **argv, const char *working_dir, // perror ("execvp valgrind"); // printf ("execve returned??? confusing: %d\n", res); // We try to write the result to the parent, but always exit. - int written = 0; + size_t written = 0; while (written < sizeof (int)) { - int nrw = write (pipefd[1], &err, sizeof (int) - written); - if (nrw == -1) + ssize_t nrw = write (pipefd[1], ((char *) &err) + 1, + sizeof (int) - written); + if (nrw == -1) { + if (errno == EINTR || errno == EAGAIN) + continue; break; + } written += nrw; } _exit (-1); @@ -1368,7 +1391,8 @@ void do_multi_mode(int check_trials, int in_port) char *q_buf = vmalloc(PBUFSIZ+1); //save the qSupported packet sent by gdb //to send it to the valgrind gdbserver later q_buf[0] = '\0'; - int noackmode = 0, pkt_size = 0, bad_unknown_packets = 0; + int noackmode = 0, bad_unknown_packets = 0; + ssize_t pkt_size = 0; char *string = NULL; char *working_dir = NULL; DEBUG(1, "doing multi stuff...\n"); @@ -1377,7 +1401,7 @@ void do_multi_mode(int check_trials, int in_port) the pipe to gdb. */ pkt_size = receive_packet(buf, noackmode); if (pkt_size <= 0) { - DEBUG(1, "receive_packet: %d\n", pkt_size); + DEBUG(1, "receive_packet: %zd\n", pkt_size); break; } @@ -1554,7 +1578,7 @@ void do_multi_mode(int check_trials, int in_port) } free(len); - for (int i = 0; i < count; i++) + for (size_t i = 0; i < count; i++) free (decoded_string[i]); free (decoded_string); } else { @@ -1836,7 +1860,7 @@ void standalone_send_commands(int pid, int to_pid = -1; /* fd to write to pid */ int i; - int hi; + size_t hi; char hex[3]; unsigned char cksum; char *hexcommand; @@ -1889,8 +1913,8 @@ void standalone_send_commands(int pid, hexcommand = vmalloc(packet_len_for_command(commands[nc])); hexcommand[0] = 0; strcat(hexcommand, "$qRcmd,"); - for (i = 0; i < strlen(commands[nc]); i++) { - sprintf(hex, "%02x", (unsigned char) commands[nc][i]); + for (size_t nci = 0; nci < strlen(commands[nc]); nci++) { + sprintf(hex, "%02x", (unsigned char) commands[nc][nci]); // Need to use unsigned char, to avoid sign extension. strcat(hexcommand, hex); } @@ -1970,7 +1994,8 @@ static void report_pid(int pid, Bool on_stdout) { char cmdline_file[50]; // large enough - int fd, i; + int fd; + size_t i; FILE *out = on_stdout ? stdout : stderr; TSFPRINTF(out, "use --pid=%d for ", pid); @@ -1982,20 +2007,33 @@ void report_pid(int pid, Bool on_stdout) cmdline_file, strerror(errno)); fprintf(out, "(could not open process command line)\n"); } else { - char cmdline[100]; - ssize_t sz; - while ((sz = read(fd, cmdline, sizeof cmdline - 1)) > 0) { - for (i = 0; i < sz; i++) - if (cmdline[i] == 0) - cmdline[i] = ' '; - cmdline[sz] = 0; - fprintf(out, "%s", cmdline); - } - if (sz == -1) { - DEBUG(1, "error reading cmdline file %s %s\n", - cmdline_file, strerror(errno)); - fprintf(out, "(error reading process command line)"); + #define MAX_CMDLINE 4096 + char cmdline[MAX_CMDLINE]; + size_t nr_read = 0; + while (nr_read < MAX_CMDLINE - 1) { + ssize_t sz = read(fd, cmdline, MAX_CMDLINE - nr_read - 1); + if (sz == 0) + break; + if (sz < 0) { + if (errno == EINTR || errno == EAGAIN) + continue; + else { + DEBUG(1, "error reading cmdline file %s %s\n", + cmdline_file, strerror(errno)); + fprintf(out, "(error reading process command line)\n"); + close (fd); + return; + } + } + nr_read += sz; } + + for (i = 0; i < nr_read; i++) + if (cmdline[i] == 0) + cmdline[i] = ' '; + cmdline[nr_read] = 0; + + fprintf(out, "%s", cmdline); fprintf(out, "\n"); close(fd); } |
From: Paul F. <pa...@so...> - 2024-07-05 05:48:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=3b06d458ffc5cc8de8d701926e5d86979185fa04 commit 3b06d458ffc5cc8de8d701926e5d86979185fa04 Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 15:21:39 2024 +0200 Avoid dev/inode check on btrfs with --sanity-level=3 With --sanity-level=3 or higher the aspacemgr sanity checks the device/inode numbers from /proc/self/maps to the file stat results. These don't match on btrfs. So detect when a file is on a btrfs volume and ignore the check in that case. https://bugs.kde.org/show_bug.cgi?id=317127 Diff: --- NEWS | 1 + coregrind/m_aspacemgr/aspacemgr-linux.c | 13 +++++++++++++ include/vki/vki-linux.h | 6 ++++++ 3 files changed, 20 insertions(+) diff --git a/NEWS b/NEWS index 87aa1bd7dd..dde8713d60 100644 --- a/NEWS +++ b/NEWS @@ -31,6 +31,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. valgrind: vex x86->IR: unhandled instruction bytes: 0x66 0xF 0x3A 0x2 311655 --log-file=FILE leads to apparent fd leak +317127 Fedora18/x86_64 --sanity-level=3 : aspacem segment mismatch 337388 fcntl works on Valgrind's own file descriptors 377966 arm64 unhandled instruction dc zva392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 9362f65af3..bae4f781a8 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -891,6 +891,19 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot, /* hack apparently needed on MontaVista Linux */ if (filename && VG_(strstr)(filename, "/.lib-ro/")) cmp_devino = False; + + /* On linux systems we want to avoid dev/inode check on btrfs, + we can use the statfs call for that, except on nanomips + (which also doesn't have a sys_fstatfs syswrap). + See https://bugs.kde.org/show_bug.cgi?id=317127 */ +#if !defined(VGP_nanomips_linux) + struct vki_statfs statfs = {0}; + SysRes res = VG_(do_syscall2)(__NR_statfs, (UWord)filename, + (UWord)&statfs); + if (!sr_isError(res) && statfs.f_type == VKI_BTRFS_SUPER_MAGIC) { + cmp_devino = False; + } +#endif #endif /* If we are doing sloppy execute permission checks then we diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index be3d76690c..ccdb808af7 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -5455,6 +5455,12 @@ struct vki_open_how { #define VKI_CLOSE_RANGE_UNSHARE (1U << 1) #define VKI_CLOSE_RANGE_CLOEXEC (1U << 2) +//---------------------------------------------------------------------- +// From linux/magic.h +//---------------------------------------------------------------------- + +#define VKI_BTRFS_SUPER_MAGIC 0x9123683E + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ |
From: Mark W. <ma...@so...> - 2024-07-04 16:06:29
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d commit d73a8e745bf09cfc2d44e14f2ddd70fae2893d1d Author: Mark Wielaard <ma...@kl...> Date: Thu Jul 4 18:04:18 2024 +0200 gdbserver_tests filters remove more verbose python rpm load warnings The rpm python load warnings on Fedora became even more verbose. Filter out all stderr messages related to them so tests don't fail. Diff: --- gdbserver_tests/filter_gdb.in | 5 ++++- gdbserver_tests/filter_vgdb.in | 7 +++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index 6eecf40502..ccf201b2ac 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -56,7 +56,10 @@ s/^\[?1034hReading symbols/Reading symbols/ /^Try: zypper install -C/d # Remove python rpm module load warning -/^Unable to load 'rpm' module. Please install the python3-rpm package./d +/^Unable to load /d +/^the RPM suggestions /d +/^installing missing debuginfo /d +/^please install /d # Remove vgdb message /relaying data between gdb and process/d diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index 71f1f70253..b32be68973 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -47,8 +47,11 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | $SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | -# Remove python rpm module load warning -$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" | +# Remove python rpm module load warnings +$SED -e "/^Unable to load /d" | +$SED -e "/^the RPM suggestions /d" | +$SED -e "/^installing missing debuginfo /d" | +$SED -e "/^please install /d" | # and filter out any remaining empty lines $SED -e '/^$/d' |
From: Mark W. <ma...@so...> - 2024-07-03 13:57:19
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=645a7bc190a7664bb5be2e353b57e85ba6dec07d commit 645a7bc190a7664bb5be2e353b57e85ba6dec07d Author: Mark Wielaard <ma...@kl...> Date: Tue Jul 2 16:47:19 2024 +0200 VEX/priv/host_arm_isel.c (doHelperCall): Fix nextArgReg guard We need two args, so change the guard to nextArgReg + 1 >= ARM_N_ARGREGS. Diff: --- VEX/priv/host_arm_isel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VEX/priv/host_arm_isel.c b/VEX/priv/host_arm_isel.c index 8b32648438..d19efe5c3e 100644 --- a/VEX/priv/host_arm_isel.c +++ b/VEX/priv/host_arm_isel.c @@ -683,7 +683,7 @@ Bool doHelperCall ( /*OUT*/UInt* stackAdjustAfterCall, addInstr(env, ARMInstr_Imm32( argregs[nextArgReg], 0xAA )); nextArgReg++; } - if (nextArgReg >= ARM_N_ARGREGS) + if (nextArgReg + 1 >= ARM_N_ARGREGS) return False; /* out of argregs */ HReg raHi, raLo; iselInt64Expr(&raHi, &raLo, env, arg); |
From: Paul F. <pa...@so...> - 2024-07-01 11:48:45
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4b0f315eb6af30733d88d7967fec8331642cd9c4 commit 4b0f315eb6af30733d88d7967fec8331642cd9c4 Author: Paul Floyd <pj...@wa...> Date: Mon Jul 1 13:47:07 2024 +0200 arm64 regtest: bug489338 testcase needs to link with maths library on Linux Diff: --- none/tests/arm64/Makefile.am | 1 + 1 file changed, 1 insertion(+) diff --git a/none/tests/arm64/Makefile.am b/none/tests/arm64/Makefile.am index 8e57118e31..95a74e2b8a 100644 --- a/none/tests/arm64/Makefile.am +++ b/none/tests/arm64/Makefile.am @@ -91,6 +91,7 @@ fp_and_simd_SOURCES = fp_and_simd.c simd.h simd.c fp_and_simd_v82_SOURCES = fp_and_simd_v82.c simd.h simd.c sha512_v82_SOURCES = sha512_v82.c simd.h simd.c +bug489338_LDADD = -lm fp_and_simd_LDADD = -lm simd_v81_LDADD = -lm fp_and_simd_v82_LDADD = -lm |
From: Paul F. <pa...@so...> - 2024-07-01 06:25:15
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=582d38aa79310b06e9a5a51d3fb32a05b2a10b5b commit 582d38aa79310b06e9a5a51d3fb32a05b2a10b5b Author: Paul Floyd <pj...@wa...> Date: Mon Jul 1 08:24:39 2024 +0200 arm64 regtest: add 2 tests for bug489338 Diff: --- .gitignore | 2 + NEWS | 1 + none/tests/arm64/Makefile.am | 15 ++- none/tests/arm64/bug489338.c | 33 +++++++ none/tests/arm64/bug489338.stderr.exp | 0 none/tests/arm64/bug489338.stdout.exp | 6 ++ none/tests/arm64/bug489338.vgtest | 2 + none/tests/arm64/fcvta_s_u.cpp | 178 ++++++++++++++++++++++++++++++++++ none/tests/arm64/fcvta_s_u.stderr.exp | 0 none/tests/arm64/fcvta_s_u.vgtest | 2 + 10 files changed, 234 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index ae366c5444..33e71c133f 100644 --- a/.gitignore +++ b/.gitignore @@ -1810,9 +1810,11 @@ /none/tests/arm64/allexec /none/tests/arm64/atomics_v81 /none/tests/arm64/bug484426 +/none/tests/arm64/bug489338 /none/tests/arm64/crc32 /none/tests/arm64/cvtf_imm /none/tests/arm64/dc_cvax +/none/tests/arm64/fcvta_s_u /none/tests/arm64/fmadd_sub /none/tests/arm64/fp_and_simd /none/tests/arm64/fp_and_simd_v82 diff --git a/NEWS b/NEWS index d860bd07b2..87aa1bd7dd 100644 --- a/NEWS +++ b/NEWS @@ -53,6 +53,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests 489040 massif trace change to show the location increasing the stack 489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5 +489338 arm64: Instruction fcvtas should round 322.5 to 323, but result is 322. To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/none/tests/arm64/Makefile.am b/none/tests/arm64/Makefile.am index 071cce0057..8e57118e31 100644 --- a/none/tests/arm64/Makefile.am +++ b/none/tests/arm64/Makefile.am @@ -5,9 +5,11 @@ dist_noinst_SCRIPTS = filter_stderr filter_nan EXTRA_DIST = \ bug484426.stdout.exp bug484426.stderr.exp bug484426.vgtest \ - crc32.stdout.exp crc32.stderr.exp crc32.vgtest \ - cvtf_imm.stdout.exp cvtf_imm.stderr.exp cvtf_imm.vgtest \ - dc_cvax.vgtest dc_cvax.stderr.exp \ + bug489338.stdout.exp bug489338.stderr.exp bug489338.vgtest \ + crc32.stdout.exp crc32.stderr.exp crc32.vgtest \ + cvtf_imm.stdout.exp cvtf_imm.stderr.exp cvtf_imm.vgtest \ + dc_cvax.vgtest dc_cvax.stderr.exp \ + fcvta_s_u.vgtest fcvta_s_u.stderr.exp \ fp_and_simd.stdout.exp fp_and_simd.stderr.exp fp_and_simd.vgtest \ frinta_frintn.stderr.exp frinta_frintn.vgtest \ integer.stdout.exp integer.stderr.exp integer.vgtest \ @@ -16,7 +18,7 @@ EXTRA_DIST = \ atomics_v81.stdout.exp atomics_v81.stderr.exp atomics_v81.vgtest \ simd_v81.stdout.exp simd_v81.stderr.exp simd_v81.vgtest \ simd_dotprod.stdout.exp simd_dotprod.stderr.exp simd_dotprod.vgtest \ - fmadd_sub.stdout.exp fmadd_sub.stderr.exp fmadd_sub.vgtest \ + fmadd_sub.stdout.exp fmadd_sub.stderr.exp fmadd_sub.vgtest \ fp_and_simd_v82.stdout.exp fp_and_simd_v82.stderr.exp \ fp_and_simd_v82.vgtest \ ldxp_stxp_basisimpl.stdout.exp ldxp_stxp_basisimpl.stderr.exp \ @@ -28,6 +30,7 @@ EXTRA_DIST = \ check_PROGRAMS = \ allexec \ bug484426 \ + bug489338 \ cvtf_imm \ dc_cvax \ fp_and_simd \ @@ -53,7 +56,7 @@ if HAVE_SHA3 endif if HAVE_CXX17 - check_PROGRAMS += frinta_frintn + check_PROGRAMS += fcvta_s_u frinta_frintn endif if BUILD_ARMV82_DOTPROD_TESTS @@ -78,6 +81,8 @@ fp_and_simd_v82_CFLAGS = $(AM_CFLAGS) -march=armv8.2-a+fp16+crypto # SHA-512 is not part of SHA-3, either as an algorithm or in Arm features, but # GCC lumps SHA-512 and SHA-3 extensions together as "sha3". sha512_v82_CFLAGS = $(AM_CFLAGS) -march=armv8.2-a+sha3 +fcvta_s_u_SOURCES = fcvta_s_u.cpp +fcvta_s_u_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 frinta_frintn_SOURCES = frinta_frintn.cpp frinta_frintn_CXXFLAGS = ${AM_CXXFLAGS} -std=c++17 integer_CFLAGS = $(AM_CFLAGS) -g -O0 -DTEST_BFM=0 diff --git a/none/tests/arm64/bug489338.c b/none/tests/arm64/bug489338.c new file mode 100644 index 0000000000..481d744643 --- /dev/null +++ b/none/tests/arm64/bug489338.c @@ -0,0 +1,33 @@ +/* +cat fp-valgrind-test.c +gcc -g -O2 fp-valgrind-test.c -o fp-valgrind-test +./fp-valgrind-test +valgrind ./fp-valgrind-test +gdb -q --args ./fp-valgrind-test +disassemble main +q +*/ + +#include <stdio.h> +#include <math.h> + +double value(int s) +{ + switch (s) { + case 0: return -322.500001; break; + case 1: return -322.5; break; + case 2: return -322.499999; break; + case 3: return 322.499999; break; + case 4: return 322.5; break; + default: return 322.500001; break; + } +} + +int main() +{ + for (int i = 0; i < 6; i++) { + volatile double a = value(i); + int b = (int)round(a); + printf("i=%d a=%f a=0x%llx b=%d\n", i, a, *(long long unsigned int*)&a, b); + } +} diff --git a/none/tests/arm64/bug489338.stderr.exp b/none/tests/arm64/bug489338.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/arm64/bug489338.stdout.exp b/none/tests/arm64/bug489338.stdout.exp new file mode 100644 index 0000000000..a26feaaf19 --- /dev/null +++ b/none/tests/arm64/bug489338.stdout.exp @@ -0,0 +1,6 @@ +i=0 a=-322.500001 a=0xc0742800010c6f7a b=-323 +i=1 a=-322.500000 a=0xc074280000000000 b=-323 +i=2 a=-322.499999 a=0xc07427fffef39086 b=-322 +i=3 a=322.499999 a=0x407427fffef39086 b=322 +i=4 a=322.500000 a=0x4074280000000000 b=323 +i=5 a=322.500001 a=0x40742800010c6f7a b=323 diff --git a/none/tests/arm64/bug489338.vgtest b/none/tests/arm64/bug489338.vgtest new file mode 100644 index 0000000000..80f0b39434 --- /dev/null +++ b/none/tests/arm64/bug489338.vgtest @@ -0,0 +1,2 @@ +prog: bug489338 +vgopts: -q diff --git a/none/tests/arm64/fcvta_s_u.cpp b/none/tests/arm64/fcvta_s_u.cpp new file mode 100644 index 0000000000..4bd5681eda --- /dev/null +++ b/none/tests/arm64/fcvta_s_u.cpp @@ -0,0 +1,178 @@ +/* + * An extra testcase for bug489338 + * The testcase supplied only tests op-codes used by round() + */ + +#include <type_traits> +#include <cassert> +#include <iostream> + +template<typename T, typename U> +void test_fcvtas(T input, U expected) +{ + U result; + U* rp(&result); + T* ip(&input); + if constexpr (std::is_same_v<double, T> == true) + { + if constexpr (std::is_same_v<long, U> == true) + { + // double to long + __asm__ __volatile__( + "ldr d0, [%1];\n" + "fcvtas x0, d0;\n" + "str x0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "d0", "x0"); + assert(result == expected); + } + else + { + // double to int + __asm__ __volatile__( + "ldr d0, [%1];\n" + "fcvtas w0, d0;\n" + "str w0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "d0", "x0"); + assert(result == expected); + } + } + else + { + if constexpr (std::is_same_v<long, U> == true) + { + // float to long + __asm__ __volatile__( + "ldr s0, [%1];\n" + "fcvtas x0, s0;\n" + "str x0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "s0", "x0"); + assert(result == expected); + } + else + { + // float to int + __asm__ __volatile__( + "ldr s0, [%1];\n" + "fcvtas w0, s0;\n" + "str w0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "s0", "w0"); + assert(result == expected); + } + } +} + +template<typename T, typename U> +void test_fcvtau(T input, U expected) +{ + U result; + U* rp(&result); + T* ip(&input); + if constexpr (std::is_same_v<double, T> == true) + { + if constexpr (std::is_same_v<unsigned long, U> == true) + { + // double to unsigned long + __asm__ __volatile__( + "ldr d0, [%1];\n" + "fcvtau x0, d0;\n" + "str x0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "d0", "x0"); + assert(result == expected); + } + else + { + // double to unsigned int + __asm__ __volatile__( + "ldr d0, [%1];\n" + "fcvtau w0, d0;\n" + "str w0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "d0", "w0"); + assert(result == expected); + } + } + else + { + if constexpr (std::is_same_v<unsigned long, U> == true) + { + // float to unsigned long + __asm__ __volatile__( + "ldr s0, [%1];\n" + "fcvtau x0, s0;\n" + "str x0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "s0", "x0"); + assert(result == expected); + } + else + { + // float to unsigned int + __asm__ __volatile__( + "ldr s0, [%1];\n" + "fcvtau w0, s0;\n" + "str w0, [%0];\n" + : "+rm" (rp) + : "r" (ip) + : "memory", "s0", "w0"); + assert(result == expected); + } + } +} + + +int main() +{ + // round "away from zero" + test_fcvtas(1.5, 2L); + test_fcvtas(2.5, 3L); + test_fcvtas(-1.5, -2L); + test_fcvtas(-2.5, -3L); + test_fcvtas(0.0, 0L); + + test_fcvtas(1.5, 2); + test_fcvtas(2.5, 3); + test_fcvtas(-1.5, -2); + test_fcvtas(-2.5, -3); + test_fcvtas(0.0, 0); + + test_fcvtas(1.5F, 2L); + test_fcvtas(2.5F, 3L); + test_fcvtas(-1.5F, -2L); + test_fcvtas(-2.5F, -3L); + test_fcvtas(0.0F, 0L); + + test_fcvtas(1.5F, 2); + test_fcvtas(2.5F, 3); + test_fcvtas(-1.5F, -2); + test_fcvtas(-2.5F, -3); + test_fcvtas(0.0F, 0); + + test_fcvtau(1.5, 2UL); + test_fcvtau(2.5, 3UL); + test_fcvtau(0.0, 0UL); + + test_fcvtau(1.5, 2U); + test_fcvtau(2.5, 3U); + test_fcvtau(0.0, 0U); + + test_fcvtau(1.5F, 2UL); + test_fcvtau(2.5F, 3UL); + test_fcvtau(0.0F, 0UL); + + test_fcvtau(1.5F, 2U); + test_fcvtau(2.5F, 3U); + test_fcvtau(0.0F, 0U); +} + diff --git a/none/tests/arm64/fcvta_s_u.stderr.exp b/none/tests/arm64/fcvta_s_u.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/arm64/fcvta_s_u.vgtest b/none/tests/arm64/fcvta_s_u.vgtest new file mode 100644 index 0000000000..f3454b54e2 --- /dev/null +++ b/none/tests/arm64/fcvta_s_u.vgtest @@ -0,0 +1,2 @@ +prog: fcvta_s_u +vgopts: -q |
From: Paul F. <pa...@so...> - 2024-07-01 05:53:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2 commit de4c79ffbcd2d5e89495cee8feadf77d5f3a6ef2 Author: Bernhard Übelacker <ber...@ma...> Date: Thu Jun 27 22:51:09 2024 +0200 arm64: Fix fcvtas instruction. Diff: --- VEX/priv/guest_arm64_toIR.c | 74 +++++++++++++++++++++++++-------------------- VEX/priv/host_arm64_defs.c | 23 ++++++++------ VEX/priv/host_arm64_defs.h | 3 +- VEX/priv/host_arm64_isel.c | 12 +++++--- 4 files changed, 64 insertions(+), 48 deletions(-) diff --git a/VEX/priv/guest_arm64_toIR.c b/VEX/priv/guest_arm64_toIR.c index c3957bf58b..e6b92c7a04 100644 --- a/VEX/priv/guest_arm64_toIR.c +++ b/VEX/priv/guest_arm64_toIR.c @@ -15937,7 +15937,7 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn) } else { vassert(op == BITS3(1,0,0) || op == BITS3(1,0,1)); switch (rm) { - case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST; break; + case BITS2(0,0): ch = 'a'; irrm = Irrm_NEAREST_TIE_AWAY_0; break; default: vassert(0); } } @@ -15961,45 +15961,53 @@ Bool dis_AdvSIMD_fp_to_from_int_conv(/*MB_OUT*/DisResult* dres, UInt insn) IROp iop = iops[ix]; // A bit of ATCery: bounce all cases we haven't seen an example of. if (/* F32toI32S */ - (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */ - || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,S */ + (iop == Iop_F32toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Sn */ + || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,S */ + || (iop == Iop_F32toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,S */ /* F32toI32U */ - || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */ - || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,S */ + || (iop == Iop_F32toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Sn */ + || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,S */ + || (iop == Iop_F32toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,S */ /* F32toI64S */ - || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */ - || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,S */ + || (iop == Iop_F32toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Sn */ + || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,S */ + || (iop == Iop_F32toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,S */ /* F32toI64U */ - || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */ - || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,S */ + || (iop == Iop_F32toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Sn */ + || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,S */ + || (iop == Iop_F32toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,S */ /* F64toI32S */ - || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */ - || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST)/* FCVT{A,N}S W,D */ + || (iop == Iop_F64toI32S && irrm == Irrm_ZERO) /* FCVTZS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_NegINF) /* FCVTMS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_PosINF) /* FCVTPS Wd,Dn */ + || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST) /* FCVTNS W,D */ + || (iop == Iop_F64toI32S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS W,D */ /* F64toI32U */ - || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */ - || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST)/* FCVT{A,N}U W,D */ + || (iop == Iop_F64toI32U && irrm == Irrm_ZERO) /* FCVTZU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_NegINF) /* FCVTMU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_PosINF) /* FCVTPU Wd,Dn */ + || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST) /* FCVTNU W,D */ + || (iop == Iop_F64toI32U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU W,D */ /* F64toI64S */ - || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */ - || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST)/* FCVT{A,N}S X,D */ + || (iop == Iop_F64toI64S && irrm == Irrm_ZERO) /* FCVTZS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_NegINF) /* FCVTMS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_PosINF) /* FCVTPS Xd,Dn */ + || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST) /* FCVTNS X,D */ + || (iop == Iop_F64toI64S && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAS X,D */ /* F64toI64U */ - || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */ - || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST)/* FCVT{A,N}U X,D */ + || (iop == Iop_F64toI64U && irrm == Irrm_ZERO) /* FCVTZU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_NegINF) /* FCVTMU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_PosINF) /* FCVTPU Xd,Dn */ + || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST) /* FCVTNU X,D */ + || (iop == Iop_F64toI64U && irrm == Irrm_NEAREST_TIE_AWAY_0)/* FCVTAU X,D */ ) { /* validated */ } else { diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c index 0b59c87cd3..dc5d198e0d 100644 --- a/VEX/priv/host_arm64_defs.c +++ b/VEX/priv/host_arm64_defs.c @@ -1142,13 +1142,14 @@ ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS ) { return i; } ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS, - UChar armRM ) { + UChar armRM, Bool tiesToAway ) { ARM64Instr* i = LibVEX_Alloc_inline(sizeof(ARM64Instr)); i->tag = ARM64in_VCvtF2I; i->ARM64in.VCvtF2I.how = how; i->ARM64in.VCvtF2I.rD = rD; i->ARM64in.VCvtF2I.rS = rS; i->ARM64in.VCvtF2I.armRM = armRM; + i->ARM64in.VCvtF2I.tiesToAway = tiesToAway; vassert(armRM <= 3); return i; } @@ -4463,47 +4464,51 @@ Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc, ---------------- 01 -------------- FCVTP-------- (round to +inf) ---------------- 10 -------------- FCVTM-------- (round to -inf) ---------------- 11 -------------- FCVTZ-------- (round to zero) + ---------------- 00 100 ---------- FCVTAS------- (nearest, ties away) + ---------------- 00 101 ---------- FCVTAU------- (nearest, ties away) Rd is Xd when sf==1, Wd when sf==0 Fn is Dn when x==1, Sn when x==0 20:19 carry the rounding mode, using the same encoding as FPCR + 18 enable translation to FCVTA{S,U} */ UInt rD = iregEnc(i->ARM64in.VCvtF2I.rD); UInt rN = dregEnc(i->ARM64in.VCvtF2I.rS); ARM64CvtOp how = i->ARM64in.VCvtF2I.how; UChar armRM = i->ARM64in.VCvtF2I.armRM; + UChar bit18 = i->ARM64in.VCvtF2I.tiesToAway ? 4 : 0; /* Just handle cases as they show up. */ switch (how) { case ARM64cvt_F64_I32S: /* FCVTxS Wd, Dn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X01100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I32U: /* FCVTxU Wd, Dn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X01100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I64S: /* FCVTxS Xd, Dn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X01100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F64_I64U: /* FCVTxU Xd, Dn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X01100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I32S: /* FCVTxS Wd, Sn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X00100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I32U: /* FCVTxU Wd, Sn */ - *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X000, X11110, X00100001 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I64S: /* FCVTxS Xd, Sn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X00100000 | (armRM << 3) | bit18, X000000, rN, rD); break; case ARM64cvt_F32_I64U: /* FCVTxU Xd, Sn */ - *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3), + *p++ = X_3_5_8_6_5_5(X100, X11110, X00100001 | (armRM << 3) | bit18, X000000, rN, rD); break; default: diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h index e78d8045ff..f24a2f4ba6 100644 --- a/VEX/priv/host_arm64_defs.h +++ b/VEX/priv/host_arm64_defs.h @@ -816,6 +816,7 @@ typedef HReg rS; // src, a D or S register UChar armRM; // ARM encoded RM: // 00=nearest, 01=+inf, 10=-inf, 11=zero + Bool tiesToAway; } VCvtF2I; /* Convert between 32-bit and 64-bit FP values (both ways). (FCVT) */ struct { @@ -1062,7 +1063,7 @@ extern ARM64Instr* ARM64Instr_VLdStD ( Bool isLoad, HReg dD, HReg rN, extern ARM64Instr* ARM64Instr_VLdStQ ( Bool isLoad, HReg rQ, HReg rN ); extern ARM64Instr* ARM64Instr_VCvtI2F ( ARM64CvtOp how, HReg rD, HReg rS ); extern ARM64Instr* ARM64Instr_VCvtF2I ( ARM64CvtOp how, HReg rD, HReg rS, - UChar armRM ); + UChar armRM, Bool tiesToAway ); extern ARM64Instr* ARM64Instr_VCvtSD ( Bool sToD, HReg dst, HReg src ); extern ARM64Instr* ARM64Instr_VCvtHS ( Bool hToS, HReg dst, HReg src ); extern ARM64Instr* ARM64Instr_VCvtHD ( Bool hToD, HReg dst, HReg src ); diff --git a/VEX/priv/host_arm64_isel.c b/VEX/priv/host_arm64_isel.c index 645358586f..34c5265590 100644 --- a/VEX/priv/host_arm64_isel.c +++ b/VEX/priv/host_arm64_isel.c @@ -1921,17 +1921,19 @@ static HReg iselIntExpr_R_wrk ( ISelEnv* env, IRExpr* e ) UInt irrm = arg1con->Ico.U32; /* Find the ARM-encoded equivalent for |irrm|. */ UInt armrm = 4; /* impossible */ + Bool tiesToAway = False; switch (irrm) { - case Irrm_NEAREST: armrm = 0; break; - case Irrm_NegINF: armrm = 2; break; - case Irrm_PosINF: armrm = 1; break; - case Irrm_ZERO: armrm = 3; break; + case Irrm_NEAREST: armrm = 0; break; + case Irrm_NegINF: armrm = 2; break; + case Irrm_PosINF: armrm = 1; break; + case Irrm_ZERO: armrm = 3; break; + case Irrm_NEAREST_TIE_AWAY_0: armrm = 0; tiesToAway = True; break; default: goto irreducible; } HReg src = (srcIsD ? iselDblExpr : iselFltExpr) (env, e->Iex.Binop.arg2); HReg dst = newVRegI(env); - addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm)); + addInstr(env, ARM64Instr_VCvtF2I(cvt_op, dst, src, armrm, tiesToAway)); return dst; } } /* local scope */ |
From: Mark W. <ma...@so...> - 2024-06-30 18:21:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=10a22445d747817932692b1c1ee3faa726121cb4 commit 10a22445d747817932692b1c1ee3faa726121cb4 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 30 20:17:32 2024 +0200 Implement VMOVQ xmm1, xmm2/m64 We implemented the memory variant already, but not the reg variant. Add a separate avx-vmovq testcase, because avx-1 is already really big. https://bugs.kde.org/show_bug.cgi?id=391148 https://bugs.kde.org/show_bug.cgi?id=417572 https://bugs.kde.org/show_bug.cgi?id=489088 Diff: --- .gitignore | 1 + NEWS | 3 + VEX/priv/guest_amd64_toIR.c | 10 ++- none/tests/amd64/Makefile.am | 6 +- none/tests/amd64/avx-vmovq.c | 19 ++++ none/tests/amd64/avx-vmovq.stderr.exp | 0 none/tests/amd64/avx-vmovq.stdout.exp | 162 ++++++++++++++++++++++++++++++++++ none/tests/amd64/avx-vmovq.vgtest | 3 + 8 files changed, 200 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 6379006fe8..ae366c5444 100644 --- a/.gitignore +++ b/.gitignore @@ -1663,6 +1663,7 @@ /none/tests/amd64/amd64locked /none/tests/amd64/asorep /none/tests/amd64/avx-1 +/none/tests/amd64/avx-vmovq /none/tests/amd64/avx2-1 /none/tests/amd64/avx_estimate_insn /none/tests/amd64/bmi diff --git a/NEWS b/NEWS index 9583c26e7e..d860bd07b2 100644 --- a/NEWS +++ b/NEWS @@ -34,8 +34,10 @@ are not entered into bugzilla tend to get forgotten about or ignored. 337388 fcntl works on Valgrind's own file descriptors 377966 arm64 unhandled instruction dc zva392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) +391148 Unhandled AVX instruction vmovq %xmm9,%xmm1 392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) 412377 SIGILL on cache flushes on arm64 +417572 vex amd64->IR: unhandled instruction bytes: 0xC5 0x79 0xD6 0xED 0xC5 444781 MIPS: wrong syscall numbers used 447989 Support Armv8.2 SHA-512 instructions 453044 gbserver_tests failures in aarch64 @@ -50,6 +52,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 488379 --track-fds=yes errors that cannot be suppressed with --xml-file= 488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests 489040 massif trace change to show the location increasing the stack +489088 Valgrind throws unhandled instruction bytes: 0xC5 0x79 0xD6 0xE0 0xC5 To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index 28c37f0922..57a8a434b8 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -27015,7 +27015,6 @@ Long dis_ESC_0F__VEX ( break; case 0xD6: - /* I can't even find any Intel docs for this one. */ /* Basically: 66 0F D6 = MOVQ -- move 64 bits from G (lo half xmm) to E (mem or lo half xmm). Looks like L==0(128), W==0 (WIG, maybe?) */ @@ -27024,8 +27023,15 @@ Long dis_ESC_0F__VEX ( UChar modrm = getUChar(delta); UInt rG = gregOfRexRM(pfx,modrm); if (epartIsReg(modrm)) { - /* fall through, awaiting test case */ /* dst: lo half copied, hi half zeroed */ + UInt rE = eregOfRexRM(pfx,modrm); + putXMMRegLane64( rE, 0, getXMMRegLane64( rG, 0 )); + /* zero bits 255:64 */ + putXMMRegLane64( rE, 1, mkU64(0) ); + putYMMRegLane128( rE, 1, mkV128(0) ); + DIP("vmovq %s,%s\n", nameXMMReg(rG), nameXMMReg(rE)); + delta += 1; + goto decode_success; } else { addr = disAMode ( &alen, vbi, pfx, delta, dis_buf, 0 ); storeLE( mkexpr(addr), getXMMRegLane64( rG, 0 )); diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index 83029c1559..e4d907c3dd 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -3,7 +3,7 @@ include $(top_srcdir)/Makefile.tool-tests.am dist_noinst_SCRIPTS = filter_cpuid filter_inf_nan filter_stderr gen_insn_test.pl -# Used by avx-1.c and avx_estimate_insn.c +# Used by avx-1.c, avx-vmovq and avx_estimate_insn.c noinst_HEADERS = avx_tests.h CLEANFILES = $(addsuffix .c,$(INSN_TESTS)) @@ -29,6 +29,7 @@ EXTRA_DIST = \ avx-1.vgtest avx-1.stdout.exp avx-1.stderr.exp \ avx_estimate_insn.vgtest avx_estimate_insn.stderr.exp \ avx_estimate_insn.stdout.exp avx_estimate_insn.stdout.exp-amd \ + avx-vmovq.vgtest avx-vmovq.stdout.exp avx-vmovq.stderr.exp \ avx2-1.vgtest avx2-1.stdout.exp avx2-1.stderr.exp \ asorep.stderr.exp asorep.stdout.exp asorep.vgtest \ bmi.stderr.exp bmi.stdout.exp bmi.vgtest \ @@ -131,7 +132,8 @@ endif if BUILD_AVX_TESTS if BUILD_VPCLMULQDQ_TESTS check_PROGRAMS += avx-1 \ - avx_estimate_insn + avx_estimate_insn \ + avx-vmovq endif if BUILD_FMA4_TESTS check_PROGRAMS += fma4 diff --git a/none/tests/amd64/avx-vmovq.c b/none/tests/amd64/avx-vmovq.c new file mode 100644 index 0000000000..da8a1959b3 --- /dev/null +++ b/none/tests/amd64/avx-vmovq.c @@ -0,0 +1,19 @@ +#include"avx_tests.h" + +GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_HIGH, + "vmovq %%xmm9, %%xmm7", + "vmovq %%xmm8, (%%rsi)") + +// xmm0 is scratch +GEN_test_RandM(VMOVQ_XMM_to_XMM_LOW_LOW_HIGH, + "vmovq %%xmm0, %%xmm7; vmovq %%xmm8, %%xmm0", + "vmovq %%xmm0, (%%rsi); vmovq %%xmm9, %%xmm0") + +int main ( void ) +{ + DO_D( VMOVQ_XMM_to_XMM_LOW_HIGH ); + DO_D( VMOVQ_XMM_to_XMM_LOW_LOW_HIGH ); + + return 0; +} + diff --git a/none/tests/amd64/avx-vmovq.stderr.exp b/none/tests/amd64/avx-vmovq.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/amd64/avx-vmovq.stdout.exp b/none/tests/amd64/avx-vmovq.stdout.exp new file mode 100644 index 0000000000..f5b45e54de --- /dev/null +++ b/none/tests/amd64/avx-vmovq.stdout.exp @@ -0,0 +1,162 @@ +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + 7d6528c5fa956a0d.69c3e9a6af27d13b.5175e39d19c9ca1e.98f24a4984175700 + b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50 + 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38 + cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5 + 56b01a12b0ca1583 + after + 0000000000000000.0000000000000000.0000000000000000.4a4bc43968bc40e5 + b6d2fb5aa7bc5127.fe9915e556a044b2.60b160857d45c484.47b8d8c0eeef1e50 + 065d77195d623e6b.842adc6450659e17.19a348215c3a67fd.399182c2dbcc2d38 + cb509970b8136c85.d740b80eb7839b97.d89998df5035ed36.4a4bc43968bc40e5 + 56b01a12b0ca1583 +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.f9dd4a29f8c093db + cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597 + f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17 + 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06 + 81f2a547be8d1811 + after + 398e0039cf03663d.5ff85bc9535c191f.d3a727d1a705f65d.d8bc5c6dee699597 + cfaff39be272ef40.20a1bb92cbc97fe8.542da4983df76c96.d8bc5c6dee699597 + f4e06e2205236eb7.6897b536bbe4da8a.369dab4f9465b86e.d182c916cebc2e17 + 84ededbc53239dcf.95264321bf3b68b2.55c2b9e2c95c9810.407b8d9035449b06 + 81f2a547be8d1811 + +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + f0350ca70523e0e4.5ba1ec54e87d39b3.019963bf7459630b.8d69483df7e8c6a9 + e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64 + c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e + e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3 + 96084deb9ed0411e + after + 0000000000000000.0000000000000000.0000000000000000.6262dd37727c80f3 + e98ebd1ca893312a.54cae7d5e13dfe91.0a3e0f7c75cb0842.b95ed64d3b13ff64 + c84ab71340684590.4d325b2d5a70a792.0a5f45c55f1c9202.b76ddefcb0ebfe6e + e9b5f3f66b2e58c1.21a6c3476d21f1e5.5f490104ced83ff8.6262dd37727c80f3 + 96084deb9ed0411e +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.63483da65c8c49d0 + 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35 + ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4 + ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159 + 8404eb7f0cf4ca6f + after + 2e2dac0350f6fd1c.a81b6e33c572a86a.acf29b0f395c98b4.73a8f718a8c3ec35 + 089b756aa3f77018.61c82534e9bf6f37.c9e25f72d82e582b.73a8f718a8c3ec35 + ff1f240eb3e1553f.6f07136773a2ead3.56428c5a66a2ec77.ecb42ac54b0966d4 + ee8536da9dbf68bc.3026343700a654eb.2ddd9db4ffc411c4.28bad218e4ebf159 + 8404eb7f0cf4ca6f + +VMOVQ_XMM_to_XMM_LOW_HIGH(reg) + before + 5cdf726562b02dc2.b39925ba7d9d67bc.ff6f850f2c57ea2a.2c810e6dc1a1833d + 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f + f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66 + 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d + dc4c446c804bf950 + after + 0000000000000000.0000000000000000.0000000000000000.aa927a03090dfc6d + 0c9761367fac55ff.28276f9a6e880c6b.372f015d9242e83d.2ef85b6fc544fd0f + f078b65e01737fd2.2bfa8f668c8b14f4.36b2a38dcef18acf.0e0f01a829ba3c66 + 65ce6d498492e7e7.96df010bf4b23b84.57436a097df30b8d.aa927a03090dfc6d + dc4c446c804bf950 +VMOVQ_XMM_to_XMM_LOW_HIGH(mem) + before + 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.f5304f3e3ad1a923 + 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c + 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685 + bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa + 8b5fccbef0e1e256 + after + 810bdacfab80ee3d.c5e48064a393c8e9.47a34273c10a3c47.6ec34f98a2199d3c + 769ab818a5b7985e.6d08ed19fa045f84.1810cd8c109ed568.6ec34f98a2199d3c + 95c45b338afcb3df.b984aed62671e865.e6f21d40fc7bc013.1c4a678450562685 + bc563e0c775bfaed.05a5c205c3659f38.8e17b17da2acb976.5d0f926ce1157eaa + 8b5fccbef0e1e256 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 048612e51a468e36.c51cdd8f87e12ab4.acb722146c6cbfa9.ea4a022e1d3d7dbb + 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e + 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c + c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391 + 9d8e66ea90352a18 + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 22cf5e4cfad1bdf5.8de2b4a9d799ff5f.0c05cb6ebd128663.d7568e3e8a3ac80e + 4288ae612c0dad40.f0733f448390351b.80ddba7e53e42d12.3208cf9b04b0569c + c1fbfd8f4d8698c2.cb9dfb4ea5d18713.6489eab2c96df363.d52c4330a7aae391 + 9d8e66ea90352a18 +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.14575775bc3a1202 + 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a + 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8 + 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268 + fbc4208894fdc0f5 + after + 66fab2b3db5ce85e.f9754842f9c9ba28.f82a63b15c68b274.2525252525252525 + 0c3ca578a32bd88e.474289e7cb61501e.54e7f35bc162726a.ec91fe34c7d6c79a + 6b1fba2604afb8d5.08aebee85fda964f.bba02737f3c98220.4784d95987cd4ed8 + 5f706da71bf2425f.9605e2b252c1c868.09217c310baca0c3.837be65197abe268 + fbc4208894fdc0f5 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 0aaa836b194e242c.c5fc3ae904033357.4e92f1b240a12214.1a366d352714867e + 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e + 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef + 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc + 2c3ffa1aebe6a4d2 + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 0e780c65c22b4ab8.778d9ed6d9eb46ea.8ca3e752c306df00.caab752f630ff07e + 627bb6e12d1f6d46.51ef145cb9b83843.ac82c1007a7d3cd8.f54b130cdaa89cef + 61ff7d4df3b6ca81.31f01866bd76c58f.0a7c7a27fe917447.77e3c0b6a9ec44fc + 2c3ffa1aebe6a4d2 +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.02dd0e32eecfc5fa + 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c + 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda + 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60 + 16559ec50352a3d9 + after + f02b3b25bca27a9c.69505d14b27d9d16.f25b26e0042fa9fa.2525252525252525 + 9f7301c1392d8087.d4ba52a206ff21b1.70fbbab6a7f19faf.f0f1798fe3c1699c + 15e3c8dc7e9273bf.0088596389c893fd.879d51d4c5c764db.3004b7a97cf69dda + 2d460a61a5dd0f6f.47086cc3da642fa7.130d662777beb4a9.1e61c5ec52f79c60 + 16559ec50352a3d9 + +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(reg) + before + 742c3e9e2b92eef2.c569453ccd1b0fc4.0784892e9360315b.f0177599dbe14b46 + 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd + d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c + 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac + bc3127138b19183c + after + 0000000000000000.0000000000000000.0000000000000000.2525252525252525 + 9432a2e46543b956.b819f459105730e9.9a49ac115048d4c4.f987fa170d3ce4dd + d2b3c4044ef23fb2.e22093a48a9d2e0b.5da3cfd6aea6558e.0c28728e28dc3c9c + 89fba268812abdb2.1e4a9e0958fac555.adddf0eb4808f067.04c857e949cc0fac + bc3127138b19183c +VMOVQ_XMM_to_XMM_LOW_LOW_HIGH(mem) + before + 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.e4450ababbfae0f9 + e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0 + 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9 + 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0 + 0194ddb82b49abf0 + after + 12305efa0acd1475.1755377e9a786f01.4a6592749579b0f4.2525252525252525 + e1917689e3f6bf86.d70f7fb13667914c.413cead25e27ac14.5f2619b1a20662f0 + 0420edac31a0d599.2573776df1835e3e.de9a220dce0e75e0.7acb193b9abab2f9 + 59a93d4f11d611db.5cce191e65591384.ff4cb613013cc685.918107c43ea20cc0 + 0194ddb82b49abf0 + diff --git a/none/tests/amd64/avx-vmovq.vgtest b/none/tests/amd64/avx-vmovq.vgtest new file mode 100644 index 0000000000..ba4f5caaf2 --- /dev/null +++ b/none/tests/amd64/avx-vmovq.vgtest @@ -0,0 +1,3 @@ +prog: avx-vmovq +prereq: test -x avx-vmovq && ../../../tests/x86_amd64_features amd64-avx +vgopts: -q |
From: Philippe W. <phi...@so...> - 2024-06-30 14:08:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7881706947507968772ccef67ebdc7ac7451abc9 commit 7881706947507968772ccef67ebdc7ac7451abc9 Author: Philippe Waroquiers <phi...@sk...> Date: Sun Jun 30 12:07:11 2024 +0200 Bug 489040 massif trace change to show the location increasing the stack Massif verbose output showing the code location that increases the stack. Diff: --- NEWS | 1 + include/pub_tool_debuginfo.h | 6 +++--- massif/docs/ms-manual.xml | 7 +++++++ massif/ms_main.c | 8 +++++++- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 7100b216ee..9583c26e7e 100644 --- a/NEWS +++ b/NEWS @@ -49,6 +49,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 488026 Use of `sizeof` instead of `strlen 488379 --track-fds=yes errors that cannot be suppressed with --xml-file= 488441 Add tests for --track-fds=yes --xml=yes and fd suppression tests +489040 massif trace change to show the location increasing the stack To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/include/pub_tool_debuginfo.h b/include/pub_tool_debuginfo.h index 7631ff67a6..bd03956957 100644 --- a/include/pub_tool_debuginfo.h +++ b/include/pub_tool_debuginfo.h @@ -182,13 +182,13 @@ typedef struct _InlIPCursor InlIPCursor; be done: InlIPCursor *iipc = VG_(new_IIPC)(ep, eip); do { - buf = VG_(describe_IP)(eip, iipc); + buf = VG_(describe_IP)(ep, eip, iipc); ... use buf ... } while (VG_(next_IIPC)(iipc)); VG_(delete_IIPC)(iipc); - To only describe eip, without the inlined calls at eip, give a NULL iipc: - buf = VG_(describe_IP)(eip, NULL); + To only describe eip, without the inlined calls at eip, give a NULL iipc, e.g.: + buf = VG_(describe_IP)(VG_(current_DiEpoch)(), eip, NULL); Note, that the returned string is allocated in a static buffer local to VG_(describe_IP). That buffer will be overwritten with every invocation. diff --git a/massif/docs/ms-manual.xml b/massif/docs/ms-manual.xml index 3dff259952..22941fa522 100644 --- a/massif/docs/ms-manual.xml +++ b/massif/docs/ms-manual.xml @@ -703,6 +703,13 @@ various places online. true, but doing otherwise accurately is difficult. Furthermore, starting at zero better indicates the size of the part of the main stack that a user program actually has control over.</para> + <para>If you give at least 4 <option>-v</option> verbosity arguments, + then massif produces a trace for each stack increase and decrease. + The stack increase trace contains the IP address that increased the stack. + Note that to get fully precise IP address, you must specify the options + <option>-px-default=unwindregs-at-mem-access + --px-file-backed=unwindregs-at-mem-access</option>. + </para> </listitem> </varlistentry> diff --git a/massif/ms_main.c b/massif/ms_main.c index f4df6eb16b..0aed0890d2 100644 --- a/massif/ms_main.c +++ b/massif/ms_main.c @@ -1644,7 +1644,13 @@ static void update_stack_stats(SSizeT stack_szB_delta) static INLINE void new_mem_stack_2(SizeT len, const HChar* what) { if (have_started_executing_code) { - VERB(3, "<<< new_mem_stack (%lu)\n", len); + if (UNLIKELY(VG_(clo_verbosity) > 3)) { + const ThreadId cur_tid = VG_(get_running_tid) (); + const Addr cur_IP = VG_(get_IP) (cur_tid); + VERB(3, "<<< new_mem_stack (%lu) tid %u IP %s\n", + len, cur_tid, + VG_(describe_IP)(VG_(current_DiEpoch)(), cur_IP, NULL)); + } n_stack_allocs++; update_stack_stats(len); maybe_take_snapshot(Normal, what); |
From: Paul F. <pa...@so...> - 2024-06-30 05:30:11
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b57d2a4aaf0e6a05227b8f8eb9d408c90f82c2bc commit b57d2a4aaf0e6a05227b8f8eb9d408c90f82c2bc Author: Paul Floyd <pj...@wa...> Date: Sun Jun 30 07:29:24 2024 +0200 Add track-fds-exec-children to .gitignore Diff: --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1473e9a739..6379006fe8 100644 --- a/.gitignore +++ b/.gitignore @@ -1643,6 +1643,7 @@ /none/tests/threadederrno /none/tests/timestamp /none/tests/tls +/none/tests/track-fds-exec-children /none/tests/unit_debuglog /none/tests/valgrind_cpp_test /none/tests/vgcore.* |
From: Mark W. <ma...@so...> - 2024-06-24 12:59:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef commit d6c7d47eb4c13a3d83c091d453f527a1b74cf4ef Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 24 14:56:37 2024 +0200 gdbserver_tests filters remove python rpm module load warning gdb on Fedora will warn not being able to load the rpm python module. Unable to load 'rpm' module. Please install the python3-rpm package. Filter out that message so tests don't fail. Diff: --- gdbserver_tests/filter_gdb.in | 3 +++ gdbserver_tests/filter_vgdb.in | 3 +++ 2 files changed, 6 insertions(+) diff --git a/gdbserver_tests/filter_gdb.in b/gdbserver_tests/filter_gdb.in index 0f964e223f..6eecf40502 100755 --- a/gdbserver_tests/filter_gdb.in +++ b/gdbserver_tests/filter_gdb.in @@ -55,6 +55,9 @@ s/^\[?1034hReading symbols/Reading symbols/ # Remove some Suse package manager messages /^Try: zypper install -C/d +# Remove python rpm module load warning +/^Unable to load 'rpm' module. Please install the python3-rpm package./d + # Remove vgdb message /relaying data between gdb and process/d diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index 139aea2bcc..71f1f70253 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -47,5 +47,8 @@ $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | $SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | +# Remove python rpm module load warning +$SED -e "/^Unable to load 'rpm' module. Please install the python3-rpm package./d" | + # and filter out any remaining empty lines $SED -e '/^$/d' |
From: Petar J. <pe...@so...> - 2024-06-24 11:05:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=efaa17e53a750d5f0f4c138b507b1b104729ed67 commit efaa17e53a750d5f0f4c138b507b1b104729ed67 Author: Petar Jovanovic <mip...@gm...> Date: Mon Jun 24 10:33:46 2024 +0000 mips: skip using shared syscall numbers for mips64 mips does not use shared syscall numbers, so we can not use vki-scnums-shared-linux.h. This fixes KDE #444781. Signed-off-by: Hauke Mehrtens <ha...@ha...> Signed-off-by: Aleksandar Rikalo <ar...@gm...> Diff: --- coregrind/m_syswrap/syswrap-mips64-linux.c | 1 + include/pub_tool_vkiscnums_asm.h | 1 - include/vki/vki-scnums-mips64-linux.h | 98 ++++++++++++++++++++++++++++++ 3 files changed, 99 insertions(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index 24f2bcc939..b07b7da459 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -813,6 +813,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_pwritev2, sys_pwritev2), LINX_ (__NR_syncfs, sys_syncfs), LINXY (__NR_statx, sys_statx), + GENX_ (__NR_rseq, sys_ni_syscall), LINX_ (__NR_setns, sys_setns), LINXY (__NR_io_uring_setup, sys_io_uring_setup), LINXY (__NR_io_uring_enter, sys_io_uring_enter), diff --git a/include/pub_tool_vkiscnums_asm.h b/include/pub_tool_vkiscnums_asm.h index d3d7dc19be..f97a3af3a1 100644 --- a/include/pub_tool_vkiscnums_asm.h +++ b/include/pub_tool_vkiscnums_asm.h @@ -70,7 +70,6 @@ # include "vki/vki-scnums-shared-linux.h" #elif defined(VGP_mips64_linux) -# include "vki/vki-scnums-shared-linux.h" # include "vki/vki-scnums-mips64-linux.h" #elif defined(VGP_x86_freebsd) || defined(VGP_amd64_freebsd) || defined(VGP_arm64_freebsd) diff --git a/include/vki/vki-scnums-mips64-linux.h b/include/vki/vki-scnums-mips64-linux.h index 1ae7a5dbec..c5291e31c6 100644 --- a/include/vki/vki-scnums-mips64-linux.h +++ b/include/vki/vki-scnums-mips64-linux.h @@ -362,6 +362,45 @@ #define __NR_pkey_alloc (__NR_Linux + 324) #define __NR_pkey_free (__NR_Linux + 325) #define __NR_statx (__NR_Linux + 326) +#define __NR_rseq (__NR_Linux + 327) +#define __NR_io_pgetevents (__NR_Linux + 328) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) +#define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) +#define __NR_openat2 (__NR_Linux + 437) +#define __NR_pidfd_getfd (__NR_Linux + 438) +#define __NR_faccessat2 (__NR_Linux + 439) +#define __NR_process_madvise (__NR_Linux + 440) +#define __NR_epoll_pwait2 (__NR_Linux + 441) +#define __NR_mount_setattr (__NR_Linux + 442) +#define __NR_quotactl_fd (__NR_Linux + 443) +#define __NR_landlock_create_ruleset (__NR_Linux + 444) +#define __NR_landlock_add_rule (__NR_Linux + 445) +#define __NR_landlock_restrict_self (__NR_Linux + 446) +#define __NR_process_mrelease (__NR_Linux + 448) +#define __NR_futex_waitv (__NR_Linux + 449) +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) +#define __NR_cachestat (__NR_Linux + 451) +#define __NR_fchmodat2 (__NR_Linux + 452) +#define __NR_map_shadow_stack (__NR_Linux + 453) +#define __NR_futex_wake (__NR_Linux + 454) +#define __NR_futex_wait (__NR_Linux + 455) +#define __NR_futex_requeue (__NR_Linux + 456) +#define __NR_statmount (__NR_Linux + 457) +#define __NR_listmount (__NR_Linux + 458) +#define __NR_lsm_get_self_attr (__NR_Linux + 459) +#define __NR_lsm_set_self_attr (__NR_Linux + 460) +#define __NR_lsm_list_modules (__NR_Linux + 461) #elif defined(VGABI_N32) @@ -701,6 +740,65 @@ #define __NR_pkey_alloc (__NR_Linux + 328) #define __NR_pkey_free (__NR_Linux + 329) #define __NR_statx (__NR_Linux + 330) +#define __NR_rseq (__NR_Linux + 331) +#define __NR_io_pgetevents (__NR_Linux + 332) +#define __NR_clock_gettime64 (__NR_Linux + 403) +#define __NR_clock_settime64 (__NR_Linux + 404) +#define __NR_clock_adjtime64 (__NR_Linux + 405) +#define __NR_clock_getres_time64 (__NR_Linux + 406) +#define __NR_clock_nanosleep_time64 (__NR_Linux + 407) +#define __NR_timer_gettime64 (__NR_Linux + 408) +#define __NR_timer_settime64 (__NR_Linux + 409) +#define __NR_timerfd_gettime64 (__NR_Linux + 410) +#define __NR_timerfd_settime64 (__NR_Linux + 411) +#define __NR_utimensat_time64 (__NR_Linux + 412) +#define __NR_pselect6_time64 (__NR_Linux + 413) +#define __NR_ppoll_time64 (__NR_Linux + 414) +#define __NR_io_pgetevents_time64 (__NR_Linux + 416) +#define __NR_recvmmsg_time64 (__NR_Linux + 417) +#define __NR_mq_timedsend_time64 (__NR_Linux + 418) +#define __NR_mq_timedreceive_time64 (__NR_Linux + 419) +#define __NR_semtimedop_time64 (__NR_Linux + 420) +#define __NR_rt_sigtimedwait_time64 (__NR_Linux + 421) +#define __NR_futex_time64 (__NR_Linux + 422) +#define __NR_sched_rr_get_interval_time64 (__NR_Linux + 423) +#define __NR_pidfd_send_signal (__NR_Linux + 424) +#define __NR_io_uring_setup (__NR_Linux + 425) +#define __NR_io_uring_enter (__NR_Linux + 426) +#define __NR_io_uring_register (__NR_Linux + 427) +#define __NR_open_tree (__NR_Linux + 428) +#define __NR_move_mount (__NR_Linux + 429) +#define __NR_fsopen (__NR_Linux + 430) +#define __NR_fsconfig (__NR_Linux + 431) +#define __NR_fsmount (__NR_Linux + 432) +#define __NR_fspick (__NR_Linux + 433) +#define __NR_pidfd_open (__NR_Linux + 434) +#define __NR_clone3 (__NR_Linux + 435) +#define __NR_close_range (__NR_Linux + 436) +#define __NR_openat2 (__NR_Linux + 437) +#define __NR_pidfd_getfd (__NR_Linux + 438) +#define __NR_faccessat2 (__NR_Linux + 439) +#define __NR_process_madvise (__NR_Linux + 440) +#define __NR_epoll_pwait2 (__NR_Linux + 441) +#define __NR_mount_setattr (__NR_Linux + 442) +#define __NR_quotactl_fd (__NR_Linux + 443) +#define __NR_landlock_create_ruleset (__NR_Linux + 444) +#define __NR_landlock_add_rule (__NR_Linux + 445) +#define __NR_landlock_restrict_self (__NR_Linux + 446) +#define __NR_process_mrelease (__NR_Linux + 448) +#define __NR_futex_waitv (__NR_Linux + 449) +#define __NR_set_mempolicy_home_node (__NR_Linux + 450) +#define __NR_cachestat (__NR_Linux + 451) +#define __NR_fchmodat2 (__NR_Linux + 452) +#define __NR_map_shadow_stack (__NR_Linux + 453) +#define __NR_futex_wake (__NR_Linux + 454) +#define __NR_futex_wait (__NR_Linux + 455) +#define __NR_futex_requeue (__NR_Linux + 456) +#define __NR_statmount (__NR_Linux + 457) +#define __NR_listmount (__NR_Linux + 458) +#define __NR_lsm_get_self_attr (__NR_Linux + 459) +#define __NR_lsm_set_self_attr (__NR_Linux + 460) +#define __NR_lsm_list_modules (__NR_Linux + 461) #else #error unknown mips64 abi |
From: Petar J. <pe...@so...> - 2024-06-24 11:05:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7e0efb62fc0bc50dfd0446e22ffc41963732fc27 commit 7e0efb62fc0bc50dfd0446e22ffc41963732fc27 Author: Petar Jovanovic <mip...@gm...> Date: Mon Jun 24 11:03:12 2024 +0000 update NEWS with fix for #444781 The KDE issue #444781 has been fixed in commit efaa17e53a750d5f0f4c138b507b1b104729ed67 mips: skip using shared syscall numbers for mips64 commit 54d6ad3348fb50f5b972fe9c05d0d8757bfe73ba mips: skip using shared syscall numbers for mips32 Diff: --- NEWS | 1 + 1 file changed, 1 insertion(+) diff --git a/NEWS b/NEWS index e60f274f41..7100b216ee 100644 --- a/NEWS +++ b/NEWS @@ -36,6 +36,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. instruction 0xD5380001 (MRS rT, midr_el1) 392146 aarch64: unhandled instruction 0xD5380001 (MRS rT, midr_el1) 412377 SIGILL on cache flushes on arm64 +444781 MIPS: wrong syscall numbers used 447989 Support Armv8.2 SHA-512 instructions 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors |
From: Mark W. <ma...@kl...> - 2024-06-23 20:27:45
|
On Mon, Jun 10, 2024 at 05:04:00PM +0200, Mark Wielaard wrote: > Hi developers and packagers, > > I updated the VALGRIND_3_23_BRANCH with some patches to unbreak mips, > fix memccpy false positives, inotify_init syscall handling, add aarch64 > frinta and frinta vector instructions and clean up the s390x extension > mechanism and some testcases. > > I don't intent to do a full 3.23.1 release, but I hope distros will > pick up these fixes. I have also added them to the Fedora package. I added 4 more commits to the 3.23 branch to fix an odd x86_64 prefix issue, remove internal valgrind file descriptor leaking that could result in false positives with --track-fds=yes and deny programs to call fcntl on valgrind internal fds. commit e62c7b4f9ee0a8c20c7211a92ad512f925e9515c Author: Paul Floyd <pj...@wa...> Date: Sun Jun 16 09:25:51 2024 +0200 Bug 487439 - SIGILL in JDK11, JDK17 (cherry picked from commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0) commit 14cefe7c645a3148165f4b2fa6095d9446e378c7 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 16 21:23:08 2024 +0200 Don't leave fds created with --log-file, --xml-file or --log-socket open prepare_sink_fd and prepare_sink_socket will create a new file descriptor for the output sink. finalize_sink_fd then copies the fd to the safe range, so it doesn't conflict with any application fds. If we created the original fd ourselves, it was a VgLogTo_File or VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it. Also close socket when connecting fails in VG_(connect_via_socket). Add a testcase for --log-file and --xml-file which prints output to /dev/stderr https://bugs.kde.org/show_bug.cgi?id=202770 https://bugs.kde.org/show_bug.cgi?id=311655 https://bugs.kde.org/show_bug.cgi?id=488379 Co-authored-by: Alexandra Hájková <aha...@re... (cherry picked from commit fbd7596f8342f0b0fbbe088d960da839a8bdb839) commit 0ced5269236c527d2e288b773e3684b6b1673ec2 Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 17 00:27:12 2024 +0200 Close both internal pipe fds after VG_(fork) in parent and child An VG_fork() creates a pipe between parent and child to syncronize the two processes. The parent wants to register the child pid before the child can run. This is done in register_sigchld_ignore. Make sure both the parent and the child close both the read and write file descriptors so none leak. https://bugs.kde.org/show_bug.cgi?id=479661 (cherry picked from commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160) commit 2272233d23a5431e14b3c9385d2b4b66e0e8f0fd Author: Alexandra Hájková <aha...@re...> Date: Thu Jun 20 07:45:56 2024 -0400 Don't allow programs calling fnctl on valgrind's own file descriptors Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64 and block syscalls with EBADF when the file descriptor isn't allowed to be used by the program. https://bugs.kde.org/show_bug.cgi?id=337388 (cherry picked from commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5) |
From: Mark W. <ma...@so...> - 2024-06-23 20:08:08
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2272233d23a5431e14b3c9385d2b4b66e0e8f0fd commit 2272233d23a5431e14b3c9385d2b4b66e0e8f0fd Author: Alexandra Hájková <aha...@re...> Date: Thu Jun 20 07:45:56 2024 -0400 Don't allow programs calling fnctl on valgrind's own file descriptors Add a call to ML_(fd_allowed) in the PRE handler of fcntl and fcntl64 and block syscalls with EBADF when the file descriptor isn't allowed to be used by the program. https://bugs.kde.org/show_bug.cgi?id=337388 (cherry picked from commit 4b83e3d47daaf5eff2ca96867a8c790e13830eb5) Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/NEWS b/NEWS index 94789a04ba..523380a98f 100644 --- a/NEWS +++ b/NEWS @@ -7,6 +7,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak +337388 fcntl works on Valgrind's own file descriptors 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 45413fdd9e..9f3c51c179 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -6978,6 +6978,10 @@ PRE(sys_fcntl) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl) @@ -7088,6 +7092,10 @@ PRE(sys_fcntl64) if (ARG2 == VKI_F_SETLKW) # endif *flags |= SfMayBlock; + + if (!ML_(fd_allowed)(ARG1, "fcntl64", tid, False)) { + SET_STATUS_Failure (VKI_EBADF); + } } POST(sys_fcntl64) |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=14cefe7c645a3148165f4b2fa6095d9446e378c7 commit 14cefe7c645a3148165f4b2fa6095d9446e378c7 Author: Mark Wielaard <ma...@kl...> Date: Sun Jun 16 21:23:08 2024 +0200 Don't leave fds created with --log-file, --xml-file or --log-socket open prepare_sink_fd and prepare_sink_socket will create a new file descriptor for the output sink. finalize_sink_fd then copies the fd to the safe range, so it doesn't conflict with any application fds. If we created the original fd ourselves, it was a VgLogTo_File or VgLogTo_Socket, not VgLogTo_Fd, finalize_sink_fd should close it. Also close socket when connecting fails in VG_(connect_via_socket). Add a testcase for --log-file and --xml-file which prints output to /dev/stderr https://bugs.kde.org/show_bug.cgi?id=202770 https://bugs.kde.org/show_bug.cgi?id=311655 https://bugs.kde.org/show_bug.cgi?id=488379 Co-authored-by: Alexandra Hájková <aha...@re... (cherry picked from commit fbd7596f8342f0b0fbbe088d960da839a8bdb839) Diff: --- NEWS | 3 +++ coregrind/m_libcfile.c | 1 + coregrind/m_libcprint.c | 6 +++++ none/tests/Makefile.am | 5 +++- none/tests/filter_xml | 25 ++++++++++++++++++++ none/tests/log-track-fds.stderr.exp | 0 none/tests/log-track-fds.vgtest | 4 ++++ none/tests/xml-track-fds.stderr.exp | 47 +++++++++++++++++++++++++++++++++++++ none/tests/xml-track-fds.vgtest | 5 ++++ 9 files changed, 95 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index fbe0f012ef..10b5ae3195 100644 --- a/NEWS +++ b/NEWS @@ -5,11 +5,14 @@ Branch 3.23 The following bugs have been fixed or resolved on this branch. +202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes +311655 --log-file=FILE leads to apparent fd leak 453044 gbserver_tests failures in aarch64 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table 487439 SIGILL in JDK11, JDK17 +488379 --track-fds=yes errors that cannot be suppressed with --xml-file= n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/coregrind/m_libcfile.c b/coregrind/m_libcfile.c index 6098bc5813..9635b80a68 100644 --- a/coregrind/m_libcfile.c +++ b/coregrind/m_libcfile.c @@ -1333,6 +1333,7 @@ Int VG_(connect_via_socket)( const HChar* str ) res = my_connect(sd, &servAddr, sizeof(servAddr)); if (res < 0) { /* connection failed */ + VG_(close)(sd); return -2; } diff --git a/coregrind/m_libcprint.c b/coregrind/m_libcprint.c index c802f81403..593889da9d 100644 --- a/coregrind/m_libcprint.c +++ b/coregrind/m_libcprint.c @@ -425,6 +425,12 @@ static void finalize_sink_fd(OutputSink *sink, Int new_fd, Bool is_xml) } else { VG_(fcntl)(safe_fd, VKI_F_SETFD, VKI_FD_CLOEXEC); sink->fd = safe_fd; + /* If we created the new_fd (VgLogTo_File or VgLogTo_Socket), then we + don't need the original file descriptor open anymore. We only need + to keep it open if it was an existing fd given by the user (or + stderr). */ + if (sink->type != VgLogTo_Fd) + VG_(close)(new_fd); } } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 185993f204..532cc7632a 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -86,6 +86,7 @@ dist_noinst_SCRIPTS = \ filter_none_discards \ filter_stderr \ filter_timestamp \ + filter_xml \ allexec_prepare_prereq noinst_HEADERS = fdleak.h @@ -229,7 +230,9 @@ EXTRA_DIST = \ sigprocmask.stderr.exp sigprocmask.vgtest \ socket_close.stderr.exp socket_close.vgtest \ file_dclose.stderr.exp file_dclose.vgtest \ - double_close_range.stderr.exp double_close_range.vgtest + double_close_range.stderr.exp double_close_range.vgtest \ + log-track-fds.stderr.exp log-track-fds.vgtest \ + xml-track-fds.stderr.exp xml-track-fds.vgtest check_PROGRAMS = \ diff --git a/none/tests/filter_xml b/none/tests/filter_xml new file mode 100755 index 0000000000..d1ef570a05 --- /dev/null +++ b/none/tests/filter_xml @@ -0,0 +1,25 @@ +#! /bin/sh + +dir=`dirname $0` + +# FreeBSD adds this one extra line +# but after filter_xml_frames it will just be <path>...<\/path> +# which matches other lines, so get rid of it while we can +# uniquely match it +sed "/<path>internet<\/path>/d" | + +$dir/../../tests/filter_xml_frames | +perl -p -e "s/<time>.*<\/time>/<time>...<\/time>/s" | +perl -p -e "s/<what>.*<\/what>/<what>...<\/what>/s" | +perl -p -e "s/<path>.*<\/path>/<path>...<\/path>/s" | +perl -p -e "s/<line>Copyright.*<\/line>/<line>Copyright...<\/line>/s" | +perl -p -e "s/<line>Using Valgrind.*<\/line>/<line>Using Valgrind...<\/line>/s" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<tid>[0-9]*<\/tid>/<tid>...<\/tid>/" | +sed "s/<pid>[0-9]*<\/pid>/<pid>...<\/pid>/" | +sed "s/<obj>.*<\/obj>/<obj>...<\/obj>/" | +sed "s/<exe>.*<\/exe>/<exe>...<\/exe>/" | +sed "s/<dir>.*<\/dir>/<dir>...<\/dir>/" | +sed "s/<ppid>[0-9]*<\/ppid>/<ppid>...<\/ppid>/" | +sed "s/<unique>0x[0-9a-fA-F]*<\/unique>/<unique>0x........<\/unique>/" | +sed "s/<ip>0x[0-9a-fA-F]*<\/ip>/<ip>0x........<\/ip>/" diff --git a/none/tests/log-track-fds.stderr.exp b/none/tests/log-track-fds.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/log-track-fds.vgtest b/none/tests/log-track-fds.vgtest new file mode 100644 index 0000000000..dfebb5bf3e --- /dev/null +++ b/none/tests/log-track-fds.vgtest @@ -0,0 +1,4 @@ +# Simple test to make sure track-fds doesn't error on (internal) log-file +# See https://bugs.kde.org/show_bug.cgi?id=311655 +prog: ../../tests/true +vgopts: -q --track-fds=yes --log-file=/dev/stderr diff --git a/none/tests/xml-track-fds.stderr.exp b/none/tests/xml-track-fds.stderr.exp new file mode 100644 index 0000000000..b06da9d722 --- /dev/null +++ b/none/tests/xml-track-fds.stderr.exp @@ -0,0 +1,47 @@ +<?xml version="1.0"?> + +<valgrindoutput> + +<protocolversion>5</protocolversion> +<protocoltool>none</protocoltool> + +<preamble> + <line>Nulgrind, the minimal Valgrind tool</line> + <line>Copyright...</line> + <line>Using Valgrind...</line> + <line>Command: ./../../tests/true</line> +</preamble> + +<pid>...</pid> +<ppid>...</ppid> +<tool>none</tool> + +<args> + <vargv> + <exe>...</exe> + <arg>--command-line-only=yes</arg> + <arg>--memcheck:leak-check=no</arg> + <arg>--tool=none</arg> + <arg>--track-fds=yes</arg> + <arg>--xml=yes</arg> + <arg>--xml-file=/dev/stderr</arg> + </vargv> + <argv> + <exe>...</exe> + </argv> +</args> + +<status> + <state>RUNNING</state> + <time>...</time> +</status> + + +<status> + <state>FINISHED</state> + <time>...</time> +</status> + + +</valgrindoutput> + diff --git a/none/tests/xml-track-fds.vgtest b/none/tests/xml-track-fds.vgtest new file mode 100644 index 0000000000..50f1a55a82 --- /dev/null +++ b/none/tests/xml-track-fds.vgtest @@ -0,0 +1,5 @@ +# Simple test to make sure track-fds doesn't error on (internal) xml-file +# See https://bugs.kde.org/show_bug.cgi?id=488379 +prog: ../../tests/true +vgopts: --track-fds=yes --xml=yes --xml-file=/dev/stderr +stderr_filter: filter_xml |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:58
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0ced5269236c527d2e288b773e3684b6b1673ec2 commit 0ced5269236c527d2e288b773e3684b6b1673ec2 Author: Mark Wielaard <ma...@kl...> Date: Mon Jun 17 00:27:12 2024 +0200 Close both internal pipe fds after VG_(fork) in parent and child An VG_fork() creates a pipe between parent and child to syncronize the two processes. The parent wants to register the child pid before the child can run. This is done in register_sigchld_ignore. Make sure both the parent and the child close both the read and write file descriptors so none leak. https://bugs.kde.org/show_bug.cgi?id=479661 (cherry picked from commit 1263471efdf8405cb0f1a767c6af73bf2eaf7160) Diff: --- NEWS | 1 + coregrind/m_libcproc.c | 7 +++++++ none/tests/Makefile.am | 3 +++ none/tests/track-fds-exec-children.c | 13 +++++++++++++ none/tests/track-fds-exec-children.stderr.exp | 0 none/tests/track-fds-exec-children.vgtest | 3 +++ 6 files changed, 27 insertions(+) diff --git a/NEWS b/NEWS index 10b5ae3195..94789a04ba 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,7 @@ The following bugs have been fixed or resolved on this branch. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 311655 --log-file=FILE leads to apparent fd leak 453044 gbserver_tests failures in aarch64 +479661 Valgrind leaks file descriptors 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index 11dabe768f..8422e9d118 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -905,6 +905,8 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) return; if (pid == 0) { + /* We are the child, close writing fd that we don't use. */ + VG_(close)(fds[1]); /* Before proceeding, ensure parent has recorded child PID in map of SIGCHLD to ignore */ while (child_wait == 1) @@ -916,6 +918,7 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) } } + /* Now close reading fd. */ VG_(close)(fds[0]); return; } @@ -926,11 +929,15 @@ static void register_sigchld_ignore ( Int pid, Int fds[2]) ht_sigchld_ignore = VG_(HT_construct)("ht.sigchld.ignore"); VG_(HT_add_node)(ht_sigchld_ignore, n); + /* We are the parent process, close read fd that we don't use. */ + VG_(close)(fds[0]); + child_wait = 0; if (VG_(write)(fds[1], &child_wait, sizeof(Int)) <= 0) VG_(message)(Vg_DebugMsg, "warning: Unable to record PID of internal process (write)\n"); + /* Now close writing fd. */ VG_(close)(fds[1]); } diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 532cc7632a..1751ad3fa2 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -223,6 +223,7 @@ EXTRA_DIST = \ threadederrno.vgtest \ timestamp.stderr.exp timestamp.vgtest \ tls.vgtest tls.stderr.exp tls.stdout.exp \ + track-fds-exec-children.vgtest track-fds-exec-children.stderr.exp \ unit_debuglog.stderr.exp unit_debuglog.vgtest \ vgprintf.stderr.exp vgprintf.vgtest \ vgprintf_nvalgrind.stderr.exp vgprintf_nvalgrind.vgtest \ @@ -276,6 +277,7 @@ check_PROGRAMS = \ tls \ tls.so \ tls2.so \ + track-fds-exec-children \ unit_debuglog \ valgrind_cpp_test \ vgprintf \ @@ -414,6 +416,7 @@ if VGCONF_OS_IS_DARWIN else tls2_so_LDFLAGS = -shared endif +track_fds_exec_children_SOURCES = track-fds-exec-children.c vgprintf_nvalgrind_SOURCES = vgprintf.c vgprintf_nvalgrind_CFLAGS = ${AM_CFLAGS} -DNVALGRIND diff --git a/none/tests/track-fds-exec-children.c b/none/tests/track-fds-exec-children.c new file mode 100644 index 0000000000..7209ee73d5 --- /dev/null +++ b/none/tests/track-fds-exec-children.c @@ -0,0 +1,13 @@ +#include <unistd.h> +#include <sys/wait.h> + +int main() +{ + pid_t pid = fork (); + if (pid == 0) + execlp("true", "true", NULL); + + // Wait till true succeeds + wait (NULL); + return 0; +} diff --git a/none/tests/track-fds-exec-children.stderr.exp b/none/tests/track-fds-exec-children.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/track-fds-exec-children.vgtest b/none/tests/track-fds-exec-children.vgtest new file mode 100644 index 0000000000..aa926a6290 --- /dev/null +++ b/none/tests/track-fds-exec-children.vgtest @@ -0,0 +1,3 @@ +env: DEBUGINFOD_URLS=file:/dev/null +prog: track-fds-exec-children +vgopts: -q --track-fds=yes --trace-children=yes |
From: Mark W. <ma...@so...> - 2024-06-23 20:07:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e62c7b4f9ee0a8c20c7211a92ad512f925e9515c commit e62c7b4f9ee0a8c20c7211a92ad512f925e9515c Author: Paul Floyd <pj...@wa...> Date: Sun Jun 16 09:25:51 2024 +0200 Bug 487439 - SIGILL in JDK11, JDK17 (cherry picked from commit c19d19d34a6dadaf4a9d590f516f813e9cbacdd0) Diff: --- .gitignore | 1 + NEWS | 1 + VEX/priv/guest_amd64_toIR.c | 2 +- none/tests/amd64/Makefile.am | 3 ++ none/tests/amd64/bug487439.cpp | 83 +++++++++++++++++++++++++++++++++++ none/tests/amd64/bug487439.stderr.exp | 0 none/tests/amd64/bug487439.stdout.exp | 1 + none/tests/amd64/bug487439.vgtest | 2 + 8 files changed, 92 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index a8b7ce4c7d..e13a9fa935 100644 --- a/.gitignore +++ b/.gitignore @@ -1670,6 +1670,7 @@ /none/tests/amd64/bug137714-amd64 /none/tests/amd64/bug156404-amd64 /none/tests/amd64/bug485148 +/none/tests/amd64/bug487439 /none/tests/amd64/cet_nops /none/tests/amd64/clc /none/tests/amd64/cmpxchg diff --git a/NEWS b/NEWS index c2ad6a207d..fbe0f012ef 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,7 @@ The following bugs have been fixed or resolved on this branch. 486180 [MIPS] 'VexGuestArchState' has no member named 'guest_IP_AT_SYSCALL' 486293 memccpy false positives 486569 linux inotify_init syscall wrapper missing POST entry in syscall_table +487439 SIGILL in JDK11, JDK17 n-i-bz aarch64 frinta and frinta vector instructions To see details of a given bug, visit diff --git a/VEX/priv/guest_amd64_toIR.c b/VEX/priv/guest_amd64_toIR.c index f0b1c55162..28c37f0922 100644 --- a/VEX/priv/guest_amd64_toIR.c +++ b/VEX/priv/guest_amd64_toIR.c @@ -14138,7 +14138,7 @@ Long dis_ESC_0F__SSE2 ( Bool* decode_OK, goto decode_success; } /* 66 0F 73 /6 ib = PSLLQ by immediate */ - if (have66noF2noF3(pfx) && sz == 2 + if (have66noF2noF3(pfx) && (sz == 2 || /* ignore redundant REX.W */ sz == 8) && epartIsReg(getUChar(delta)) && gregLO3ofRM(getUChar(delta)) == 6) { delta = dis_SSE_shiftE_imm( pfx, delta, "psllq", Iop_ShlN64x2 ); diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index dc04980182..83029c1559 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -44,6 +44,7 @@ EXTRA_DIST = \ bug156404-amd64.vgtest bug156404-amd64.stdout.exp \ bug156404-amd64.stderr.exp \ bug485148.vgtest bug485148.stdout.exp bug485148.stderr.exp \ + bug487439.vgtest bug487439.stdout.exp bug487439.stderr.exp \ cet_nops.vgtest cet_nops.stdout.exp cet_nops.stderr.exp \ clc.vgtest clc.stdout.exp clc.stderr.exp \ crc32.vgtest crc32.stdout.exp crc32.stderr.exp \ @@ -107,6 +108,7 @@ check_PROGRAMS = \ amd64locked \ bt_flags \ bug127521-64 bug132813-amd64 bug132918 bug137714-amd64 \ + bug487439 \ cet_nops \ clc \ cmpxchg \ @@ -204,6 +206,7 @@ amd64locked_CFLAGS = $(AM_CFLAGS) -O bug132918_LDADD = -lm bug485148_CXXFLAGS = ${AM_CXXFLAGS} -mfma bug485148_SOURCES = bug485148.cpp +bug487439_SOURCES = bug487439.cpp cmpxchg_CFLAGS = $(AM_CFLAGS) @FLAG_NO_PIE@ fb_test_amd64_CFLAGS = $(AM_CFLAGS) -O -fno-strict-aliasing fb_test_amd64_LDADD = -lm diff --git a/none/tests/amd64/bug487439.cpp b/none/tests/amd64/bug487439.cpp new file mode 100644 index 0000000000..f86bb65ce9 --- /dev/null +++ b/none/tests/amd64/bug487439.cpp @@ -0,0 +1,83 @@ +// This is more or less a copy/paste from the generated insn_sse2.c +// I didn't want to mess with the perl generator because +// GCC and clang don't agree on the asm syntax +// Using the rex prefix looks like a bug or misfeature in OpenJDK +// so I'm assuming that this is a one-off and not a general issue + +#include <iostream> +#include <csetjmp> +#include <csignal> + +union reg128_t { + char sb[16]; + unsigned char ub[16]; + short sw[8]; + unsigned short uw[8]; + int sd[4]; + unsigned int ud[4]; + long long int sq[2]; + unsigned long long int uq[2]; + float ps[4]; + double pd[2]; +} __attribute__ ((aligned (16))); + +static sigjmp_buf catchpoint; + +static void handle_sigill(int signum) +{ + siglongjmp(catchpoint, 1); +} + +/* with redundant rex.W */ +static void psllq_4(void) +{ + reg128_t arg1 = { .uq = { 0x0123456789abcdefULL, 0x0123456789abcdefULL } }; + reg128_t result0; + char state[108]; + + if (sigsetjmp(catchpoint, 1) == 0) + { + asm( + "ffree %%st(7)\n" + "ffree %%st(6)\n" + "ffree %%st(5)\n" + "ffree %%st(4)\n" + "movlps %2, %%xmm1\n" + "movhps %3, %%xmm1\n" + // only GCC + //".rex.W psllq $12, %%xmm1\n" + // only clang + //"data16 rex64 psllq $12, %mm1\n" + ".byte 0x66,0x48,0x0f,0x73,0xf1,0x0c\n" + "movlps %%xmm1, %0\n" + "movhps %%xmm1, %1\n" + "cld\n" + : "=m" (result0.uq[0]), "=m" (result0.uq[1]) + : "m" (arg1.uq[0]), "m" (arg1.uq[1]), "m" (state[0]) + : "xmm1" + ); + + if (result0.uq[0] == 0x3456789abcdef000ULL && result0.uq[1] == 0x3456789abcdef000ULL ) + { + std::cout << "psllq_4 ... ok\n"; + } + else + { + std::cout << "psllq_4 ... not ok\n"; + std::cout << " result0.uq[0] = " << result0.uq[0] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + std::cout << " result0.uq[1] = " << result0.uq[1] << " (expected " << 0x3456789abcdef000ULL << ")\n"; + } + } + else + { + std::cout << "psllq_4 ... failed\n"; + } + + return; +} + +int main() +{ + signal(SIGILL, handle_sigill); + psllq_4(); +} diff --git a/none/tests/amd64/bug487439.stderr.exp b/none/tests/amd64/bug487439.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/amd64/bug487439.stdout.exp b/none/tests/amd64/bug487439.stdout.exp new file mode 100644 index 0000000000..065b518a27 --- /dev/null +++ b/none/tests/amd64/bug487439.stdout.exp @@ -0,0 +1 @@ +psllq_4 ... ok diff --git a/none/tests/amd64/bug487439.vgtest b/none/tests/amd64/bug487439.vgtest new file mode 100644 index 0000000000..3faa1ed6b0 --- /dev/null +++ b/none/tests/amd64/bug487439.vgtest @@ -0,0 +1,2 @@ +prog: bug487439 +vgopts: -q |