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
(45) |
Sep
|
Oct
|
Nov
|
Dec
|
From: Andreas A. <ar...@so...> - 2024-11-08 15:50:23
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=1cc58e418952fa75d902bf0bc02efd410aaf58a4 commit 1cc58e418952fa75d902bf0bc02efd410aaf58a4 Author: Andreas Arnez <ar...@li...> Date: Fri Nov 8 14:52:11 2024 +0100 s390x regtest: Add missing register clobber in misc3.c Depending on compiler options, the translation of test_mvcrl() in `misc3.c' can misbehave because the inline assembly writes to r0 and doesn't declare that. Add a register clobber to fix this. Also, tell the compiler the actual length of `from' and `to' instead of the decremented value. Diff: --- none/tests/s390x/misc3.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/none/tests/s390x/misc3.c b/none/tests/s390x/misc3.c index eeeea1163c..c5df05ea50 100644 --- a/none/tests/s390x/misc3.c +++ b/none/tests/s390x/misc3.c @@ -144,13 +144,12 @@ static void test_all_select() static void test_mvcrl(char *to, char *from, size_t len) { - len -= 1; __asm__("lgr 0,%[len]\n\t" ".insn sse,0xe50a00000000,%[to],%[from]\n\t" : [to] "+Q" (*(char (*)[len]) to) : [from] "Q" (*(char (*)[len]) from), - [len] "d" (len) - : ); + [len] "d" (len - 1) + : "0"); } static void test_all_mvcrl() |
From: Florian K. <fl...@ei...> - 2024-11-07 11:02:48
|
Greetings, is there a way to access the svn repository before it was converted to git ? I'd be interested in a few branches I was working on at the time but did not finish the work. Those branches did not make it into git. Thanks Florian |
From: Paul F. <pa...@so...> - 2024-11-04 12:15:12
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9a439e5cca9c32964be90140261c5ed87196927e commit 9a439e5cca9c32964be90140261c5ed87196927e Author: Paul Floyd <pj...@wa...> Date: Mon Nov 4 13:13:21 2024 +0100 Compiler warning: unused label on non-FreeBSD platforms Used by a goto to jump over the POST mutex lock userreq, but only on FreeBSD. Diff: --- helgrind/hg_intercepts.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 3c6b127ac9..43afd89f47 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -1003,7 +1003,9 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_POST, pthread_mutex_t *, mutex, long, (ret == 0) ? True : False); +#if defined(VGO_freebsd) HG_MUTEX_LOCK_OUT: +#endif if (ret != 0) { DO_PthAPIerror( "pthread_mutex_lock", ret ); |
From: Paul F. <pa...@so...> - 2024-11-04 07:07:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=c3d1c683a9106cf30d4ae1052f97b0dce61d282e commit c3d1c683a9106cf30d4ae1052f97b0dce61d282e Author: Paul Floyd <pj...@wa...> Date: Mon Nov 4 08:06:17 2024 +0100 Helgrind regtest: fix wrong updates to tc04_free_lock expecteds Diff: --- helgrind/tests/tc04_free_lock.stderr.exp | 3 --- helgrind/tests/tc04_free_lock.stderr.exp-freebsd | 14 +++++++++++++- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/helgrind/tests/tc04_free_lock.stderr.exp b/helgrind/tests/tc04_free_lock.stderr.exp index 57cbc8eeca..772531160b 100644 --- a/helgrind/tests/tc04_free_lock.stderr.exp +++ b/helgrind/tests/tc04_free_lock.stderr.exp @@ -7,9 +7,6 @@ Thread #x is the program's root thread Thread #x: Exiting thread still holds 2 locks ... - by 0x........: exit_WRK (hg_intercepts.c:...) - by 0x........: exit (hg_intercepts.c:...) - ... ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/tc04_free_lock.stderr.exp-freebsd b/helgrind/tests/tc04_free_lock.stderr.exp-freebsd index d18786f806..57cbc8eeca 100644 --- a/helgrind/tests/tc04_free_lock.stderr.exp-freebsd +++ b/helgrind/tests/tc04_free_lock.stderr.exp-freebsd @@ -1,3 +1,15 @@ +---Thread-Announcement------------------------------------------ -ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) +Thread #x is the program's root thread + +---------------------------------------------------------------- + +Thread #x: Exiting thread still holds 2 locks + ... + by 0x........: exit_WRK (hg_intercepts.c:...) + by 0x........: exit (hg_intercepts.c:...) + ... + + +ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) |
From: Paul F. <pa...@so...> - 2024-11-03 19:45:34
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a2ef9690458cf472cb8a4da3793657b2c5a8cda6 commit a2ef9690458cf472cb8a4da3793657b2c5a8cda6 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 20:42:43 2024 +0100 Bug 494327 - Crash when running Helgrind built with #define TRACE_PTH_FNS 1 Use write() rather than 'fprintf()' for the TRACE_PTH_FNS blocks for pthread_mutex_lock and pthread_mutex_lock. Mixing FILE and fd isn't great, but this is to stderr which gets flushed on every line, and it is only for developer builds that modify that TRACE_PTH_FNS macro. Diff: --- NEWS | 1 + helgrind/hg_intercepts.c | 20 ++++++++++++++++---- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index b0c0b80cfa..eb1370da03 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +494327 Crash when running Helgrind built with #define TRACE_PTH_FNS 1 494337 All threaded applications cause still holding lock errors 495488 Add FreeBSD getrlimitusage syscall wrapper diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index ba16e33f9b..3c6b127ac9 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -55,6 +55,8 @@ #include "pub_tool_clreq.h" #include "helgrind.h" #include "config.h" +#include <string.h> +#include <unistd.h> #if defined(VGO_solaris) @@ -974,7 +976,10 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) OrigFn fn; VALGRIND_GET_ORIG_FN(fn); if (TRACE_PTH_FNS) { - fprintf(stderr, "<< pthread_mxlock %p", mutex); fflush(stderr); + char buf[30]; + snprintf(buf, 30, "<< pthread_mxlock %p", mutex); + write(STDERR_FILENO, buf, strlen(buf)); + fsync(STDERR_FILENO); } #if defined(VGO_freebsd) @@ -1005,7 +1010,9 @@ HG_MUTEX_LOCK_OUT: } if (TRACE_PTH_FNS) { - fprintf(stderr, " :: mxlock -> %d >>\n", ret); + char buf[30]; + snprintf(buf, 30, " :: mxlock -> %d >>\n", ret); + write(STDERR_FILENO, buf, strlen(buf)); } return ret; } @@ -1231,7 +1238,10 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) VALGRIND_GET_ORIG_FN(fn); if (TRACE_PTH_FNS) { - fprintf(stderr, "<< pthread_mxunlk %p", mutex); fflush(stderr); + char buf[30]; + snprintf(buf, 30, "<< pthread_mxunlk %p", mutex); + write(STDERR_FILENO, buf, strlen(buf)); + fsync(STDERR_FILENO); } DO_CREQ_v_W(_VG_USERREQ__HG_PTHREAD_MUTEX_UNLOCK_PRE, @@ -1247,7 +1257,9 @@ static int mutex_unlock_WRK(pthread_mutex_t *mutex) } if (TRACE_PTH_FNS) { - fprintf(stderr, " mxunlk -> %d >>\n", ret); + char buf[30]; + snprintf(buf, 30, " :: mxunlk -> %d >>\n", ret); + write(STDERR_FILENO, buf, strlen(buf)); } return ret; } |
From: Paul F. <pa...@so...> - 2024-11-03 19:02:13
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4fa368ebb129cd3fbb0406d16a4d4f3d6ffc1fca commit 4fa368ebb129cd3fbb0406d16a4d4f3d6ffc1fca Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 20:00:33 2024 +0100 Helgrind FreeBSD: make previous hack conditonal on version Don't want to ignore any pthread_mutex_lock calls on FreeBSD 14.1 and earlier. Diff: --- helgrind/hg_intercepts.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 2e63dad87a..ba16e33f9b 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -113,6 +113,8 @@ #define LIBC_FUNC(ret_ty, f, args...) \ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args); \ ret_ty I_WRAP_SONAME_FNNAME_ZZ(VG_Z_LIBC_SONAME,f)(args) + +#include <osreldate.h> #endif // Do a client request. These are macros rather than a functions so @@ -944,7 +946,9 @@ static int exit_WRK(int status) OrigFn fn; VALGRIND_GET_ORIG_FN(fn); +#if (__FreeBSD_version >= 1401500) hg_in_exit = 1; +#endif CALL_FN_W_W(ret, fn, status); |
From: Paul F. <pa...@so...> - 2024-11-03 18:49:40
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5c47ad94a0485cccd2a41506dd7e83f58b4569c3 commit 5c47ad94a0485cccd2a41506dd7e83f58b4569c3 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 19:47:12 2024 +0100 Bug 494337 - All threaded applications cause still holding lock errors Don't count the first call to pthread_mutex_lock() from exit(). Needed to update a couple of expecteds as exit() is now wrapped so it turns up in the callstacks. This is only for FreeBSD. Diff: --- NEWS | 1 + helgrind/hg_intercepts.c | 52 ++++++++ helgrind/hg_main.c | 13 +- helgrind/tests/Makefile.am | 3 +- helgrind/tests/tc04_free_lock.stderr.exp | 3 + ...freebsd15 => tc04_free_lock.stderr.exp-freebsd} | 0 helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd | 3 + .../tests/tc09_bad_unlock.stderr.exp-freebsd15 | 145 --------------------- 8 files changed, 61 insertions(+), 159 deletions(-) diff --git a/NEWS b/NEWS index 9724705090..b0c0b80cfa 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +494337 All threaded applications cause still holding lock errors 495488 Add FreeBSD getrlimitusage syscall wrapper To see details of a given bug, visit diff --git a/helgrind/hg_intercepts.c b/helgrind/hg_intercepts.c index 0c27b0a662..2e63dad87a 100644 --- a/helgrind/hg_intercepts.c +++ b/helgrind/hg_intercepts.c @@ -915,6 +915,48 @@ static int mutex_destroy_WRK(pthread_mutex_t *mutex) # error "Unsupported OS" #endif +#if defined(VGO_freebsd) + +/* + * Bugzilla 494337 + * + * Hacks'R'Us + * FreeBSD 15 (backported to 14.2) add a mutex lock to + * exit to ensure that it is thread-safe. But this lock + * never gets unlocked. That meant this lock was causing + * all threaded apps to generate a Helgrind still holding + * lock errors. So in time honoured tradition, this can + * be fixed with a hack. This adds a wrapper to exit() + * that sets a global variable hg_in_exit. In the next + * call to pthread_mutex_lock, if that variable is 1 + * then the pthread_mutex_lock wrapper only calls the + * wrapped function. It does not call the PRE and POST + * userreq functions. It then resets hg_in_exit to 0 + * (because there will be more locks in the atexit + * processing). + */ + +int hg_in_exit = 0; + +static int exit_WRK(int status) +{ + int ret; + OrigFn fn; + VALGRIND_GET_ORIG_FN(fn); + + hg_in_exit = 1; + + CALL_FN_W_W(ret, fn, status); + + return ret; +} + +LIBC_FUNC(int, exit, int res) { + return exit_WRK(res); +} + +#endif + //----------------------------------------------------------- // glibc: pthread_mutex_lock @@ -931,6 +973,14 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) fprintf(stderr, "<< pthread_mxlock %p", mutex); fflush(stderr); } +#if defined(VGO_freebsd) + if (hg_in_exit) { + CALL_FN_W_W(ret, fn, mutex); + hg_in_exit = 0; + goto HG_MUTEX_LOCK_OUT; + } +#endif + DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_PRE, pthread_mutex_t*,mutex, long,0/*!isTryLock*/); @@ -944,6 +994,8 @@ static int mutex_lock_WRK(pthread_mutex_t *mutex) DO_CREQ_v_WW(_VG_USERREQ__HG_PTHREAD_MUTEX_LOCK_POST, pthread_mutex_t *, mutex, long, (ret == 0) ? True : False); +HG_MUTEX_LOCK_OUT: + if (ret != 0) { DO_PthAPIerror( "pthread_mutex_lock", ret ); } diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index 5cdabb1127..6a300b83bb 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -1716,18 +1716,7 @@ void evh__pre_thread_ll_exit ( ThreadId quit_tid ) /* Complain if this thread holds any locks. */ nHeld = HG_(cardinalityWS)( univ_lsets, thr_q->locksetA ); tl_assert(nHeld >= 0); - Bool lock_at_exit = False; -#if defined(VGO_freebsd) - /* Bugzilla 494337 - * temporary (?): turn off this check on FreeBSD 14.2+ - * there is a lock during exit() to make it thread safe - * but that lock gets leaked. - */ - if (VG_(getosreldate)() > 1401500) { - lock_at_exit = True; - } -#endif - if (nHeld > 0 && (lock_at_exit == False)) { + if (nHeld > 0) { HChar buf[80]; VG_(sprintf)(buf, "Exiting thread still holds %d lock%s", nHeld, nHeld > 1 ? "s" : ""); diff --git a/helgrind/tests/Makefile.am b/helgrind/tests/Makefile.am index d7101ed1aa..bffd5bf76a 100755 --- a/helgrind/tests/Makefile.am +++ b/helgrind/tests/Makefile.am @@ -87,7 +87,7 @@ EXTRA_DIST = \ tc03_re_excl.stderr.exp \ tc04_free_lock.vgtest tc04_free_lock.stdout.exp \ tc04_free_lock.stderr.exp \ - tc04_free_lock.stderr.exp-freebsd15 \ + tc04_free_lock.stderr.exp-freebsd \ tc05_simple_race.vgtest tc05_simple_race.stdout.exp \ tc05_simple_race.stderr.exp \ tc06_two_races.vgtest tc06_two_races.stdout.exp \ @@ -100,7 +100,6 @@ EXTRA_DIST = \ tc09_bad_unlock.vgtest tc09_bad_unlock.stdout.exp \ tc09_bad_unlock.stderr.exp tc09_bad_unlock.stderr.exp-solaris \ tc09_bad_unlock.stderr.exp-freebsd \ - tc09_bad_unlock.stderr.exp-freebsd15 \ tc10_rec_lock.vgtest tc10_rec_lock.stdout.exp tc10_rec_lock.stderr.exp \ tc11_XCHG.vgtest tc11_XCHG.stdout.exp tc11_XCHG.stderr.exp \ tc12_rwl_trivial.vgtest tc12_rwl_trivial.stdout.exp \ diff --git a/helgrind/tests/tc04_free_lock.stderr.exp b/helgrind/tests/tc04_free_lock.stderr.exp index 772531160b..57cbc8eeca 100644 --- a/helgrind/tests/tc04_free_lock.stderr.exp +++ b/helgrind/tests/tc04_free_lock.stderr.exp @@ -7,6 +7,9 @@ Thread #x is the program's root thread Thread #x: Exiting thread still holds 2 locks ... + by 0x........: exit_WRK (hg_intercepts.c:...) + by 0x........: exit (hg_intercepts.c:...) + ... ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/tc04_free_lock.stderr.exp-freebsd15 b/helgrind/tests/tc04_free_lock.stderr.exp-freebsd similarity index 100% rename from helgrind/tests/tc04_free_lock.stderr.exp-freebsd15 rename to helgrind/tests/tc04_free_lock.stderr.exp-freebsd diff --git a/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd b/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd index 1053cbebf2..41df4cdcc1 100644 --- a/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd +++ b/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd @@ -145,6 +145,9 @@ Thread #x's call to pthread_mutex_unlock failed Thread #x: Exiting thread still holds 1 lock ... + by 0x........: exit_WRK (hg_intercepts.c:...) + by 0x........: exit (hg_intercepts.c:...) + ... ERROR SUMMARY: 11 errors from 11 contexts (suppressed: 0 from 0) diff --git a/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd15 b/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd15 deleted file mode 100644 index c9d6d3d459..0000000000 --- a/helgrind/tests/tc09_bad_unlock.stderr.exp-freebsd15 +++ /dev/null @@ -1,145 +0,0 @@ - ----Thread-Announcement------------------------------------------ - -Thread #x is the program's root thread - ----------------------------------------------------------------- - -Thread #x unlocked a not-locked lock at 0x........ - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:28) - by 0x........: main (tc09_bad_unlock.c:52) - Lock at 0x........ was first observed - at 0x........: pthread_mutex_init (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:24) - by 0x........: main (tc09_bad_unlock.c:52) - Address 0x........ is on thread #x's stack - in frame #x, created by nearly_main (tc09_bad_unlock.c:17) - - ----------------------------------------------------------------- - -Thread #x's call to pthread_mutex_unlock failed - with error code 1 (EPERM: Operation not permitted) - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:28) - by 0x........: main (tc09_bad_unlock.c:52) - ----Thread-Announcement------------------------------------------ - -Thread #x was created - ... - by 0x........: pthread_create@* (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:36) - by 0x........: main (tc09_bad_unlock.c:52) - ----------------------------------------------------------------- - -Thread #x unlocked lock at 0x........ currently held by thread #x - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: child_fn (tc09_bad_unlock.c:12) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - Lock at 0x........ was first observed - at 0x........: pthread_mutex_init (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:32) - by 0x........: main (tc09_bad_unlock.c:52) - Address 0x........ is on thread #x's stack - in frame #x, created by nearly_main (tc09_bad_unlock.c:17) - - ----------------------------------------------------------------- - -Thread #x's call to pthread_mutex_unlock failed - with error code 1 (EPERM: Operation not permitted) - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: child_fn (tc09_bad_unlock.c:12) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - ---------------------- ----------------------------------------------------------------- - -Thread #x unlocked a not-locked lock at 0x........ - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:28) - by 0x........: main (tc09_bad_unlock.c:53) - Lock at 0x........ was first observed - at 0x........: pthread_mutex_init (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:24) - by 0x........: main (tc09_bad_unlock.c:52) - Address 0x........ is on thread #x's stack - in frame #x, created by nearly_main (tc09_bad_unlock.c:17) - - ----------------------------------------------------------------- - -Thread #x's call to pthread_mutex_unlock failed - with error code 1 (EPERM: Operation not permitted) - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:28) - by 0x........: main (tc09_bad_unlock.c:53) - ----------------------------------------------------------------- - -Thread #x: Attempt to re-lock a non-recursive lock I already hold - at 0x........: mutex_lock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_lock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:33) - by 0x........: main (tc09_bad_unlock.c:53) - Lock was previously acquired - at 0x........: mutex_lock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_lock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:33) - by 0x........: main (tc09_bad_unlock.c:52) - ----------------------------------------------------------------- - -Thread #x: Bug in libpthread: recursive write lock granted on mutex/wrlock which does not support recursion - at 0x........: mutex_lock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_lock (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:33) - by 0x........: main (tc09_bad_unlock.c:53) - ----Thread-Announcement------------------------------------------ - -Thread #x was created - ... - by 0x........: pthread_create@* (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:36) - by 0x........: main (tc09_bad_unlock.c:53) - ----------------------------------------------------------------- - -Thread #x unlocked lock at 0x........ currently held by thread #x - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: child_fn (tc09_bad_unlock.c:12) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - Lock at 0x........ was first observed - at 0x........: pthread_mutex_init (hg_intercepts.c:...) - by 0x........: nearly_main (tc09_bad_unlock.c:32) - by 0x........: main (tc09_bad_unlock.c:52) - Address 0x........ is on thread #x's stack - in frame #x, created by nearly_main (tc09_bad_unlock.c:17) - - ----------------------------------------------------------------- - -Thread #x's call to pthread_mutex_unlock failed - with error code 1 (EPERM: Operation not permitted) - at 0x........: mutex_unlock_WRK (hg_intercepts.c:...) - by 0x........: pthread_mutex_unlock (hg_intercepts.c:...) - by 0x........: child_fn (tc09_bad_unlock.c:12) - by 0x........: mythread_wrapper (hg_intercepts.c:...) - ... - - -ERROR SUMMARY: 10 errors from 10 contexts (suppressed: 0 from 0) |
From: Paul F. <pa...@so...> - 2024-11-03 12:18:42
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6178e2cc84116f3878a6af084b9084615541e227 commit 6178e2cc84116f3878a6af084b9084615541e227 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 14:18:12 2024 +0100 FreeBSD regtest: update x86 scalar expected Diff: --- memcheck/tests/freebsd/scalar.stderr.exp-x86 | 34 ++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/memcheck/tests/freebsd/scalar.stderr.exp-x86 b/memcheck/tests/freebsd/scalar.stderr.exp-x86 index cce726e1d6..86599836de 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp-x86 +++ b/memcheck/tests/freebsd/scalar.stderr.exp-x86 @@ -5782,6 +5782,40 @@ Syscall param timerfd_settime(old_value) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +588: SYS_kcmp 5s 0m +--------------------------------------------------------- +Syscall param kcmp(pid1) contains uninitialised byte(s) + ... + +Syscall param kcmp(pid2) contains uninitialised byte(s) + ... + +Syscall param kcmp(type) contains uninitialised byte(s) + ... + +Syscall param kcmp(idx1) contains uninitialised byte(s) + ... + +Syscall param kcmp(idx2) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +589: SYS_getrlimitusage 3s, 1m +--------------------------------------------------------- +Syscall param getrlimitusage(which) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(flags) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(res) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(res) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 1: SYS_exit 1s 0m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-11-03 11:01:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=902663c2253d00f7066e0706256cb1f9498dff77 commit 902663c2253d00f7066e0706256cb1f9498dff77 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 12:00:52 2024 +0100 FreeBSD regtest: spaces not quite right in scalar fakes Diff: --- memcheck/tests/freebsd/scalar.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 7ad3099a04..65348c232a 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -2427,7 +2427,7 @@ int main(void) FAKE_SY(" ...\n"); FAKE_SY("\n"); FAKE_SY("Syscall param kcmp(idx2) contains uninitialised byte(s)\n"); - FAKE_SY(" ...\n"); + FAKE_SY(" ...\n"); FAKE_SY("\n"); #endif @@ -2448,7 +2448,7 @@ int main(void) FAKE_SY("\n"); FAKE_SY("Syscall param getrlimitusage(res) points to unaddressable byte(s)\n"); FAKE_SY(" ...\n"); - FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); FAKE_SY("\n"); #endif |
From: Paul F. <pa...@so...> - 2024-11-03 10:27:37
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=5d3e980dbf3b0df47a58a347e8a9a9bdc3add712 commit 5d3e980dbf3b0df47a58a347e8a9a9bdc3add712 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 11:25:47 2024 +0100 clangd fixes Mainly useless casts and consistent function prototype and definition arg names. Diff: --- VEX/priv/guest_amd64_defs.h | 10 +++++----- coregrind/m_syswrap/syswrap-amd64-freebsd.c | 2 +- coregrind/m_syswrap/syswrap-freebsd.c | 6 +----- include/pub_tool_oset.h | 6 +++--- 4 files changed, 10 insertions(+), 14 deletions(-) diff --git a/VEX/priv/guest_amd64_defs.h b/VEX/priv/guest_amd64_defs.h index f9a9a90975..f7a4e06c05 100644 --- a/VEX/priv/guest_amd64_defs.h +++ b/VEX/priv/guest_amd64_defs.h @@ -48,15 +48,15 @@ /* Convert one amd64 insn to IR. See the type DisOneInstrFn in guest_generic_bb_to_IR.h. */ extern -DisResult disInstr_AMD64 ( IRSB* irbb, - const UChar* guest_code, +DisResult disInstr_AMD64 ( IRSB* irsb_IN, + const UChar* guest_code_IN, Long delta, Addr guest_IP, VexArch guest_arch, const VexArchInfo* archinfo, const VexAbiInfo* abiinfo, - VexEndness host_endness, - Bool sigill_diag ); + VexEndness host_endness_IN, + Bool sigill_diag_IN ); /* Used by the optimiser to specialise calls to helpers. */ extern @@ -108,7 +108,7 @@ extern ULong amd64g_calculate_RCL ( ULong arg, ULong rot_amt, ULong rflags_in, Long sz ); -extern ULong amd64g_calculate_pclmul(ULong s1, ULong s2, ULong which); +extern ULong amd64g_calculate_pclmul(ULong a, ULong b, ULong which); extern ULong amd64g_check_fldcw ( ULong fpucw ); diff --git a/coregrind/m_syswrap/syswrap-amd64-freebsd.c b/coregrind/m_syswrap/syswrap-amd64-freebsd.c index a586985322..e1316eac3e 100644 --- a/coregrind/m_syswrap/syswrap-amd64-freebsd.c +++ b/coregrind/m_syswrap/syswrap-amd64-freebsd.c @@ -643,7 +643,7 @@ PRE(sys_thr_new) goto fail; } tp.stack_base = (void *)ctst->os_state.valgrind_stack_base; - tp.stack_size = (Addr)stk - (Addr)tp.stack_base; + tp.stack_size = stk - (Addr)tp.stack_base; /* Create the new thread */ res = VG_(do_syscall2)(__NR_thr_new, (UWord)&tp, sizeof(tp)); diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 6058bbe836..ea0ca2bfe5 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -384,7 +384,7 @@ void VG_(main_thread_wrapper_NORETURN)(ThreadId tid) vg_assert( VG_(count_living_threads)() == 1 ); ML_(call_on_new_stack_0_1)( - (Addr)sp, /* stack */ + sp, /* stack */ 0, /* bogus return address */ run_a_thread_NORETURN, /* fn to call */ (Word)tid /* arg to give it */ @@ -4616,13 +4616,9 @@ POST(sys__umtx_op) ML_(record_fd_open_nameless) (tid, RES); } break; - case VKI_UMTX_OP_ROBUST_LISTS: - break; case VKI_UMTX_OP_GET_MIN_TIMEOUT: POST_MEM_WRITE( ARG4, sizeof(long int) ); break; - case VKI_UMTX_OP_SET_MIN_TIMEOUT: - break; default: break; } diff --git a/include/pub_tool_oset.h b/include/pub_tool_oset.h index bbd3e08885..3465396127 100644 --- a/include/pub_tool_oset.h +++ b/include/pub_tool_oset.h @@ -98,7 +98,7 @@ typedef Word (*OSetCmp_t) ( const void* key, const void* elem ); extern OSet* VG_(OSetWord_Create) ( Alloc_Fn_t alloc_fn, const HChar* cc, Free_Fn_t free_fn ); -extern void VG_(OSetWord_Destroy) ( OSet* os ); +extern void VG_(OSetWord_Destroy) ( OSet* t ); /*--------------------------------------------------------------------*/ /*--- Operations on OSets (UWord) ---*/ @@ -140,12 +140,12 @@ extern void VG_(OSetWord_Destroy) ( OSet* os ); // they will return False if VG_(OSetWord_Next)() is called without an // intervening call to VG_(OSetWord_ResetIter)(). -extern Word VG_(OSetWord_Size) ( const OSet* os ); +extern Word VG_(OSetWord_Size) ( const OSet* t ); extern void VG_(OSetWord_Insert) ( OSet* os, UWord val ); extern Bool VG_(OSetWord_Contains) ( const OSet* os, UWord val ); extern Bool VG_(OSetWord_Remove) ( OSet* os, UWord val ); extern void VG_(OSetWord_ResetIter) ( OSet* os ); -extern Bool VG_(OSetWord_Next) ( OSet* os, /*OUT*/UWord* val ); +extern Bool VG_(OSetWord_Next) ( OSet* t, /*OUT*/UWord* val ); /*--------------------------------------------------------------------*/ |
From: Paul F. <pa...@so...> - 2024-11-03 09:56:27
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dc1276745ffaa413ee3d3780ea7a048a8c6d7079 commit dc1276745ffaa413ee3d3780ea7a048a8c6d7079 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 10:55:57 2024 +0100 Correct typos and spelling mistakes Diff: --- NEWS.old | 2 +- VEX/priv/guest_ppc_toIR.c | 10 +++--- VEX/priv/host_generic_reg_alloc2.c | 2 +- VEX/pub/libvex_ir.h | 2 +- coregrind/m_hashtable.c | 48 +++++++++++++-------------- coregrind/m_replacemalloc/vg_replace_malloc.c | 2 +- coregrind/m_syswrap/syswrap-freebsd.c | 2 +- coregrind/m_syswrap/syswrap-linux.c | 2 +- coregrind/vgdb.c | 2 +- docs/internals/Darwin-debug.txt | 2 +- docs/internals/threads-syscalls-signals.txt | 2 +- helgrind/hg_main.c | 2 +- include/pub_tool_libcproc.h | 2 +- memcheck/docs/mc-manual.xml | 2 +- memcheck/mc_main.c | 2 +- memcheck/tests/realloc_size_zero.supp | 2 +- none/tests/s390x/vector.h | 4 +-- none/tests/solaris/coredump_many_segments.c | 2 +- 18 files changed, 46 insertions(+), 46 deletions(-) diff --git a/NEWS.old b/NEWS.old index 2b43c91fad..919b85c39a 100644 --- a/NEWS.old +++ b/NEWS.old @@ -14,7 +14,7 @@ AMD64/macOS 10.13 and nanoMIPS/Linux. Rust v0 name demangling. [Update: alas, due to a bug, this support isn't working in 3.18.0.] -* __libc_freeres isn't called anymore after the program recieves a +* __libc_freeres isn't called anymore after the program receives a fatal signal. Causing some internal glibc resources to hang around, but preventing any crashes after the program has ended. diff --git a/VEX/priv/guest_ppc_toIR.c b/VEX/priv/guest_ppc_toIR.c index 94930aa1c9..18716dd04c 100644 --- a/VEX/priv/guest_ppc_toIR.c +++ b/VEX/priv/guest_ppc_toIR.c @@ -6149,13 +6149,13 @@ static IRExpr* dnorm_adj_Vector ( IRExpr* src ) *------------------------------------------------------------*/ static ULong generate_TMreason( UInt failure_code, - UInt persistant, + UInt persistent, UInt nest_overflow, UInt tm_exact ) { ULong tm_err_code = ( (ULong) 0) << (63-6) /* Failure code */ - | ( (ULong) persistant) << (63-7) /* Failure persistant */ + | ( (ULong) persistent) << (63-7) /* Failure persistent */ | ( (ULong) 0) << (63-8) /* Disallowed */ | ( (ULong) nest_overflow) << (63-9) /* Nesting Overflow */ | ( (ULong) 0) << (63-10) /* Footprint Overflow */ @@ -7691,7 +7691,7 @@ static Bool dis_int_misc ( UInt prefix, UInt theInstr ) * * 0b00 Resume instruction fetching and execution when an * exception or an event-based branch exception occurs, - * or a resume signal from the platform is recieved. + * or a resume signal from the platform is received. * * 0b01 Reserved. * @@ -33735,7 +33735,7 @@ static Bool dis_transactional_memory ( UInt prefix, UInt theInstr, UInt nextInst UInt failure_code = 0; /* Forcing failure, will not be due to tabort * or treclaim. */ - UInt persistant = 1; /* set persistant since we are always failing + UInt persistent = 1; /* set persistent since we are always failing * the tbegin. */ UInt nest_overflow = 1; /* Alowed nesting depth overflow, we use this @@ -33759,7 +33759,7 @@ static Bool dis_transactional_memory ( UInt prefix, UInt theInstr, UInt nextInst */ putCR321( 0, mkU8( 0x2 ) ); - tm_reason = generate_TMreason( failure_code, persistant, + tm_reason = generate_TMreason( failure_code, persistent, nest_overflow, tm_exact ); storeTMfailure( guest_CIA_curr_instr, tm_reason, diff --git a/VEX/priv/host_generic_reg_alloc2.c b/VEX/priv/host_generic_reg_alloc2.c index d94d2c92a7..b731720f22 100644 --- a/VEX/priv/host_generic_reg_alloc2.c +++ b/VEX/priv/host_generic_reg_alloc2.c @@ -494,7 +494,7 @@ HInstrArray* doRegisterAllocation_v2 ( rreg_lrs_la = LibVEX_Alloc_inline(rreg_lrs_size * sizeof(RRegLR)); rreg_lrs_db = NULL; /* we'll create this later */ - /* We'll need to track live range start/end points seperately for + /* We'll need to track live range start/end points separately for each rreg. Sigh. */ vassert(n_rregs > 0); rreg_live_after = LibVEX_Alloc_inline(n_rregs * sizeof(Int)); diff --git a/VEX/pub/libvex_ir.h b/VEX/pub/libvex_ir.h index f6f347a052..2d09e37cbc 100644 --- a/VEX/pub/libvex_ir.h +++ b/VEX/pub/libvex_ir.h @@ -2198,7 +2198,7 @@ struct _IRExpr { It is important to get the array size/type exactly correct since IR optimisation looks closely at such info in order to - establish aliasing/non-aliasing between seperate GetI and + establish aliasing/non-aliasing between separate GetI and PutI events, which is used to establish when they can be reordered, etc. Putting incorrect info in will lead to obscure IR optimisation bugs. diff --git a/coregrind/m_hashtable.c b/coregrind/m_hashtable.c index 586cfcc4f3..6fa07c29f1 100644 --- a/coregrind/m_hashtable.c +++ b/coregrind/m_hashtable.c @@ -234,21 +234,21 @@ void* VG_(HT_gen_remove) ( VgHashTable *table, const void* node, HT_Cmp_t cmp ) void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp ) { #define MAXOCCUR 20 - UInt elt_occurences[MAXOCCUR+1]; - UInt key_occurences[MAXOCCUR+1]; - UInt cno_occurences[MAXOCCUR+1]; - /* Key occurence : how many ht elements have the same key. - elt_occurences : how many elements are inserted multiple time. - cno_occurences : how many chains have that length. - The last entry in these arrays collects all occurences >= MAXOCCUR. */ + UInt elt_occurrences[MAXOCCUR+1]; + UInt key_occurrences[MAXOCCUR+1]; + UInt cno_occurrences[MAXOCCUR+1]; + /* Key occurrence : how many ht elements have the same key. + elt_occurrences : how many elements are inserted multiple time. + cno_occurrences : how many chains have that length. + The last entry in these arrays collects all occurrences >= MAXOCCUR. */ #define INCOCCUR(occur,n) (n >= MAXOCCUR ? occur[MAXOCCUR]++ : occur[n]++) UInt i; UInt nkey, nelt, ncno; VgHashNode *cnode, *node; - VG_(memset)(key_occurences, 0, sizeof(key_occurences)); - VG_(memset)(elt_occurences, 0, sizeof(elt_occurences)); - VG_(memset)(cno_occurences, 0, sizeof(cno_occurences)); + VG_(memset)(key_occurrences, 0, sizeof(key_occurrences)); + VG_(memset)(elt_occurrences, 0, sizeof(elt_occurrences)); + VG_(memset)(cno_occurrences, 0, sizeof(cno_occurrences)); // Note that the below algorithm is quadractic in nr of elements in a chain // but if that happens, the hash table/function is really bad and that @@ -264,13 +264,13 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp ) if (node->key == cnode->key) nkey++; } - // If cnode->key not in a previous node, count occurences of key. + // If cnode->key not in a previous node, count occurrences of key. if (nkey == 0) { for (node = cnode; node != NULL; node = node->next) { if (node->key == cnode->key) nkey++; } - INCOCCUR(key_occurences, nkey); + INCOCCUR(key_occurrences, nkey); } nelt = 0; @@ -281,7 +281,7 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp ) nelt++; } } - // If cnode element not in a previous node, count occurences of elt. + // If cnode element not in a previous node, count occurrences of elt. if (nelt == 0) { for (node = cnode; node != NULL; node = node->next) { if (node->key == cnode->key @@ -289,10 +289,10 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp ) nelt++; } } - INCOCCUR(elt_occurences, nelt); + INCOCCUR(elt_occurrences, nelt); } } - INCOCCUR(cno_occurences, ncno); + INCOCCUR(cno_occurrences, ncno); } VG_(message)(Vg_DebugMsg, @@ -302,23 +302,23 @@ void VG_(HT_print_stats) ( const VgHashTable *table, HT_Cmp_t cmp ) " N-plicated elts\n"); nkey = nelt = ncno = 0; for (i = 0; i <= MAXOCCUR; i++) { - if (elt_occurences[i] > 0 - || key_occurences[i] > 0 - || cno_occurences[i] > 0) + if (elt_occurrences[i] > 0 + || key_occurrences[i] > 0 + || cno_occurrences[i] > 0) VG_(message)(Vg_DebugMsg, "%s=%2u : nr chain %6u, nr keys %6u, nr elts %6u\n", i == MAXOCCUR ? ">" : "N", i, - cno_occurences[i], key_occurences[i], elt_occurences[i]); - nkey += key_occurences[i]; - nelt += elt_occurences[i]; - ncno += cno_occurences[i]; + cno_occurrences[i], key_occurrences[i], elt_occurrences[i]); + nkey += key_occurrences[i]; + nelt += elt_occurrences[i]; + ncno += cno_occurrences[i]; } VG_(message)(Vg_DebugMsg, "total nr of unique slots: %6u, keys %6u, elts %6u." " Avg chain len %3.1f\n", ncno, nkey, nelt, - (Double)nelt/(Double)(ncno == cno_occurences[0] ? - 1 : ncno - cno_occurences[0])); + (Double)nelt/(Double)(ncno == cno_occurrences[0] ? + 1 : ncno - cno_occurrences[0])); } diff --git a/coregrind/m_replacemalloc/vg_replace_malloc.c b/coregrind/m_replacemalloc/vg_replace_malloc.c index 4125479b82..aff2d27b3c 100644 --- a/coregrind/m_replacemalloc/vg_replace_malloc.c +++ b/coregrind/m_replacemalloc/vg_replace_malloc.c @@ -138,7 +138,7 @@ Anything "user-defined" or "class-specific" we can't know about and the user needs to use memory pool annotation. - "non-alocating placement" as the name implies does not + "non-allocating placement" as the name implies does not allocate. Placement deletes are no-ops. */ diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index f5516420fb..6058bbe836 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -2007,7 +2007,7 @@ PRE(sys___sysctl) * downwards). Without any special handling this would return the * address of the host userstack. We have created a stack for the * guest (in aspacemgr) and that is the one that we want the guest - * to see. Aspacemgr is setup in m_main.c with the adresses and sizes + * to see. Aspacemgr is setup in m_main.c with the addresses and sizes * saved to file static variables in that file, so we call * VG_(get_usrstack)() to retrieve them from there. */ diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index eec8388224..177712117c 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -560,7 +560,7 @@ static SysRes setup_child_tls (ThreadId ctid, Addr tlsaddr) { static const Bool debug = False; ThreadState* ctst = VG_(get_ThreadState)(ctid); - // res is succesful by default, overriden if a real syscall is needed/done. + // res is successful by default, overriden if a real syscall is needed/done. SysRes res = VG_(mk_SysRes_Success)(0); if (debug) diff --git a/coregrind/vgdb.c b/coregrind/vgdb.c index 786ead160d..d6740aecd4 100644 --- a/coregrind/vgdb.c +++ b/coregrind/vgdb.c @@ -1167,7 +1167,7 @@ static void count_len(char delim, char *buf, size_t *len) If speaking with GDB, early_exit will ensure the GDB user sees the error messages produced by vgdb: early_exit should be used when vgdb exits due to an early error i.e. - error during arg processing, before it could succesfully process the + error during arg processing, before it could successfully process the first packet from GDB. early_exit will then read the first packet send by GDB (i.e. the qSupported packet) and will reply to it with an error and then exit. diff --git a/docs/internals/Darwin-debug.txt b/docs/internals/Darwin-debug.txt index 5bc9b56633..705d6d57de 100644 --- a/docs/internals/Darwin-debug.txt +++ b/docs/internals/Darwin-debug.txt @@ -58,5 +58,5 @@ gets set for core and tool preloads (the equivalent of LD_PRELOAD). DYLD_SHARED_REGION gets set to "avoid" (but note that for macOS 11 Big Sur and later "avoid" is no longer an option). -The Darwin calstack is a bit simpler to synthesise than the ones on +The Darwin callstack is a bit simpler to synthesise than the ones on ELF platforms. There is no auxiliary vector (auxv) to construct. diff --git a/docs/internals/threads-syscalls-signals.txt b/docs/internals/threads-syscalls-signals.txt index 5a083c1222..9b49135448 100644 --- a/docs/internals/threads-syscalls-signals.txt +++ b/docs/internals/threads-syscalls-signals.txt @@ -122,7 +122,7 @@ set of signals while the signal is being delivered. Valgrind's handlers block all signals, so there's no risk of a new signal being delivered to the same thread until the old handler has finished. -The other is that if the thread which recieves the signal is not running +The other is that if the thread which receives the signal is not running (ie, doesn't hold the run_sema, which implies it must be waiting for a syscall to complete), then the signal handler will grab the run_sema before making any global state changes. Since the only time we can get diff --git a/helgrind/hg_main.c b/helgrind/hg_main.c index bbf95c0ba0..5cdabb1127 100644 --- a/helgrind/hg_main.c +++ b/helgrind/hg_main.c @@ -5328,7 +5328,7 @@ Bool hg_handle_client_request ( ThreadId tid, UWord* args, UWord* ret) gnat_dmmls_INIT(); /* Similar loop as for master completed hook below, but stops at - the first matching occurence, only comparing master and + the first matching occurrence, only comparing master and dependent. */ for (n = VG_(sizeXA) (gnat_dmmls) - 1; n >= 0; n--) { GNAT_dmml *dmml = (GNAT_dmml*) VG_(indexXA)(gnat_dmmls, n); diff --git a/include/pub_tool_libcproc.h b/include/pub_tool_libcproc.h index 24f037cce5..49c10dae2e 100644 --- a/include/pub_tool_libcproc.h +++ b/include/pub_tool_libcproc.h @@ -104,7 +104,7 @@ extern UInt VG_(read_millisecond_timer) ( void ); extern Int VG_(gettimeofday)(struct vki_timeval *tv, struct vki_timezone *tz); # if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd) -/* Get the clock value as specified by clk_id. Asserts if unsuccesful. */ +/* Get the clock value as specified by clk_id. Asserts if unsuccessful. */ extern void VG_(clock_gettime)(struct vki_timespec *ts, vki_clockid_t clk_id); # elif defined(VGO_darwin) /* It seems clock_gettime is only available on recent Darwin versions. diff --git a/memcheck/docs/mc-manual.xml b/memcheck/docs/mc-manual.xml index 981ce710fc..4eee0bd333 100644 --- a/memcheck/docs/mc-manual.xml +++ b/memcheck/docs/mc-manual.xml @@ -467,7 +467,7 @@ as "silly arguments" and no back-trace was included. </sect2> -<sect2 id="mc-manual.realocsizezero" +<sect2 id="mc-manual.reallocsizezero" xreflabel="Realloc size zero"> <title>Realloc size zero</title> diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index abd5d68888..626d481d25 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -6329,7 +6329,7 @@ static void mc_print_usage(void) " --keep-stacktraces=alloc|free|alloc-and-free|alloc-then-free|none\n" " stack trace(s) to keep for malloc'd/free'd areas [alloc-and-free]\n" " --show-mismatched-frees=no|yes show frees that don't match the allocator? [yes]\n" -" --show-realloc-size-zero=no|yes show realocs with a size of zero? [yes]\n" +" --show-realloc-size-zero=no|yes show reallocs with a size of zero? [yes]\n" ); } diff --git a/memcheck/tests/realloc_size_zero.supp b/memcheck/tests/realloc_size_zero.supp index 42e5f8d811..229e9abd9b 100644 --- a/memcheck/tests/realloc_size_zero.supp +++ b/memcheck/tests/realloc_size_zero.supp @@ -1,5 +1,5 @@ { - Test for realoc zero suppression + Test for realloc zero suppression Memcheck:ReallocZero fun:realloc fun:main diff --git a/none/tests/s390x/vector.h b/none/tests/s390x/vector.h index b19c3465f5..23ae1e9384 100644 --- a/none/tests/s390x/vector.h +++ b/none/tests/s390x/vector.h @@ -174,7 +174,7 @@ void randomize_memory_pool() [{r,m}_arg2] -- integer arg2 [{r,m}_arg3] -- integer arg3 [{r,m}_result] -- integer result - [{r,m}_memory_pool] -- address of random memory pool. Usefull for some instructions + [{r,m}_memory_pool] -- address of random memory pool. Useful for some instructions */ @@ -291,7 +291,7 @@ __attribute__((unused)) static void test_##insn() \ } /* Stores CC to %[r_result]. - Usefull when testing instructions which modify condition code. + Useful when testing instructions which modify condition code. */ #define S390_TEST_PUT_CC_TO_RESULT "ipm %[r_result] \n srl %[r_result], 28 \n" diff --git a/none/tests/solaris/coredump_many_segments.c b/none/tests/solaris/coredump_many_segments.c index da3f4ae05a..6fbe8b028c 100644 --- a/none/tests/solaris/coredump_many_segments.c +++ b/none/tests/solaris/coredump_many_segments.c @@ -191,7 +191,7 @@ int main(int argc, const char *argv[]) size_t sum = sum_ranges(ranges); if (sum < SEGMENTS * page_size) { - fprintf(stderr, "Free (virtual) address space cannot accomodate " + fprintf(stderr, "Free (virtual) address space cannot accommodate " "%u pages.\n", SEGMENTS); return 1; } |
From: Paul F. <pa...@so...> - 2024-11-03 09:18:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0b6c1515d158745e97ad206bf1cd3caceb8ed4dd commit 0b6c1515d158745e97ad206bf1cd3caceb8ed4dd Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 10:17:17 2024 +0100 Bug 495488 - Add FreeBSD getrlimitusage syscall wrapper Diff: --- .gitignore | 1 + NEWS | 1 + configure.ac | 5 +- coregrind/m_debuginfo/debuginfo.c | 16 ++++ coregrind/m_main.c | 4 + coregrind/m_syswrap/priv_syswrap-freebsd.h | 1 + coregrind/m_syswrap/priv_syswrap-generic.h | 1 + coregrind/m_syswrap/syswrap-freebsd.c | 49 +++++++++++ coregrind/m_syswrap/syswrap-generic.c | 6 ++ coregrind/pub_core_clientstate.h | 3 + coregrind/pub_core_debuginfo.h | 2 + include/vki/vki-freebsd.h | 2 + include/vki/vki-scnums-freebsd.h | 2 + memcheck/tests/freebsd/Makefile.am | 5 ++ memcheck/tests/freebsd/getrlimitusage.c | 106 +++++++++++++++++++++++ memcheck/tests/freebsd/getrlimitusage.stderr.exp | 16 ++++ memcheck/tests/freebsd/getrlimitusage.vgtest | 3 + memcheck/tests/freebsd/scalar.c | 44 ++++++++++ memcheck/tests/freebsd/scalar.stderr.exp | 34 ++++++++ 19 files changed, 300 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e38537a9a6..cfd943bfc6 100644 --- a/.gitignore +++ b/.gitignore @@ -1421,6 +1421,7 @@ /memcheck/tests/freebsd/get_set_login /memcheck/tests/freebsd/getfh /memcheck/tests/freebsd/getfsstat +/memcheck/tests/freebsd/getrlimitusage /memcheck/tests/freebsd/inlinfo /memcheck/tests/freebsd/inlinfo_nested.so /memcheck/tests/freebsd/kqueue diff --git a/NEWS b/NEWS index 70fa86bc06..9724705090 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,7 @@ bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. +495488 Add FreeBSD getrlimitusage syscall wrapper To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/configure.ac b/configure.ac index 96b19d2aa1..ee18cc83a1 100755 --- a/configure.ac +++ b/configure.ac @@ -4955,7 +4955,8 @@ AC_CHECK_FUNCS([ \ sem_timedwait \ sem_clockwait_np \ fdatasync \ - getrandom + getrandom \ + getrlimitusage ]) # AC_CHECK_LIB adds any library found to the variable LIBS, and links these @@ -5009,6 +5010,8 @@ AM_CONDITIONAL([HAVE_FDATASYNC], [test x$ac_cv_func_fdatasync = xyes]) AM_CONDITIONAL([HAVE_GETRANDOM], [test x$ac_cv_func_getrandom = xyes]) +AM_CONDITIONAL([HAVE_GETRLIMITUSAGE], + [test x$ac_cv_func_getrlimitusage = xyes]) if test x$VGCONF_PLATFORM_PRI_CAPS = xMIPS32_LINUX \ -o x$VGCONF_PLATFORM_PRI_CAPS = xMIPS64_LINUX \ diff --git a/coregrind/m_debuginfo/debuginfo.c b/coregrind/m_debuginfo/debuginfo.c index ad05b9928d..11ab473542 100644 --- a/coregrind/m_debuginfo/debuginfo.c +++ b/coregrind/m_debuginfo/debuginfo.c @@ -65,6 +65,9 @@ # include "priv_readmacho.h" # include "priv_readpdb.h" #endif +#if defined(VGO_freebsd) +#include "pub_core_clientstate.h" +#endif /* Set this to 1 to enable somewhat minimal debug printing for the @@ -5145,6 +5148,19 @@ void VG_(load_all_debuginfo) (void) VG_(di_load_di)(di); } } + +SizeT VG_(data_size)(void) +{ + HChar resolved[1000]; + VG_(realpath)( VG_(args_the_exename), resolved); + + for (DebugInfo* di = debugInfo_list; di; di = di->next) { + if (di->data_size && VG_(strcmp)(di->soname, "NONE") == 0 && VG_(strcmp)(resolved, di->fsm.filename) == 0) { + return VG_PGROUNDUP(di->data_size); + } + } + return 0U; +} #endif /*--------------------------------------------------------------------*/ diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 22b4fea0f3..85e744d157 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -3543,6 +3543,10 @@ void _start_in_C_freebsd ( UWord* pArgc, UWord *initial_sp ) # error "Unknown OS" #endif +SizeT VG_(get_client_stack_max_size)(void) +{ + return the_iifii.clstack_max_size; +} Addr VG_(get_initial_client_SP)( void ) { diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h index 5b71866400..8b78c5d742 100644 --- a/coregrind/m_syswrap/priv_syswrap-freebsd.h +++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h @@ -538,6 +538,7 @@ DECL_TEMPLATE(freebsd, sys_timerfd_settime) // 587 // __FreeBSD_version 1400507 and 1500012 DECL_TEMPLATE(freebsd, sys_kcmp) // 588 +DECL_TEMPLATE(freebsd, sys_getrlimitusage) // 589 DECL_TEMPLATE(freebsd, sys_fake_sigreturn) diff --git a/coregrind/m_syswrap/priv_syswrap-generic.h b/coregrind/m_syswrap/priv_syswrap-generic.h index ec174a1520..b888a167cc 100644 --- a/coregrind/m_syswrap/priv_syswrap-generic.h +++ b/coregrind/m_syswrap/priv_syswrap-generic.h @@ -60,6 +60,7 @@ Bool ML_(fd_allowed)(Int fd, const HChar *syscallname, ThreadId tid, Bool isNewFD); extern void ML_(record_fd_close) (ThreadId tid, Int fd); +extern Int ML_(get_fd_count) (void); extern void ML_(record_fd_close_range) (ThreadId tid, Int fd); extern void ML_(record_fd_open_named) (ThreadId tid, Int fd); extern void ML_(record_fd_open_nameless) (ThreadId tid, Int fd); diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 85b60c8f35..f5516420fb 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -6915,6 +6915,54 @@ PRE(sys_kcmp) } } +// SYS_getrlimitusage 589 +// from syscalls.master +// int getrlimitusage(u_int which, int flags, _Out_ rlim_t *res); +PRE(sys_getrlimitusage) +{ + PRINT("sys_getrlimitusage(%lu, %ld, %#" FMT_REGWORD "x )", ARG1, SARG2, ARG3); + PRE_REG_READ3(int, "getrlimitusage", u_int, which, int, flags, vki_rlim_t*, res); + + PRE_MEM_WRITE("getrlimitusage(res)", ARG3, sizeof(vki_rlim_t)); +} + +POST(sys_getrlimitusage) +{ + POST_MEM_WRITE(ARG3, sizeof(vki_rlim_t)); + + // flags can be GETRLIMITUSAGE_EUID or not + // not sure what that means? + + // we need to set the values for NOFILE DATA and STACK + vki_rlim_t* res = (vki_rlim_t*)ARG3; + switch (ARG1) { + case VKI_RLIMIT_NOFILE: + *res = ML_(get_fd_count)() + 3; + break; + case VKI_RLIMIT_DATA: + /* + * The OS initializes this the the size of the .data for the exe. + * We read this in readelf.c. + */ + *res = VG_(data_size)() + VG_(brk_limit) - VG_(brk_base); + break; + case VKI_RLIMIT_STACK: + /* + * The main client stack is quite different when running under Valgrind. + * See aspacemg-linux.c for details, but in short on 64bit systems + * the main stack starts with 128k reserved and a 512M limit. + * Valgrind just has one value, 16M by default (can be changed with + * --main-stacksize). Maybe we should use something more like the OS + * but it doesn't seem that important. + */ + *res = VG_(get_client_stack_max_size)(); + break; + default: + // do nothing + break; + } +} + #undef PRE #undef POST @@ -7606,6 +7654,7 @@ const SyscallTableEntry ML_(syscall_table)[] = { BSDXY(__NR_timerfd_settime, sys_timerfd_settime), // 586 BSDXY(__NR_timerfd_gettime, sys_timerfd_gettime), // 587 BSDX_(__NR_kcmp, sys_kcmp), // 588 + BSDXY(__NR_getrlimitusage, sys_getrlimitusage), // 589 BSDX_(__NR_fake_sigreturn, sys_fake_sigreturn), // 1000, fake sigreturn diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 1d80d09288..d6b10780dc 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -553,6 +553,12 @@ static OpenFd *allocated_fds = NULL; /* Count of open file descriptors. */ static Int fd_count = 0; + +Int ML_(get_fd_count)(void) +{ + return fd_count; +} + /* Close_range caller might want to close very wide range of file descriptors, up to 0U. We want to avoid iterating through such a range in a normall close_range, just up to any open file descriptor. Also, unlike diff --git a/coregrind/pub_core_clientstate.h b/coregrind/pub_core_clientstate.h index dceece9b90..06d0fe343b 100644 --- a/coregrind/pub_core_clientstate.h +++ b/coregrind/pub_core_clientstate.h @@ -98,6 +98,9 @@ extern Addr VG_(client_freeres_wrapper); VG_(get_StackTrace) in m_stacktrace.c for further info. */ extern Addr VG_(client__dl_sysinfo_int80); +/* Get the maximum client stacksize. */ +extern SizeT VG_(get_client_stack_max_size)(void); + /* Obtains the initial client stack pointer from the finalised image info. */ extern Addr VG_(get_initial_client_SP)(void); diff --git a/coregrind/pub_core_debuginfo.h b/coregrind/pub_core_debuginfo.h index 4d6ebda816..64fcd3428a 100644 --- a/coregrind/pub_core_debuginfo.h +++ b/coregrind/pub_core_debuginfo.h @@ -158,6 +158,8 @@ extern UInt VG_(debuginfo_generation) (void); we can't open executable files to get the debuginfo after entering capability mode. */ extern void VG_(load_all_debuginfo) (void); +/* Get the size of .data for the client exe */ +extern SizeT VG_(data_size)(void); #endif diff --git a/include/vki/vki-freebsd.h b/include/vki/vki-freebsd.h index 7b35428a3c..a49650b2bc 100644 --- a/include/vki/vki-freebsd.h +++ b/include/vki/vki-freebsd.h @@ -1230,6 +1230,8 @@ struct vki_rlimit { #define VKI_RLIMIT_CORE 4 /* max core file size */ #define VKI_RLIMIT_NOFILE 8 /* max number of open files */ +#define VKI_GETRLIMITUSAGE_EUID 0x0001 + struct vki___wrusage { struct vki_rusage wru_self; struct vki_rusage wru_children; diff --git a/include/vki/vki-scnums-freebsd.h b/include/vki/vki-scnums-freebsd.h index 852f9833ab..098b722f48 100644 --- a/include/vki/vki-scnums-freebsd.h +++ b/include/vki/vki-scnums-freebsd.h @@ -626,6 +626,8 @@ // __FreeBSD_version 1400507 and 1500012 #define __NR_kcmp 588 +#define __NR_getrlimitusage 589 + #define __NR_fake_sigreturn 1000 #endif /* VKI_UNISTD_FREEBSD_H */ diff --git a/memcheck/tests/freebsd/Makefile.am b/memcheck/tests/freebsd/Makefile.am index b2e84fc03e..4b6b36c6ce 100644 --- a/memcheck/tests/freebsd/Makefile.am +++ b/memcheck/tests/freebsd/Makefile.am @@ -67,6 +67,7 @@ EXTRA_DIST = \ getfsstat.stderr.exp \ getfsstat.supp \ getfsstat.stderr.exp-x86 \ + getrlimitusage.vgtest getrlimitusage.stderr.exp \ kqueue.vgtest \ kqueue.stderr.exp \ kqueue.stdout.exp \ @@ -172,6 +173,10 @@ if HAVE_AIO_READV check_PROGRAMS += aiov endif +if HAVE_GETRLIMITUSAGE +check_PROGRAMS += getrlimitusage +endif + inlinfo_SOURCES = inlinfo.c inlinfo_DEPENDENCIES = inlinfo_nested.so inlinfo_LDFLAGS = -Wl,-rpath,$(top_builddir)/memcheck/tests/freebsd diff --git a/memcheck/tests/freebsd/getrlimitusage.c b/memcheck/tests/freebsd/getrlimitusage.c new file mode 100644 index 0000000000..123ab18ad8 --- /dev/null +++ b/memcheck/tests/freebsd/getrlimitusage.c @@ -0,0 +1,106 @@ +/*- + * SPDX-License-Identifier: BSD-2-Clause + * + * Copyright (c) 2024 The FreeBSD Foundation + * + * This software was developed by Konstantin Belousov <ki...@Fr...> + * under sponsorship from the FreeBSD Foundation. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include <sys/param.h> +#define _RLIMIT_IDENT +#include <err.h> +#include <errno.h> +#include <stdio.h> +#include <stdlib.h> +#include <sys/resource.h> +#include <unistd.h> + +static void usage(void) +{ + fprintf(stderr, "usage: getrlimitusage [-e] [-p pid]\n"); + exit(2); +} + +int main(int argc, char *argv[]) +{ + rlim_t res; + int c, flags; + + flags = 0; + while ((c = getopt(argc, argv, "e")) != -1) + { + switch (c) + { + case 'e': + flags |= GETRLIMITUSAGE_EUID; + break; + case '?': + default: + usage(); + } + } + argc -= optind; + argv += optind; + if (argc != 0) + usage(); + + for (unsigned i = 0;; i++) + { + if (getrlimitusage(i, flags, &res) == -1) + { + if (errno == ENXIO) + { + res = -1; + } + else + { + if (errno != EINVAL) + err(1, "getrlimitusage(%d)", errno); + break; + } + } + // add some rounding to try to make regtest stable + switch (i) + { + case 7: + case 9: + case 12: + case 15: + res = 0U; + break; + case 5: + res = res/100000 * 100000; + break; + case 10: + res = res/1000 * 1000; + break; + default: + break; + } + fprintf(stderr, "%s (%d):\t%jd\n", i < nitems(rlimit_ident) ? rlimit_ident[i] : "unknown", i, (uintmax_t)res +); + } + exit(0); +} diff --git a/memcheck/tests/freebsd/getrlimitusage.stderr.exp b/memcheck/tests/freebsd/getrlimitusage.stderr.exp new file mode 100644 index 0000000000..2a1ecb3eaa --- /dev/null +++ b/memcheck/tests/freebsd/getrlimitusage.stderr.exp @@ -0,0 +1,16 @@ +cpu (0): 0 +fsize (1): -1 +data (2): 4096 +stack (3): 16777216 +core (4): -1 +rss (5): 41800000 +memlock (6): 0 +nproc (7): 0 +nofile (8): 3 +sbsize (9): 0 +vmem (10): 106414000 +npts (11): 0 +swap (12): 0 +kqueues (13): 0 +umtx (14): 0 +pipebuf (15): 0 diff --git a/memcheck/tests/freebsd/getrlimitusage.vgtest b/memcheck/tests/freebsd/getrlimitusage.vgtest new file mode 100644 index 0000000000..dbcd3334dd --- /dev/null +++ b/memcheck/tests/freebsd/getrlimitusage.vgtest @@ -0,0 +1,3 @@ +prereq: test -e ./getrlimitusage +prog: getrlimitusage +vgopts: -q diff --git a/memcheck/tests/freebsd/scalar.c b/memcheck/tests/freebsd/scalar.c index 5aecfebacf..7ad3099a04 100644 --- a/memcheck/tests/freebsd/scalar.c +++ b/memcheck/tests/freebsd/scalar.c @@ -2408,6 +2408,50 @@ int main(void) FAKE_SY("\n"); #endif + /* SYS_kcmp 588 */ +#if defined(SYS_kcmp) + GO(SYS_kcmp, "5s 0m"); + SY(SYS_kcmp, x0+1, x0+2, x0+3, x0+4, x0+5); +#else + FAKE_GO("588: SYS_kcmp 5s 0m"); + FAKE_SY("Syscall param kcmp(pid1) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param kcmp(pid2) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param kcmp(type) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param kcmp(idx1) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param kcmp(idx2) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); +#endif + + /* SYS_getrlimitusage 589 */ +#if defined(SYS_getrlimitusage) + GO(SYS_getrlimitusage, "3s, 1m"); + SY(SYS_getrlimitusage, x0+3, x0, x0+2); +#else + FAKE_GO("589: SYS_getrlimitusage 3s, 1m"); + FAKE_SY("Syscall param getrlimitusage(which) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param getrlimitusage(flags) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param getrlimitusage(res) contains uninitialised byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY("\n"); + FAKE_SY("Syscall param getrlimitusage(res) points to unaddressable byte(s)\n"); + FAKE_SY(" ...\n"); + FAKE_SY(" Address 0x........ is not stack'd, malloc'd or (recently) free'd\n"); + FAKE_SY("\n"); +#endif + /* SYS_exit 1 */ GO(SYS_exit, "1s 0m"); SY(SYS_exit, x0); FAIL; diff --git a/memcheck/tests/freebsd/scalar.stderr.exp b/memcheck/tests/freebsd/scalar.stderr.exp index ed5f0a9b15..4a57e002aa 100644 --- a/memcheck/tests/freebsd/scalar.stderr.exp +++ b/memcheck/tests/freebsd/scalar.stderr.exp @@ -5710,6 +5710,40 @@ Syscall param timerfd_settime(old_value) points to unaddressable byte(s) ... Address 0x........ is not stack'd, malloc'd or (recently) free'd +--------------------------------------------------------- +588: SYS_kcmp 5s 0m +--------------------------------------------------------- +Syscall param kcmp(pid1) contains uninitialised byte(s) + ... + +Syscall param kcmp(pid2) contains uninitialised byte(s) + ... + +Syscall param kcmp(type) contains uninitialised byte(s) + ... + +Syscall param kcmp(idx1) contains uninitialised byte(s) + ... + +Syscall param kcmp(idx2) contains uninitialised byte(s) + ... + +--------------------------------------------------------- +589: SYS_getrlimitusage 3s, 1m +--------------------------------------------------------- +Syscall param getrlimitusage(which) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(flags) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(res) contains uninitialised byte(s) + ... + +Syscall param getrlimitusage(res) points to unaddressable byte(s) + ... + Address 0x........ is not stack'd, malloc'd or (recently) free'd + --------------------------------------------------------- 1: SYS_exit 1s 0m --------------------------------------------------------- |
From: Paul F. <pa...@so...> - 2024-11-03 08:51:25
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6fbd3d4aa17e9fc9f36bb310739cdc16bad6a774 commit 6fbd3d4aa17e9fc9f36bb310739cdc16bad6a774 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 09:50:37 2024 +0100 Fix compiler warnings produced by clang 19. Diff: --- VEX/priv/host_x86_defs.c | 2 +- coregrind/m_cache.c | 2 +- coregrind/m_debuginfo/d3basics.c | 2 +- coregrind/m_debuginfo/readdwarf.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/VEX/priv/host_x86_defs.c b/VEX/priv/host_x86_defs.c index b1c349afbc..5497efdf7a 100644 --- a/VEX/priv/host_x86_defs.c +++ b/VEX/priv/host_x86_defs.c @@ -1141,7 +1141,7 @@ void ppX86Instr ( const X86Instr* i, Bool mode64 ) { ppHRegX86(i->Xin.FpCmp.dst); break; case Xin_SseConst: - vex_printf("const $0x%04x,", (Int)i->Xin.SseConst.con); + vex_printf("const $0x%04x,", (UInt)i->Xin.SseConst.con); ppHRegX86(i->Xin.SseConst.dst); break; case Xin_SseLdSt: diff --git a/coregrind/m_cache.c b/coregrind/m_cache.c index 565aa41767..d12941cd68 100644 --- a/coregrind/m_cache.c +++ b/coregrind/m_cache.c @@ -336,7 +336,7 @@ Intel_cache_info(Int level, VexCacheInfo *ci) } break; default: - VG_(debugLog)(1, "cache", "warning: L%u cache ignored\n", + VG_(debugLog)(1, "cache", "warning: L%d cache ignored\n", (info[0] & 0xe0) >> 5); break; } diff --git a/coregrind/m_debuginfo/d3basics.c b/coregrind/m_debuginfo/d3basics.c index 97ecbdaf4c..564b832e63 100644 --- a/coregrind/m_debuginfo/d3basics.c +++ b/coregrind/m_debuginfo/d3basics.c @@ -1059,7 +1059,7 @@ GXResult ML_(evaluate_Dwarf3_Expr) ( const UChar* expr, UWord exprszB, if (!VG_(clo_xml)) VG_(message)(Vg_DebugMsg, "warning: evaluate_Dwarf3_Expr: unhandled " - "DW_OP_ 0x%x\n", (Int)opcode); + "DW_OP_ 0x%x\n", (UInt)opcode); FAIL("evaluate_Dwarf3_Expr: unhandled DW_OP_"); /*NOTREACHED*/ } diff --git a/coregrind/m_debuginfo/readdwarf.c b/coregrind/m_debuginfo/readdwarf.c index 48df2e73ec..0686e8d078 100644 --- a/coregrind/m_debuginfo/readdwarf.c +++ b/coregrind/m_debuginfo/readdwarf.c @@ -3339,7 +3339,7 @@ static Int dwarfexpr_to_dag ( const UnwindContext* ctx, if (!VG_(clo_xml)) VG_(message)(Vg_DebugMsg, "Warning: DWARF2 CFI reader: unhandled DW_OP_ " - "opcode 0x%x\n", (Int)opcode); + "opcode 0x%x\n", (UInt)opcode); return -1; } |
From: Paul F. <pa...@so...> - 2024-11-03 08:12:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=836b7481729649ad95220db3dd7be86ed8e08382 commit 836b7481729649ad95220db3dd7be86ed8e08382 Author: Paul Floyd <pj...@wa...> Date: Sun Nov 3 09:12:13 2024 +0100 Add /none/tests/use_after_close to .gitignore Diff: --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 1b6e2d002b..e38537a9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -1647,6 +1647,7 @@ /none/tests/tls /none/tests/track-fds-exec-children /none/tests/unit_debuglog +/none/tests/use_after_close /none/tests/valgrind_cpp_test /none/tests/vgcore.* /none/tests/vgprintf |
From: Paul F. <pa...@so...> - 2024-11-02 21:23:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a5c14fd3452549bd61c24aa4db6ed4ab45411e11 commit a5c14fd3452549bd61c24aa4db6ed4ab45411e11 Author: Paul Floyd <pj...@wa...> Date: Sat Nov 2 22:22:10 2024 +0100 FreeBSD syscall: fix syscall name used in kcmp traces. Diff: --- coregrind/m_syswrap/syswrap-freebsd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 685eb6be07..85b60c8f35 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -6895,7 +6895,7 @@ POST(sys_timerfd_settime) // int kcmp(pid_t pid1, pid_t pid2, int type, uintptr_t idx1, uintptr_t idx2); PRE(sys_kcmp) { - PRINT("kcmp(%ld, %ld, %ld, %" FMT_REGWORD "u, %" FMT_REGWORD "u)", + PRINT("sys_kcmp(%ld, %ld, %ld, %" FMT_REGWORD "u, %" FMT_REGWORD "u)", SARG1, SARG2, SARG3, ARG4, ARG5); switch (ARG3) { case VKI_KCMP_FILES: |
From: Paul F. <pa...@so...> - 2024-11-01 08:00:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7424c61b16316c2080d02ec0605a4177557ad9be commit 7424c61b16316c2080d02ec0605a4177557ad9be Author: Paul Floyd <pj...@wa...> Date: Fri Nov 1 08:59:19 2024 +0100 FreeBSD regtest: add _write to none filter_fdleak Also bump up news and configure to 3.25 git. Diff: --- NEWS | 31 +++++++++++++++++++++++++++++++ configure.ac | 6 +++--- none/tests/filter_fdleak | 2 +- 3 files changed, 35 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 49b4647d42..70fa86bc06 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,34 @@ +Release 3.25.0 (?? Apr 2025) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, +PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux, +MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android, +X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD, AMD64/FreeBSD +and ARM64/FreeBSD There is also preliminary support for X86/macOS 10.13, +AMD64/macOS 10.13 and nanoMIPS/Linux. + +* ==================== CORE CHANGES =================== + +* ================== PLATFORM CHANGES ================= + +* ==================== TOOL CHANGES =================== + +* ==================== FIXED BUGS ==================== + +The following bugs have been fixed or resolved. Note that "n-i-bz" +stands for "not in bugzilla" -- that is, a bug that was reported to us +but never got a bugzilla entry. We encourage you to file bugs in +bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather +than mailing the developers (or mailing lists) directly -- bugs that +are not entered into bugzilla tend to get forgotten about or ignored. + + +To see details of a given bug, visit + https://bugs.kde.org/show_bug.cgi?id=XXXXXX +where XXXXXX is the bug number as listed above. + + Release 3.24.0 (31 Oct 2024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/configure.ac b/configure.ac index 095659ac25..96b19d2aa1 100755 --- a/configure.ac +++ b/configure.ac @@ -15,10 +15,10 @@ # Also set the (expected/last) release date here. # Do not forget to rerun ./autogen.sh m4_define([v_major_ver], [3]) -m4_define([v_minor_ver], [24]) +m4_define([v_minor_ver], [25]) m4_define([v_micro_ver], [0]) -m4_define([v_suffix_ver], []) -m4_define([v_rel_date], ["31 Oct 2024"]) +m4_define([v_suffix_ver], [GIT]) +m4_define([v_rel_date], ["?? Apr 2025"]) m4_define([v_version], m4_if(v_suffix_ver, [], [v_major_ver.v_minor_ver.v_micro_ver], diff --git a/none/tests/filter_fdleak b/none/tests/filter_fdleak index d26937bccd..a63c2c7e58 100755 --- a/none/tests/filter_fdleak +++ b/none/tests/filter_fdleak @@ -21,7 +21,7 @@ perl -p -e 's/open \(open64\.c:[1-9][0-9]*\)/creat (in \/...libc...)/' | perl -p -e "s/: open \(/: creat (/" | # FreeBSD specific fdleak filters -perl -p -e 's/ _close / close /;s/ _openat / creat /;s/internet/AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:.../' | +perl -p -e 's/ _close / close /;s/ _openat / creat /;s/ _write/ write/;s/internet/AF_INET socket 4: 127.0.0.1:... <-> 127.0.0.1:.../' | sed '/by 0x........: close (in \/...libc...)/d' | sed '/by 0x........: creat (in \/...libc...)/d' | |
From: Mark W. <ma...@kl...> - 2024-11-01 05:30:00
|
We are pleased to announce a new release of Valgrind, version 3.24.0, available from https://valgrind.org/downloads/current.html. See the release notes below for details of changes. Our thanks to all those who contribute to Valgrind's development. This release represents a great deal of time, energy and effort on the part of many people. Happy and productive debugging and profiling, -- The Valgrind Developers ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Release 3.24.0 (31 Oct 2024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, PPC32/Linux, PPC64BE/Linux, PPC64LE/Linux, S390X/Linux, MIPS32/Linux, MIPS64/Linux, ARM/Android, ARM64/Android, MIPS32/Android, X86/Android, X86/Solaris, AMD64/Solaris, AMD64/MacOSX 10.12, X86/FreeBSD, AMD64/FreeBSD and ARM64/FreeBSD There is also preliminary support for X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * ==================== CORE CHANGES =================== * Bad file descriptor usage now generates a real error with --track-fds=yes that is suppressible and shows up in the xml output with full execution backtrace. The warnings shown without using the option are deprecated and will be removed in a future valgrind version. * Ada name demangling is now supported in error messages. * ================== PLATFORM CHANGES ================= * S390X added support for the DFLTCC instruction provided by the deflate-conversion facility (z15/arch13). * S390X added support for the instructions provided by the MSA facility and MSA extensions 1-9. * ==================== TOOL CHANGES =================== * ==================== FIXED BUGS ==================== The following bugs have been fixed or resolved. Note that "n-i-bz" stands for "not in bugzilla" -- that is, a bug that was reported to us but never got a bugzilla entry. We encourage you to file bugs in bugzilla (https://bugs.kde.org/enter_bug.cgi?product=valgrind) rather than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. 202770 open fd at exit --log-socket=127.0.0.1:1500 with --track-fds=yes 276780 An instruction in fftw (Fast Fourier Transform) is unhandled by 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) 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 440180 s390x: Failed assertion in disassembler 444781 MIPS: wrong syscall numbers used 447989 Support Armv8.2 SHA-512 instructions 445235 Java/Ada/D demangling is probably broken 453044 gbserver_tests failures in aarch64 479661 Valgrind leaks file descriptors 486180 [Valgrind][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 487993 Alignment error when using Eigen with Valgrind and -m32 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 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 490651 Stop using -flto-partition=one 491394 (vgModuleLocal_addDiCfSI): Assertion 'di->fsm.have_rx_map && di->fsm.rw_map_count' failed 492210 False positive on x86/amd64 with ZF taken directly from addition 492214 statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 but not supported in valgrind 492422 Please support DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD 492663 Valgrind ignores debug info for some binaries 493418 Add bad fd usage errors for --track-fds in ML_(fd_allowed) 493454 Missing FUSE_COMPATIBLE_MAY_BLOCK markers 493507 direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE_MAY_BLOCK 493959 s390x: Fix regtest failure for none/tests/s390x/op00 493970 s390x: Store/restore FPC upon helper call causes slowdown 494252 s390x: incorrect disassembly for LOCHI and friends 494960 Fixes and tweaks for gsl19test 495278 PowerPC instruction dcbf should allow the L field values of 4, 6 on ISA 3.0 and earlier, just ignore the value 495469 aligned_alloc and posix_memalign missing MALLOC_TRACE with returned pointer 495470 s390x: 3.24.0.RC1 missing file and regtest failure n-i-bz Improve messages for sigaltstack errors, use specific stack_t member names To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX where XXXXXX is the bug number as listed above. (3.24.0.RC1: 27 Oct 2024) |
From: Mark W. <ma...@so...> - 2024-11-01 05:05:53
|
The signed tag 'VALGRIND_3_24_0' was created pointing to: fcdaa47426... -> 3.24.0 final Tagger: Mark Wielaard <ma...@kl...> Date: Fri Nov 1 06:05:07 2024 +0100 valgrind 3.24.0 release |
From: Mark W. <ma...@so...> - 2024-11-01 05:03:54
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fcdaa474260a54af9c4b241bac9c1e9775081f78 commit fcdaa474260a54af9c4b241bac9c1e9775081f78 Author: Mark Wielaard <ma...@kl...> Date: Fri Nov 1 05:19:38 2024 +0100 -> 3.24.0 final Diff: --- NEWS | 2 +- configure.ac | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 3922b423d8..49b4647d42 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -Release 3.24.0.RC1 (27 Oct 2024) +Release 3.24.0 (31 Oct 2024) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ This release supports X86/Linux, AMD64/Linux, ARM32/Linux, ARM64/Linux, diff --git a/configure.ac b/configure.ac index 9670d02b88..095659ac25 100755 --- a/configure.ac +++ b/configure.ac @@ -17,8 +17,8 @@ m4_define([v_major_ver], [3]) m4_define([v_minor_ver], [24]) m4_define([v_micro_ver], [0]) -m4_define([v_suffix_ver], [RC1]) -m4_define([v_rel_date], ["27 Oct 2024"]) +m4_define([v_suffix_ver], []) +m4_define([v_rel_date], ["31 Oct 2024"]) m4_define([v_version], m4_if(v_suffix_ver, [], [v_major_ver.v_minor_ver.v_micro_ver], |
From: Mark W. <ma...@so...> - 2024-11-01 03:40:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=25032e9bfa7f5c37d0b77d2366c1c3a45459759c commit 25032e9bfa7f5c37d0b77d2366c1c3a45459759c Author: Mark Wielaard <ma...@kl...> Date: Fri Nov 1 04:40:22 2024 +0100 Make const OpenFd *ML_(find_OpenFd) static Diff: --- coregrind/m_syswrap/syswrap-generic.c | 1 + 1 file changed, 1 insertion(+) diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 920c87a8ae..1d80d09288 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -1599,6 +1599,7 @@ static Addr do_brk ( Addr newbrk, ThreadId tid ) return VG_(brk_limit); } +static const OpenFd *ML_(find_OpenFd)(Int fd) { OpenFd *i = allocated_fds; |
From: Mark W. <ma...@so...> - 2024-11-01 03:30:16
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6ec6e12678273e3b09ddf9ae07d11d4ac0c91d7a commit 6ec6e12678273e3b09ddf9ae07d11d4ac0c91d7a Author: Mark Wielaard <ma...@kl...> Date: Fri Nov 1 04:26:45 2024 +0100 DRM_IOCTLs SYNCOBJ_HANDLE_TO_FD, PRIME_HANDLE_TO_FD and MODE_CREATE_LEASE These three DRM_IOCTLs create new file descriptors, so track them using ML_(record_fd_open_nameless). https://bugs.kde.org/show_bug.cgi?id=492422 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-linux.c | 27 +++++++++++++++++++++++++++ include/vki/vki-linux-drm.h | 28 ++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/NEWS b/NEWS index 52c66c8f7c..3922b423d8 100644 --- a/NEWS +++ b/NEWS @@ -75,6 +75,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 492210 False positive on x86/amd64 with ZF taken directly from addition 492214 statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 but not supported in valgrind +492422 Please support DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD 492663 Valgrind ignores debug info for some binaries 493418 Add bad fd usage errors for --track-fds in ML_(fd_allowed) 493454 Missing FUSE_COMPATIBLE_MAY_BLOCK markers diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index 6a6b6bcb34..eec8388224 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -11777,6 +11777,33 @@ POST(sys_ioctl) } break; + case VKI_DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD: + if (ARG3) { + struct vki_drm_syncobj_handle *data = + (struct vki_drm_syncobj_handle *)(Addr)ARG3; + if (VG_(clo_track_fds)) + ML_(record_fd_open_nameless) (tid, data->fd); + } + break; + + case VKI_DRM_IOCTL_PRIME_HANDLE_TO_FD: + if (ARG3) { + struct vki_drm_prime_handle *data = + (struct vki_drm_prime_handle *)(Addr)ARG3; + if (VG_(clo_track_fds)) + ML_(record_fd_open_nameless) (tid, data->fd); + } + break; + + case VKI_DRM_IOCTL_MODE_CREATE_LEASE: + if (ARG3) { + struct vki_drm_mode_create_lease *data = + (struct vki_drm_mode_create_lease*)(Addr)ARG3; + if (VG_(clo_track_fds)) + ML_(record_fd_open_nameless) (tid, data->fd); + } + break; + /* KVM ioctls that only write the system call return value */ case VKI_KVM_GET_API_VERSION: case VKI_KVM_CREATE_VM: diff --git a/include/vki/vki-linux-drm.h b/include/vki/vki-linux-drm.h index ca62044d22..e7ff583770 100644 --- a/include/vki/vki-linux-drm.h +++ b/include/vki/vki-linux-drm.h @@ -441,6 +441,30 @@ struct vki_drm_mode_crtc_lut { __vki_u64 blue; }; +struct vki_drm_syncobj_handle { + __vki_u32 handle; + __vki_u32 flags; + + __vki_s32 fd; + __vki_u32 pad; +}; + +struct vki_drm_prime_handle { + __vki_u32 handle; + __vki_u32 flags; + __vki_s32 fd; +}; + +struct vki_drm_mode_create_lease { + __vki_u64 object_ids; + __vki_u32 object_count; + __vki_u32 flags; + + __vki_u32 lessee_id; + __vki_u32 fd; +}; + + //---------------------------------------------------------------------- // From include/drm/drm.h //---------------------------------------------------------------------- @@ -537,6 +561,10 @@ struct vki_drm_mode_crtc_lut { #define VKI_DRM_COMMAND_BASE 0x40 #define VKI_DRM_COMMAND_END 0xA0 +#define VKI_DRM_IOCTL_SYNCOBJ_HANDLE_TO_FD VKI_DRM_IOWR(0xC1, struct vki_drm_syncobj_handle) +#define VKI_DRM_IOCTL_PRIME_HANDLE_TO_FD VKI_DRM_IOWR(0x2d, struct vki_drm_prime_handle) +#define VKI_DRM_IOCTL_MODE_CREATE_LEASE VKI_DRM_IOWR(0xC6, struct vki_drm_mode_create_lease) + //---------------------------------------------------------------------- // From include/drm/i915_drm.h //---------------------------------------------------------------------- |
From: Mark W. <ma...@so...> - 2024-10-31 23:37:01
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=849dca0b4bef48e1f3640751b24d9e3e7f2d4aaf commit 849dca0b4bef48e1f3640751b24d9e3e7f2d4aaf Author: Florian Krohm <fl...@ei...> Date: Fri Nov 1 00:31:27 2024 +0100 gsl19test does not work properly when /bin/sh is /bin/dash There were 2 issues: 1) The output redirect operators seem to be bash specific. All output went to the terminal..... 2) When invoking valgrind the 'eval' needs to precede GSL_TEST_VERBOSE=1. Otherwise that environment variable is not seen by valgrind. Two tweaks: 1) Determine the number of available processors and use that in make -j when building gsl-1.9 2) Replace -v with -q in the valgrind invocation. The file out-V is already quite large (approx 600 MB). It would be enormous with -v. https://bugs.kde.org/show_bug.cgi?id=494960 Diff: --- NEWS | 1 + auxprogs/gsl19test | 13 ++++++++++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 54229dc57c..52c66c8f7c 100644 --- a/NEWS +++ b/NEWS @@ -83,6 +83,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 493959 s390x: Fix regtest failure for none/tests/s390x/op00 493970 s390x: Store/restore FPC upon helper call causes slowdown 494252 s390x: incorrect disassembly for LOCHI and friends +494960 Fixes and tweaks for gsl19test 495278 PowerPC instruction dcbf should allow the L field values of 4, 6 on ISA 3.0 and earlier, just ignore the value 495469 aligned_alloc and posix_memalign missing MALLOC_TRACE with returned diff --git a/auxprogs/gsl19test b/auxprogs/gsl19test index b97738f506..d111d379a5 100755 --- a/auxprogs/gsl19test +++ b/auxprogs/gsl19test @@ -38,6 +38,13 @@ then exit 1 fi +# nproc is part of coreutils so it's available on GNU/Linux. Not so on Mac OS X. +command -v nproc > /dev/null +if [ $? -eq 0 ]; then + num_cpu=`nproc` +else + num_cpu=1 +fi runcmd () { echo -n " $1 ... " @@ -95,18 +102,18 @@ runcmd "Configuring " \ "(cd gsl-1.9 && CC=$GSL_CC CFLAGS=\"$GSL_CFLAGS\" ./configure)" && \ \ runcmd "Building " \ - "(cd gsl-1.9 && make && make -k check)" + "(cd gsl-1.9 && make -j $num_cpu && make -j $num_cpu -k check)" echo -n " Collecting reference results " rm -f out-REF (cd gsl-1.9 && for f in $ALL_TESTS ; \ - do GSL_TEST_VERBOSE=1 ./$f ; done) &> out-REF + do GSL_TEST_VERBOSE=1 ./$f ; done) > out-REF 2>&1 echo " ... done" echo -n " Collecting valgrinded results " rm -f out-V (cd gsl-1.9 && for f in $ALL_TESTS ; \ - do GSL_TEST_VERBOSE=1 eval $GSL_VV -v --trace-children=yes "$GSL_VFLAGS" ./$f ; done) &> out-V + do eval GSL_TEST_VERBOSE=1 $GSL_VV -q --trace-children=yes "$GSL_VFLAGS" ./$f ; done) > out-V 2>&1 echo " ... done" echo -n " Native fails: " && (grep FAIL: out-REF | wc -l) |
From: Mark W. <ma...@so...> - 2024-10-31 22:38:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=22971a15d62df6351ab97ea064eebd9bdcb4cf37 commit 22971a15d62df6351ab97ea064eebd9bdcb4cf37 Author: Alexandra Hájková <aha...@re...> Date: Wed Oct 16 13:38:48 2024 -0400 Report track-fd errors for fd used which was not opened or already closed Add (optional) pathname, description, where_closed and where_opened fields to struct FdBadUse. Print those fields when set in fd_pp_Error. Add a new function ML_(find_OpenFd) that provides a recorded OpenFd given an fd (or NULL when the fd was never recorded). In ML_(fd_allowed) when using a file descriptor use ML_(find_OpenFd) to see if the fd was ever created, if not create an "was never created" FdBadUse error. If it was created, but already closed create an "was closed already", filling in as much details as we can. Add none/tests/use_after_close.vgtest to test, already closed, never created, invalid, double (double) close and invalid close issues. Adjust error message in none/tests/fdbaduse.stderr.exp. https://bugs.kde.org/show_bug.cgi?id=493418 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-generic.c | 73 ++++++++++++++++++++++++++++++++--- none/tests/Makefile.am | 6 ++- none/tests/fdbaduse.stderr.exp | 2 +- none/tests/use_after_close.c | 33 ++++++++++++++++ none/tests/use_after_close.stderr.exp | 28 ++++++++++++++ none/tests/use_after_close.vgtest | 4 ++ 7 files changed, 139 insertions(+), 8 deletions(-) diff --git a/NEWS b/NEWS index 2857a387d1..54229dc57c 100644 --- a/NEWS +++ b/NEWS @@ -76,6 +76,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 492214 statx(fd, NULL, AT_EMPTY_PATH) is supported since Linux 6.11 but not supported in valgrind 492663 Valgrind ignores debug info for some binaries +493418 Add bad fd usage errors for --track-fds in ML_(fd_allowed) 493454 Missing FUSE_COMPATIBLE_MAY_BLOCK markers 493507 direct readlink syscall from PRE handler is incompatible with FUSE_COMPATIBLE_MAY_BLOCK diff --git a/coregrind/m_syswrap/syswrap-generic.c b/coregrind/m_syswrap/syswrap-generic.c index 26e14d4943..920c87a8ae 100644 --- a/coregrind/m_syswrap/syswrap-generic.c +++ b/coregrind/m_syswrap/syswrap-generic.c @@ -593,6 +593,11 @@ struct BadCloseExtra { struct FdBadUse { Int fd; /* The file descriptor */ + HChar *pathname; /* NULL if not a regular file or unknown */ + HChar *description; /* Description of the file descriptor + might include the pathname */ + ExeContext *where_closed; /* record the last close of fd */ + ExeContext *where_opened; /* recordwhere the fd was opened */ }; struct NotClosedExtra { @@ -1166,8 +1171,25 @@ void fd_pp_Error (const Error *err) if (xml) VG_(emit)(" <kind>FdBadUse</kind>\n"); struct FdBadUse *nce = (struct FdBadUse *) VG_(get_error_extra)(err); - if (xml) VG_(emit)(" <fd>%d</fd>\n", nce->fd); - VG_(emit)("%sInvalid file descriptor %d%s\n", whatpre, nce->fd, whatpost); + const char *error_string = VG_(get_error_string)(err); + if (xml) { + VG_(emit)(" <fd>%d</fd>\n", nce->fd); + if (nce->pathname) + VG_(emit)(" <path>%s</path>\n", nce->pathname); + } + VG_(emit)("%sFile descriptor %d %s%s\n", whatpre, nce->fd, + error_string, whatpost); + /* If the file descriptor was never created we won't have + where_closed and where_opened. Only print them in a + use after close case. */ + if (nce->where_closed) { + VG_(emit)("%sPreviously closed%s\n", auxpre, auxpost); + VG_(pp_ExeContext)(nce->where_closed); + } + if (nce->where_opened) { + VG_(emit)("%sOriginally opened%s\n", auxpre, auxpost); + VG_(pp_ExeContext)(nce->where_opened); + } VG_(pp_ExeContext)(where); } else { vg_assert2 (False, "Unknown error kind: %d", @@ -1577,6 +1599,19 @@ static Addr do_brk ( Addr newbrk, ThreadId tid ) return VG_(brk_limit); } +const OpenFd *ML_(find_OpenFd)(Int fd) +{ + OpenFd *i = allocated_fds; + + while (i) { + if (i->fd == fd) + return i; + i = i->next; + } + + return NULL; +} + /* --------------------------------------------------------------------- Vet file descriptors for sanity @@ -1640,14 +1675,42 @@ Bool ML_(fd_allowed)(Int fd, const HChar *syscallname, ThreadId tid, client is exactly what we don't want. */ /* croak? */ + if (VG_(clo_track_fds) && allowed + && !isNewFd && (VG_(strcmp)("close", syscallname) != 0)) { + const OpenFd *openbadfd = ML_(find_OpenFd)(fd); + if (!openbadfd) { + /* File descriptor which was never created (or inherited). */ + struct FdBadUse badfd; + badfd.fd = fd; + badfd.pathname = NULL; + badfd.description = NULL; + badfd.where_opened = NULL; + badfd.where_closed = NULL; + VG_(maybe_record_error)(tid, FdBadUse, 0, + "was never created", &badfd); + + } else if (openbadfd->fd_closed) { + /* Already closed file descriptor is being used. */ + struct FdBadUse badfd; + badfd.fd = fd; + badfd.pathname = openbadfd->pathname; + badfd.description = openbadfd->description; + badfd.where_opened = openbadfd->where; + badfd.where_closed = openbadfd->where_closed; + VG_(maybe_record_error)(tid, FdBadUse, 0, + "was closed already", &badfd); + } + } if ((!allowed) && !isNewFd) { - // XXX FdBadUse might want to add more info if we are going to include - // already closed file descriptors, then we do have a bit more info if (VG_(clo_track_fds)) { struct FdBadUse badfd; badfd.fd = fd; + badfd.pathname = NULL; + badfd.description = NULL; + badfd.where_opened = NULL; + badfd.where_closed = NULL; VG_(maybe_record_error)(tid, FdBadUse, 0, - "invalid file descriptor", &badfd); + "Invalid file descriptor", &badfd); } else if (VG_(showing_core_warnings) ()) { // XXX legacy warnings, will be removed eventually VG_(message)(Vg_UserMsg, diff --git a/none/tests/Makefile.am b/none/tests/Makefile.am index 4ec2943175..59be79e579 100644 --- a/none/tests/Makefile.am +++ b/none/tests/Makefile.am @@ -256,7 +256,8 @@ EXTRA_DIST = \ 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 \ - fdbaduse.stderr.exp fdbaduse.vgtest + fdbaduse.stderr.exp fdbaduse.vgtest \ + use_after_close.stderr.exp use_after_close.vgtest check_PROGRAMS = \ @@ -311,7 +312,8 @@ check_PROGRAMS = \ sigprocmask \ socket_close \ file_dclose \ - fdbaduse + fdbaduse \ + use_after_close if HAVE_STATIC_LIBC if ! VGCONF_OS_IS_LINUX diff --git a/none/tests/fdbaduse.stderr.exp b/none/tests/fdbaduse.stderr.exp index 15d71f99aa..a4772dbd99 100644 --- a/none/tests/fdbaduse.stderr.exp +++ b/none/tests/fdbaduse.stderr.exp @@ -1,3 +1,3 @@ -Invalid file descriptor -1 +File descriptor -1 Invalid file descriptor at 0x........: close (in /...libc...) by 0x........: main diff --git a/none/tests/use_after_close.c b/none/tests/use_after_close.c new file mode 100644 index 0000000000..deb4e68881 --- /dev/null +++ b/none/tests/use_after_close.c @@ -0,0 +1,33 @@ +#include<stdio.h> +#include <stdlib.h> +#include <unistd.h> +#include <fcntl.h> + +int main(void) +{ + char *string = "bad\n"; + int fd = dup(2); + + /* OK. */ + write(fd, string, 4); + close(fd); + + /* Already closed. */ + write(fd, string, 4); + + /* Never created. */ + write(7, string, 4); + + /* Invalid. */ + write(-7, string, 4); + + /* Double double close. */ + close(fd); + + /* Invalid close. */ + close (-7); + + return 0; +} + + diff --git a/none/tests/use_after_close.stderr.exp b/none/tests/use_after_close.stderr.exp new file mode 100644 index 0000000000..1ef31c6551 --- /dev/null +++ b/none/tests/use_after_close.stderr.exp @@ -0,0 +1,28 @@ +bad +File descriptor 3 was closed already + Previously closed + at 0x........: close (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup (in /...libc...) + by 0x........: main + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor 7 was never created + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor -7 Invalid file descriptor + at 0x........: write (in /...libc...) + by 0x........: main +File descriptor ...: ... is already closed + at 0x........: close (in /...libc...) + by 0x........: main + Previously closed + at 0x........: close (in /...libc...) + by 0x........: main + Originally opened + at 0x........: dup (in /...libc...) + by 0x........: main +File descriptor -7 Invalid file descriptor + at 0x........: close (in /...libc...) + by 0x........: main diff --git a/none/tests/use_after_close.vgtest b/none/tests/use_after_close.vgtest new file mode 100644 index 0000000000..eec5b93088 --- /dev/null +++ b/none/tests/use_after_close.vgtest @@ -0,0 +1,4 @@ +prog: use_after_close +prereq: test -x use_after_close +vgopts: -q --track-fds=yes +stderr_filter: filter_fdleak |
From: Paul F. <pj...@wa...> - 2024-10-29 21:14:22
|
On 28-10-24 19:54, Paul Floyd via Valgrind-developers wrote: > > > On 28-10-24 00:58, Mark Wielaard wrote: >> There are still some pending patches, but lets do an RC1 for some >> wider testing. > > Hi Mark > > I tested FreeBSD 14.1 arm64 and amd64 this morning, both OK. > > I'll try to do more testing tomorrow and Wednesday. Now for the poor relatives. macOS 10.13 == 771 tests, 198 stderr failures, 13 stdout failures, 0 stderrB failures, 0 stdoutB failures, 4 post failures == (327 fails back with 3.22) Not too bad, and I've seen that Louis Brunner's macOS port has recently made big progress on arm64. Illumos OpenIndiana Hipster 2024.10 == 897 tests, 80 stderr failures, 14 stdout failures, 15 stderrB failures, 6 stdoutB failures, 6 post failures == (78 fails back with 3.22) A broad reflection on the rate of change in Illumos. Alpine / musl libc. I've given up doing anything for musl. I got fed up with the main musl developer Rich Felker telling me on IRC #musl how Valgrind should work. A+ Paul |
From: Paul F. <pa...@so...> - 2024-10-29 20:03:48
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=688f35dfdb5cc628a5c202069835a9a1390923a2 commit 688f35dfdb5cc628a5c202069835a9a1390923a2 Author: Paul Floyd <pj...@wa...> Date: Tue Oct 29 21:02:38 2024 +0100 Illumos: fix wartnings Macro redefinition, calculating the size of an array and printf format specifiers. Diff: --- callgrind/dump.c | 2 ++ coregrind/m_syswrap/syswrap-amd64-solaris.c | 4 ++-- coregrind/m_syswrap/syswrap-solaris.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/callgrind/dump.c b/callgrind/dump.c index 7f9f59f92a..130b73bd0b 100644 --- a/callgrind/dump.c +++ b/callgrind/dump.c @@ -895,7 +895,9 @@ void swap(BBCC** a, BBCC** b) t = *a; *a = *b; *b = t; } +#if !defined(min) #define min(x, y) ((x)<=(y) ? (x) : (y)) +#endif static BBCC** med3(BBCC **a, BBCC **b, BBCC **c, int (*cmp)(BBCC**,BBCC**)) diff --git a/coregrind/m_syswrap/syswrap-amd64-solaris.c b/coregrind/m_syswrap/syswrap-amd64-solaris.c index 8a0b3c08df..404cba5a0a 100644 --- a/coregrind/m_syswrap/syswrap-amd64-solaris.c +++ b/coregrind/m_syswrap/syswrap-amd64-solaris.c @@ -233,7 +233,7 @@ void ML_(save_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[2] = VKI_UC_GUEST_CC_DEP1(uc); buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = uc->uc_mcontext.gregs[VKI_REG_RFL]; - checksum = ML_(fletcher64)((UInt*)&buf, sizeof(buf) / sizeof(UInt)); + checksum = ML_(fletcher64)((UInt*)&buf, 2 * sizeof(buf) / sizeof(buf[0])); VKI_UC_GUEST_RFLAGS_CHECKSUM(uc) = checksum; } @@ -439,7 +439,7 @@ void ML_(restore_machine_context)(ThreadId tid, vki_ucontext_t *uc, buf[3] = VKI_UC_GUEST_CC_DEP2(uc); buf[4] = rflags; checksum = ML_(fletcher64)((UInt*)&buf, - sizeof(buf) / sizeof(UInt)); + 2 * sizeof(buf) / sizeof(buf[0])); if (checksum == VKI_UC_GUEST_RFLAGS_CHECKSUM(uc)) { /* Check ok, the full restoration is possible. */ VG_(debugLog)(1, "syswrap-solaris", diff --git a/coregrind/m_syswrap/syswrap-solaris.c b/coregrind/m_syswrap/syswrap-solaris.c index dad70ef857..f43c2f30a9 100644 --- a/coregrind/m_syswrap/syswrap-solaris.c +++ b/coregrind/m_syswrap/syswrap-solaris.c @@ -3930,7 +3930,7 @@ PRE(sys_execve) #if defined(SOLARIS_EXECVE_SYSCALL_TAKES_FLAGS) if (ARG1_is_fd) VG_(message)(Vg_UserMsg, "execve(%ld, %#lx, %#lx, %lu) failed, " - "errno %ld\n", SARG1, ARG2, ARG3, ARG4, ERR); + "errno %lu\n", SARG1, ARG2, ARG3, ARG4, ERR); else VG_(message)(Vg_UserMsg, "execve(%#lx(%s), %#lx, %#lx, %ld) failed, errno" " %lu\n", ARG1, (HChar *) ARG1, ARG2, ARG3, SARG4, ERR); |