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
(19) |
Oct
|
Nov
|
Dec
|
|
From: Floyd, P. <pj...@wa...> - 2023-02-09 17:24:52
|
On 03/02/2023 11:52, Mark Wielaard wrote: > Hi valgrind developers, > > - The macOS port status - do we have any users/developers? Been having a fairly long look at this. Will update on Friday. There has been a lot of noise about memory safety recently. https://media.defense.gov/2022/Nov/10/2003112742/-1/-1/0/CSI_SOFTWARE_MEMORY_SAFETY.PDF https://advocacy.consumerreports.org/wp-content/uploads/2023/01/Memory-Safety-Convening-Report-1-1.pdf And some responses from C++ (I don't follow C standards evolution so closely) https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2739r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2023/p2759r0.pdf https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p2687r0.pdf If they do "fix" C and C++ we might be out of a job ;-) A+ Paul |
|
From: Paul F. <pa...@so...> - 2023-02-08 21:58:10
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=6e4eb0b674db465c9c332ec72b5c7f5202de7d71 commit 6e4eb0b674db465c9c332ec72b5c7f5202de7d71 Author: Paul Floyd <pj...@wa...> Date: Wed Feb 8 22:54:57 2023 +0100 Darwin: try to fix assert in DRD The hard coded memory mapping trigger drd_start_using_mem_w_perms which will lead to tl_assert(vg_tid != VG_INVALID_THREADID); But vg_tid was just set to VG_INVALID_THREADID before the hard coded memory map. Diff: --- coregrind/m_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 0a7e96e500..b5501b5f31 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -2047,10 +2047,6 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True /* executable? */, 0 /* di_handle: no associated debug info */ ); - /* Clear the running thread indicator */ - VG_(running_tid) = VG_INVALID_THREADID; - vg_assert(VG_(running_tid) == VG_INVALID_THREADID); - /* Darwin only: tell the tools where the client's kernel commpage is. It would be better to do this by telling aspacemgr about it -- see the now disused record_system_memory() in @@ -2068,6 +2064,10 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) True, False, True, /* r-x */ 0 /* di_handle: no associated debug info */ ); # endif + + /* Clear the running thread indicator */ + VG_(running_tid) = VG_INVALID_THREADID; + vg_assert(VG_(running_tid) == VG_INVALID_THREADID); } //-------------------------------------------------------------- |
|
From: Paul F. <pa...@so...> - 2023-02-05 11:50:55
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=9fb974c359e127caa930fc2ccf49218778e7c584 commit 9fb974c359e127caa930fc2ccf49218778e7c584 Author: Paul Floyd <pj...@wa...> Date: Sun Feb 5 12:50:13 2023 +0100 Regtest: rationalize filters for new/delete Diff: --- memcheck/tests/Makefile.am | 3 +-- memcheck/tests/filter_sized_delete | 4 ---- memcheck/tests/sized_delete.vgtest | 2 +- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index e5b2ae5863..55eea450b9 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -80,8 +80,7 @@ dist_noinst_SCRIPTS = \ filter_varinfo3 \ filter_memcheck \ filter_overlaperror \ - filter_malloc_free \ - filter_sized_delete + filter_malloc_free noinst_HEADERS = leak.h diff --git a/memcheck/tests/filter_sized_delete b/memcheck/tests/filter_sized_delete deleted file mode 100755 index 54dea76b5d..0000000000 --- a/memcheck/tests/filter_sized_delete +++ /dev/null @@ -1,4 +0,0 @@ -#! /bin/sh - -./filter_stderr "$@" | -grep -v free | grep -v malloc diff --git a/memcheck/tests/sized_delete.vgtest b/memcheck/tests/sized_delete.vgtest index 9f483e01c4..1ad6b68f3a 100644 --- a/memcheck/tests/sized_delete.vgtest +++ b/memcheck/tests/sized_delete.vgtest @@ -1,4 +1,4 @@ prog: sized_delete prereq: test -e sized_delete vgopts: -q "--trace-malloc=yes" --show-mismatched-frees=yes -stderr_filter: filter_sized_delete +stderr_filter: filter_malloc_free |
|
From: Paul F. <pa...@so...> - 2023-02-05 10:36:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=0eb7257254c55a9d9a28194986fa1efd0f96ad87 commit 0eb7257254c55a9d9a28194986fa1efd0f96ad87 Author: Paul Floyd <pj...@wa...> Date: Sun Feb 5 11:35:28 2023 +0100 Darwin regtest: add filtering for zone functions and realloc For test of C++17 new/delete variations Diff: --- memcheck/tests/filter_malloc_free | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/filter_malloc_free b/memcheck/tests/filter_malloc_free index 9d4c52559c..3927792ef0 100755 --- a/memcheck/tests/filter_malloc_free +++ b/memcheck/tests/filter_malloc_free @@ -2,5 +2,5 @@ ./filter_stderr "$@" | ./filter_allocs | -sed -e '/^malloc/d;/^free/d;/^calloc/d' +sed -e '/^malloc/d;/^free/d;/^calloc/d;/^zone/d;/^realloc/d' |
|
From: Paul F. <pa...@so...> - 2023-02-05 10:36:47
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=60303f4316008f0ba9553cb14d6530dfdd3c3760 commit 60303f4316008f0ba9553cb14d6530dfdd3c3760 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:27:39 2023 +0100 DRD regtest: try to make timed_mutex more reliable On RHEL 7.6 ARM I see this with the lock returning false but without the 11 second timeout. Try adding some sleeps. Diff: --- docs/Makefile.am | 1 + docs/internals/Darwin-debug.txt | 62 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/docs/Makefile.am b/docs/Makefile.am index 3850d7b744..f9ba4e3958 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -46,6 +46,7 @@ EXTRA_DIST = \ internals/arm_thumb_notes_gdbserver.txt \ internals/avx-notes.txt \ internals/BIG_APP_NOTES.txt \ + internals/Darwin-debug.txt \ internals/Darwin-notes.txt \ internals/SPEC-notes.txt \ internals/directory-structure.txt \ diff --git a/docs/internals/Darwin-debug.txt b/docs/internals/Darwin-debug.txt new file mode 100644 index 0000000000..5bc9b56633 --- /dev/null +++ b/docs/internals/Darwin-debug.txt @@ -0,0 +1,62 @@ +Some general notes on debugging on macOS +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Written early 2023, based on macOS 13.1 / Darwin 22.2.0 Intel + +If you need to use ssh then you can't use lldb directly because, by default, +it wants to open a dialog for your password/fingerprint. You can disable this +with: + +sudo DevToolsSecurity --enable + +Tracing syscalls looks rather scary and involves rebooting and disabling security. + +Launcher and initimg +~~~~~~~~~~~~~~~~~~~~ + +Things are a bit different on Darwin. Quick reminder for other platforms: + +1. Early command line processing, specifically tool and verbosity +2. Select the platform by looking at the ELF headers. Default + to the build platform if the client is a script and the shebangs + don't lead to an ELF binary. +3. Add VALGRIND_LAUNCHER to the environment. This is based on the path. +4. Get the tool path. This uses either the path baked into the build + by the configure --prefix option (VG_LIBDIR) or the VALGRIND_LIB + environment variable (set by the vg-in-place script for running + in the build directory). +5. exec the tool. + +On Darwin that is + +1. Early command line processing. As above but also the undocumented + --arch option. +2. The client exename can be an app bundle which means expanding + "client" to "client.app/Contents/MacOS/client". +3. Platform detection is complicated by the macOS history of + having dual-platform fat binaries. A list of supported platforms + is considered and compared against the Valgrind install. Then + the mach_header is examined to make the final decision. +4. The additions to the environment variables are also a bit more + complicated. Like on ELF based systems there is VALGRIND_LAUNCHER. + Additionally there is + VALGRIND_STARTUP_PWD_%PID_XYZZY=current_working_dir + which is used to work out the working directory. + Darwin doesn't have a cwd syscall? I wonder how 'pwd' works. + Looks like it does open(.) fstat to check then fcntl(F_GETPATH). + The seems to only matter for %p and %q log filename expansion + and reading any .valgrindrc in the working directory. Not + big problems for debugging. +5. Another slight complication is that dylib environment variables need + protecting. Maybe because the tool is statically linked? In any + case all env vars that start with "DYLD_" get changed to "VYLD_". +6. The tool path is determined along the same lines as ELF. +7. exec the tool. + + +In stage2 on Darwin the "VYLD_" munging is undone. DYLD_INSERT_LIBRARIES +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 +ELF platforms. There is no auxiliary vector (auxv) to construct. |
|
From: Paul F. <pa...@so...> - 2023-02-03 18:29:09
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=add5fe983292106d62196a77c57e9416c26ef1b8 commit add5fe983292106d62196a77c57e9416c26ef1b8 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:27:39 2023 +0100 DRD regtest: try to make timed_mutex more reliable On RHEL 7.6 ARM I see this with the lock returning false but without the 11 second timeout. Try adding some sleeps. Diff: --- drd/tests/timed_mutex.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drd/tests/timed_mutex.cpp b/drd/tests/timed_mutex.cpp index b1bb61efa6..fa7464ea5b 100644 --- a/drd/tests/timed_mutex.cpp +++ b/drd/tests/timed_mutex.cpp @@ -12,16 +12,19 @@ void f() auto now=std::chrono::steady_clock::now(); test_mutex.try_lock_until(now + std::chrono::seconds(11)); --global; + std::this_thread::sleep_for(std::chrono::seconds(1)); test_mutex.unlock(); } - + + int main() { global = 0; + std::thread t(f); + std::this_thread::sleep_for(std::chrono::seconds(1)); auto now=std::chrono::steady_clock::now(); test_mutex.try_lock_until(now + std::chrono::seconds(11)); ++global; - std::thread t(f); test_mutex.unlock(); t.join(); assert(global == 0); |
|
From: Paul F. <pa...@so...> - 2023-02-03 18:12:20
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=dfaf01873391977d2863da0c227a8b363f762019 commit dfaf01873391977d2863da0c227a8b363f762019 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 19:10:50 2023 +0100 DRD regtesat: update suppression file for std_threads2 On RHEL 7.6 ARM glibc 2.17 is used which doesn't match the 2.2* wildard, so widen the wildcard to just 2.* Diff: --- drd/tests/std_thread2.supp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drd/tests/std_thread2.supp b/drd/tests/std_thread2.supp index 2e41bac503..69b210c469 100644 --- a/drd/tests/std_thread2.supp +++ b/drd/tests/std_thread2.supp @@ -11,13 +11,13 @@ { pthread_create drd:ConflictingAccess - fun:pthread_create@@GLIBC_2.2* + fun:pthread_create@@GLIBC_2.* } { pthread_create drd:ConflictingAccess fun:allocate_stack - fun:pthread_create@@GLIBC_2.2* + fun:pthread_create@@GLIBC_2.* } { drd-gcc-runtims |
|
From: Paul F. <pa...@so...> - 2023-02-03 12:52:17
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4c80a467a93fd3e4be04b567fbaae6146b2b23de commit 4c80a467a93fd3e4be04b567fbaae6146b2b23de Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 13:51:04 2023 +0100 FreeBSD: fix internal sysctlbyname I used the libc interface rather than the syscall interface. The syscall also has the name length which libc adds. Diff: --- coregrind/m_libcproc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index 55bb7cbf97..592d69bf13 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -1200,8 +1200,9 @@ void VG_(do_atfork_child)(ThreadId tid) #if defined(VGO_freebsd) Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen) { + vg_assert(name); #if (FREEBSD_VERS >= FREEBSD_12_2) - SysRes res = VG_(do_syscall5)(__NR___sysctlbyname, (UWord)name, (UWord)oldp, (UWord)oldlenp, (UWord)newp, (UWord)newlen); + SysRes res = VG_(do_syscall6)(__NR___sysctlbyname, (RegWord)name, VG_(strlen)(name), (RegWord)oldp, (RegWord)oldlenp, (RegWord)newp, (RegWord)newlen); return sr_isError(res) ? -1 : sr_Res(res); #else Int oid[2]; |
|
From: Paul F. <pa...@so...> - 2023-02-03 12:51:12
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=cdabd4ba74ea653515a1bf9a6e9067f3179c2d54 commit cdabd4ba74ea653515a1bf9a6e9067f3179c2d54 Author: Paul Floyd <pj...@wa...> Date: Fri Feb 3 13:48:22 2023 +0100 Regtest: foix warning from drd test pth_mutex_signal.c GCC on RHEL 7.6 ARM complains about the empty init list. I also noticed that we are using the SA_NOTIFY form of sigaction (with that union member and handler prototype) but not setting the SA_NOTIFY flag. Seems harmless in this case as we don't use the siginfo or context. Diff: --- drd/tests/pth_mutex_signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drd/tests/pth_mutex_signal.c b/drd/tests/pth_mutex_signal.c index 38fafdba8a..916afdfe59 100644 --- a/drd/tests/pth_mutex_signal.c +++ b/drd/tests/pth_mutex_signal.c @@ -42,12 +42,12 @@ int main () pthread_mutexattr_t mutex_attr; pthread_attr_t thread_attr_contender; pthread_t contender; - struct sigaction signalAction = { }; + struct sigaction signalAction; // install signal handler signalAction.sa_sigaction = nullHandler; sigfillset(&signalAction.sa_mask); - signalAction.sa_flags = 0; + signalAction.sa_flags = SA_SIGINFO; sigaction(SIGINT, &signalAction, NULL); // initialize the mutex |
|
From: Mark W. <ma...@kl...> - 2023-02-03 10:53:00
|
Hi valgrind developers, Paul suggested that we should have a developer video chat again to discuss development issues. And I agree that would be a good thing to set some goals for the next release in April. We would like to meet on Friday February 10 at 16:00 UTC (17:00 CET, 11:00 EST). https://meet.jit.si/ValgrindDevMeeting Some issues we can discuss: - Pick a date for the April 3.21.0 release Critical bugs that are must fix? - Upstreaming risc-v - https://github.com/petrpavlu/valgrind-riscv64 - AVX512 status - https://bugs.kde.org/show_bug.cgi?id=383010 - loongarch - https://bugs.kde.org/show_bug.cgi?id=457504 - The macOS port status - do we have any users/developers? - https://bugs.kde.org/show_bug.cgi?id=433859 aligned and sized stuff. Do we have enough bits to track this efficiently? - Plugging into the new FORTIFY_SOURCE=3 support in glibc. valgrind memcheck should be able to show useful information about the memory block that triggered the fault. - Infrastructure stuff. We are still using the sourcefore mailinglist and the kde bugzilla. But our git repo and website are at sourceware. Should we migrate everything to sourceware? - Would that be a good point to switch from "master" to "main" for the main git branch name? We already largely avoid terms like black/whitelist and master/slave in the code and it would be a good transition towards more inclusive language as described in https://inclusivenaming.org/ These are all just suggestions. Please feel free to join and/or propose other topics, features or bugs to discuss. Cheers, Mark |
|
From: Paul F. <pa...@so...> - 2023-02-02 21:08:49
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=7003f40be9de1e10796578cba9e40ea6a548fc16 commit 7003f40be9de1e10796578cba9e40ea6a548fc16 Author: Paul Floyd <pj...@wa...> Date: Thu Feb 2 22:06:38 2023 +0100 FreeBSD: improve internal syscallbyname Post FreeBSD 12.2 this is a syscall that does everything (rather than needing an undocumented syscall). Diff: --- coregrind/m_libcproc.c | 7 ++++++- coregrind/pub_core_libcproc.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/coregrind/m_libcproc.c b/coregrind/m_libcproc.c index b94cabcf1f..55bb7cbf97 100644 --- a/coregrind/m_libcproc.c +++ b/coregrind/m_libcproc.c @@ -1194,12 +1194,16 @@ void VG_(do_atfork_child)(ThreadId tid) } /* --------------------------------------------------------------------- - FreeBSD sysctlbyname(), modfind(), etc + FreeBSD sysctlbyname, getosreldate, is32on64 ------------------------------------------------------------------ */ #if defined(VGO_freebsd) Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen) { +#if (FREEBSD_VERS >= FREEBSD_12_2) + SysRes res = VG_(do_syscall5)(__NR___sysctlbyname, (UWord)name, (UWord)oldp, (UWord)oldlenp, (UWord)newp, (UWord)newlen); + return sr_isError(res) ? -1 : sr_Res(res); +#else Int oid[2]; Int real_oid[10]; SizeT oidlen; @@ -1214,6 +1218,7 @@ Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void oidlen /= sizeof(int); error = VG_(sysctl)(real_oid, oidlen, oldp, oldlenp, newp, newlen); return error; + #endif } Int VG_(getosreldate)(void) diff --git a/coregrind/pub_core_libcproc.h b/coregrind/pub_core_libcproc.h index d63a4f7c47..ff056ec408 100644 --- a/coregrind/pub_core_libcproc.h +++ b/coregrind/pub_core_libcproc.h @@ -86,7 +86,7 @@ extern void VG_(do_atfork_parent) ( ThreadId tid ); extern void VG_(do_atfork_child) ( ThreadId tid ); #if defined(VGO_freebsd) -// sysctl, modfind +// sysctlbyname, getosreldate, is32on64 extern Int VG_(sysctlbyname)(const HChar *name, void *oldp, SizeT *oldlenp, const void *newp, SizeT newlen); extern Int VG_(getosreldate)(void); extern Bool VG_(is32on64)(void); |
|
From: Paul F. <pa...@so...> - 2023-02-02 20:52:41
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a8e350c6d1b2a64e9515d29134b4217bccb62382 commit a8e350c6d1b2a64e9515d29134b4217bccb62382 Author: Paul Floyd <pj...@wa...> Date: Thu Feb 2 21:51:21 2023 +0100 GDB regtest: add filter for gdb python load, RHEL 7.4 ARM Diff: --- gdbserver_tests/filter_vgdb.in | 1 + 1 file changed, 1 insertion(+) diff --git a/gdbserver_tests/filter_vgdb.in b/gdbserver_tests/filter_vgdb.in index c1844e90c0..7c42a1849f 100755 --- a/gdbserver_tests/filter_vgdb.in +++ b/gdbserver_tests/filter_vgdb.in @@ -38,6 +38,7 @@ $SED -e '/warning: Missing auto-load script.*/d' | $SED -e '/of file .*vgpreload.*so.*/d' | $SED -e '/Use.*info auto-load python-scripts.*/d' | $SED -e '/warning: Invalid entry in .debug_gdb_scripts section/d' | +$SED -e "/Use .info auto-load python .REGEXP.. to list them./d" | # and filter out any remaining empty lines $SED -e '/^$/d' |
|
From: Mark W. <ma...@so...> - 2023-02-01 22:54:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=e4c5c764e80db00aabb2e217e1f5ce9856eadae7 commit e4c5c764e80db00aabb2e217e1f5ce9856eadae7 Author: Mark Wielaard <ma...@kl...> Date: Wed Feb 1 23:52:59 2023 +0100 Add valgrind-monitor[-def].py to EXTRA_DIST So as to make sure these get copied into the tarball. Fixes make distcheck. Diff: --- coregrind/Makefile.am | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index dda0689ddf..80115f21fe 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -771,6 +771,8 @@ vglib_DATA += m_gdbserver/valgrind-monitor-def.py # so as to make sure these get copied into the tarball EXTRA_DIST += $(GDBSERVER_XML_FILES) +EXTRA_DIST += m_gdbserver/valgrind-monitor.py +EXTRA_DIST += m_gdbserver/valgrind-monitor-def.py #---------------------------------------------------------------------------- # General stuff |
|
From: Paul F. <pa...@so...> - 2023-02-01 20:48:30
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=fd7daaa5e06d90325dd40be9467da3be694c8c7d commit fd7daaa5e06d90325dd40be9467da3be694c8c7d Author: Paul Floyd <pj...@wa...> Date: Wed Feb 1 21:45:46 2023 +0100 FreeBSD: cleanup launcher cppcheck spotted a bug in the skipping of whitespace between shebang and interpreter command. This could potentially cause the platform to be misidentified (for x86 on amd64). Diff: --- coregrind/launcher-freebsd.c | 72 +++++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 27 deletions(-) diff --git a/coregrind/launcher-freebsd.c b/coregrind/launcher-freebsd.c index 7d40ad6cce..792a4bd239 100644 --- a/coregrind/launcher-freebsd.c +++ b/coregrind/launcher-freebsd.c @@ -45,6 +45,7 @@ #include <sys/sysctl.h> /* #include <sys/user.h> */ #include <unistd.h> +#include <limits.h> #include "pub_core_debuglog.h" #include "pub_core_vki.h" // Avoids warnings from @@ -52,12 +53,6 @@ #include "pub_core_libcproc.h" // For VALGRIND_LIB, VALGRIND_LAUNCHER #include "pub_core_ume.h" - -#if !defined(PATH_MAX) -#define PATH_MAX 4096 /* POSIX refers to this a lot but I dunno - where it is defined */ -#endif - #ifndef EM_X86_64 #define EM_X86_64 62 // elf.h doesn't define this on some older systems #endif @@ -99,8 +94,9 @@ static const char *find_client(const char *clientname) strcat(fullname, "/"); strcat(fullname, clientname); - if (access(fullname, R_OK|X_OK) == 0) + if (access(fullname, R_OK|X_OK) == 0) { return fullname; + } } return clientname; @@ -116,11 +112,13 @@ static const char *select_platform(const char *clientname) VG_(debugLog)(2, "launcher", "selecting platform for '%s'\n", clientname); - if (strchr(clientname, '/') == NULL) + if (strchr(clientname, '/') == NULL) { clientname = find_client(clientname); + } - if ((fd = open(clientname, O_RDONLY)) < 0) + if ((fd = open(clientname, O_RDONLY)) < 0) { return NULL; + } // barf("open(%s): %s", clientname, strerror(errno)); n_bytes = read(fd, header, sizeof(header)); @@ -135,19 +133,29 @@ static const char *select_platform(const char *clientname) // Skip whitespace. while (1) { - if (i == n_bytes) return NULL; - if (' ' != header[i] && '\t' == header[i]) break; + if (i == n_bytes) { + return NULL; + } + if (' ' != header[i] && '\t' != header[i]) { + break; + } i++; } // Get the interpreter name. interp = &header[i]; while (1) { - if (i == n_bytes) break; - if (isspace(header[i])) break; + if (i == n_bytes) { + break; + } + if (isspace(header[i])) { + break; + } i++; } - if (i == n_bytes) return NULL; + if (i == n_bytes) { + return NULL; + } header[i] = '\0'; platform = select_platform(interp); @@ -209,14 +217,17 @@ int main(int argc, char** argv, char** envp) break; } if (0 == strcmp(argv[i], "--")) { - if (i+1 < argc) + if (i+1 < argc) { clientname = argv[i+1]; + } break; } - if (0 == strcmp(argv[i], "-d")) + if (0 == strcmp(argv[i], "-d")) { loglevel++; - if (0 == strncmp(argv[i], "--tool=", 7)) + } + if (0 == strncmp(argv[i], "--tool=", 7)) { toolname = argv[i] + 7; + } } /* ... and start the debug logger. Now we can safely emit logging @@ -241,12 +252,13 @@ int main(int argc, char** argv, char** envp) target, because on most ppc64-linux setups, the basic /bin, /usr/bin, etc, stuff is built in 32-bit mode, not 64-bit mode. */ - if (0==strcmp(VG_PLATFORM,"x86-freebsd")) + if (0==strcmp(VG_PLATFORM,"x86-freebsd")) { default_platform = "x86-freebsd"; - else if (0==strcmp(VG_PLATFORM,"amd64-freebsd")) + } else if (0==strcmp(VG_PLATFORM,"amd64-freebsd")) { default_platform = "amd64-freebsd"; - else + } else { barf("Unknown VG_PLATFORM '%s'", VG_PLATFORM); + } /* Work out what platform to use, or use the default platform if not possible. */ @@ -285,19 +297,23 @@ int main(int argc, char** argv, char** envp) /* tediously augment the env: VALGRIND_LAUNCHER=launcher_name */ new_line = malloc(strlen(VALGRIND_LAUNCHER) + 1 + strlen(launcher_name) + 1); - if (new_line == NULL) + if (new_line == NULL) { barf("malloc of new_line failed."); + } strcpy(new_line, VALGRIND_LAUNCHER); strcat(new_line, "="); strcat(new_line, launcher_name); - for (j = 0; envp[j]; j++) - ; + for (j = 0; envp[j]; j++) { + // do nothing + } new_env = malloc((j+2) * sizeof(char*)); - if (new_env == NULL) + if (new_env == NULL) { barf("malloc of new_env failed."); - for (i = 0; i < j; i++) + } + for (i = 0; i < j; i++) { new_env[i] = envp[i]; + } new_env[i++] = new_line; new_env[i++] = NULL; assert(i == j+2); @@ -305,13 +321,15 @@ int main(int argc, char** argv, char** envp) /* Establish the correct VALGRIND_LIB. */ cp = getenv(VALGRIND_LIB); - if (cp != NULL) + if (cp != NULL) { valgrind_lib = cp; + } /* Build the stage2 invocation, and execve it. Bye! */ toolfile = malloc(strlen(valgrind_lib) + strlen(toolname) + strlen(platform) + 3); - if (toolfile == NULL) + if (toolfile == NULL) { barf("malloc of toolfile failed."); + } sprintf(toolfile, "%s/%s-%s", valgrind_lib, toolname, platform); VG_(debugLog)(1, "launcher", "launching %s\n", toolfile); |
|
From: Paul F. <pa...@so...> - 2023-02-01 20:48:23
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=bca6837b1525a5abfde593019ddf489620d92153 commit bca6837b1525a5abfde593019ddf489620d92153 Author: Paul Floyd <pj...@wa...> Date: Wed Feb 1 21:44:31 2023 +0100 Pack Lackey Event structure Seen by cppcheck. Will reduced size from 4 to 3 words on 64bit platforms. Diff: --- lackey/lk_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lackey/lk_main.c b/lackey/lk_main.c index e19b39f16f..8ee62a78bb 100644 --- a/lackey/lk_main.c +++ b/lackey/lk_main.c @@ -408,8 +408,8 @@ typedef typedef struct { - EventKind ekind; IRAtom* addr; + EventKind ekind; Int size; IRAtom* guard; /* :: Ity_I1, or NULL=="always True" */ } |
|
From: Paul F. <pa...@so...> - 2023-01-31 21:01:28
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=b1aba91160c53326eb3b41e8fd6c9a5c00902b24 commit b1aba91160c53326eb3b41e8fd6c9a5c00902b24 Author: Paul Floyd <pj...@wa...> Date: Tue Jan 31 21:52:36 2023 +0100 FreeBSD: cleanup and refactor syscalls readlink and readlinkat There was some code to handle /proc/curproc/file (a symlink to the exe that wee need to bodge as it refers to the tool exe). But it was neither tested nor working. Can't use the same technique as Linux and Solaris which have more complete /proc filesystems where each pid has symlinks for each open file, which we use for the guest. Instead need to copy the path ourselves. So move sys_readlink out of generic. Simplify the handling of the resolved guest exe name - store it in a global like VG_(args_the_exename). Diff: --- .gitignore | 1 + coregrind/m_clientstate.c | 4 ++ coregrind/m_initimg/initimg-freebsd.c | 22 ++++---- coregrind/m_main.c | 7 +++ coregrind/m_syswrap/priv_syswrap-freebsd.h | 2 +- coregrind/m_syswrap/syswrap-freebsd.c | 78 ++++++++++++++++++++++------- include/pub_tool_clientstate.h | 1 + none/tests/freebsd/Makefile.am | 9 +++- none/tests/freebsd/proc_pid_file.cpp | 27 ++++++++++ none/tests/freebsd/proc_pid_file.stderr.exp | 0 none/tests/freebsd/proc_pid_file.vgtest | 3 ++ 11 files changed, 125 insertions(+), 29 deletions(-) diff --git a/.gitignore b/.gitignore index ae71cbbbdd..cc6b189b4b 100644 --- a/.gitignore +++ b/.gitignore @@ -2101,6 +2101,7 @@ /none/tests/freebsd/hello_world /none/tests/freebsd/452275 /none/tests/freebsd/usrstack +/none/tests/freebsd/proc_pid_file # /none/tests/x86/ /none/tests/x86/*.dSYM diff --git a/coregrind/m_clientstate.c b/coregrind/m_clientstate.c index 7b343f27a5..404a60f372 100644 --- a/coregrind/m_clientstate.c +++ b/coregrind/m_clientstate.c @@ -93,6 +93,10 @@ Int VG_(args_for_valgrind_noexecpass) = 0; line. */ const HChar* VG_(args_the_exename) = NULL; +/* The real name of the executable, with resolved + * relative paths and symlinks */ +const HChar* VG_(resolved_exename) = NULL; + // Client's original rlimit data and rlimit stack struct vki_rlimit VG_(client_rlimit_data); struct vki_rlimit VG_(client_rlimit_stack); diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index 22c210cdeb..53a9aca873 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -362,8 +362,7 @@ static HChar *copy_bytes(HChar **tab, const HChar *src, SizeT size) ---------------------------------------------------------------- */ -static -struct auxv *find_auxv(UWord* sp) +static struct auxv *find_auxv(UWord* sp) { sp++; // skip argc (Nb: is word-sized, not int-sized!) @@ -380,13 +379,12 @@ struct auxv *find_auxv(UWord* sp) return (struct auxv *)sp; } -static -Addr setup_client_stack( void* init_sp, - HChar** orig_envp, - const ExeInfo* info, - UInt** client_auxv, - Addr clstack_end, - SizeT clstack_max_size ) +static Addr setup_client_stack(void* init_sp, + HChar** orig_envp, + const ExeInfo* info, + UInt** client_auxv, + Addr clstack_end, + SizeT clstack_max_size ) { SysRes res; HChar **cpp; @@ -690,6 +688,7 @@ Addr setup_client_stack( void* init_sp, case VKI_AT_EXECPATH: auxv->u.a_ptr = copy_str(&strtab, resolved_name); + VG_(resolved_exename) = auxv->u.a_ptr; break; case VKI_AT_CANARY: if (canarylen >= 1) { @@ -795,6 +794,11 @@ Addr setup_client_stack( void* init_sp, if (0) { VG_(printf)("startup SP = %#lx\n", client_SP); } + + if (VG_(resolved_exename) == NULL) { + VG_(resolved_exename) = VG_(strdup)("initimg-freebsd.sre.1", resolved_name); + } + return client_SP; } diff --git a/coregrind/m_main.c b/coregrind/m_main.c index 4316e625fa..0a7e96e500 100644 --- a/coregrind/m_main.c +++ b/coregrind/m_main.c @@ -1724,6 +1724,13 @@ Int valgrind_main ( Int argc, HChar **argv, HChar **envp ) if (!sr_isError(statres) || VKI_S_ISLNK(statbuf.mode)) { VG_(have_slash_proc) = True; } + // each directory contains the following that might get read + // file - a symlink to the exe + // cmdline - null separate command line + // etype - the executable type e.g., FreeBSD ELF64 (same for guest and host) + // map - a memory map, tricky to synthesize + // rlimit - list of process limits + // status - process, pid, ppid pts cty uid gid and some other stuff } #endif diff --git a/coregrind/m_syswrap/priv_syswrap-freebsd.h b/coregrind/m_syswrap/priv_syswrap-freebsd.h index dd065c6f58..8822f22f21 100644 --- a/coregrind/m_syswrap/priv_syswrap-freebsd.h +++ b/coregrind/m_syswrap/priv_syswrap-freebsd.h @@ -90,7 +90,7 @@ DECL_TEMPLATE(freebsd, sys_ioctl) // 54 DECL_TEMPLATE(freebsd, sys_reboot) // 55 DECL_TEMPLATE(freebsd, sys_revoke) // 56 // generic symlink 57 -// generic readlink 58 +DECL_TEMPLATE(freebsd, sys_readlink) // 58 // generic execve 59 // generic umask 60 // generic chroot 61 diff --git a/coregrind/m_syswrap/syswrap-freebsd.c b/coregrind/m_syswrap/syswrap-freebsd.c index 13d3b6bf25..1ab63ba491 100644 --- a/coregrind/m_syswrap/syswrap-freebsd.c +++ b/coregrind/m_syswrap/syswrap-freebsd.c @@ -1139,8 +1139,52 @@ PRE(sys_revoke) // SYS_symlink 57 // generic +static void do_readlink(const HChar* path, HChar *buf, SizeT bufsize, SyscallStatus* status, Bool* curproc_file) +{ + HChar name[30]; + VG_(sprintf)(name, "/proc/%d/file", VG_(getpid)()); + if (ML_(safe_to_deref)(path, 1) + && (VG_(strcmp)(path, name) == 0 + || VG_(strcmp)(path, "/proc/curproc/file") == 0)) { + vg_assert(VG_(resolved_exename)); + Int len = VG_(snprintf)(buf, bufsize, "%s", VG_(resolved_exename)); + SET_STATUS_Success(len); + *curproc_file = True; + } +} + // SYS_readlink 58 -// generic +// ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsiz); +PRE(sys_readlink) +{ + FUSE_COMPATIBLE_MAY_BLOCK(); + Word saved = SYSNO; + Bool curproc_file = False; + + PRINT("sys_readlink ( %#" FMT_REGWORD "x(%s), %#" FMT_REGWORD "x, %llu )", + ARG1, (char*)(Addr)ARG1, ARG2, (ULong)ARG3); + PRE_REG_READ3(long, "readlink", + const char *, path, char *, buf, int, bufsiz); + PRE_MEM_RASCIIZ( "readlink(path)", ARG1 ); + PRE_MEM_WRITE( "readlink(buf)", ARG2,ARG3 ); + + if (VG_(have_slash_proc) == True) + { + /* + * Handle the case where readlink is looking at /proc/curproc/file or + * /proc/<pid>/file + */ + do_readlink((const HChar *)ARG1, (HChar *)ARG2, (SizeT)ARG3, status, &curproc_file); + } + + if (!curproc_file) { + /* Normal case */ + SET_STATUS_from_SysRes( VG_(do_syscall3)(saved, ARG1, ARG2, ARG3)); + } + if (SUCCESS && RES > 0) { + POST_MEM_WRITE( ARG2, RES ); + } +} // SYS_execve 59 // generic @@ -1941,8 +1985,7 @@ static void sysctl_kern_usrstack(SizeT* out, SizeT* outlen) static Bool sysctl_kern_proc_pathname(HChar *out, SizeT *len) { - // is this stashed somewhere? - const HChar *exe_name = VG_(find_executable)(VG_(args_the_exename)); + const HChar *exe_name = VG_(resolved_exename); if (!VG_(realpath)(exe_name, out)) { return False; @@ -5325,8 +5368,8 @@ POST(sys_openat) // size_t bufsize); PRE(sys_readlinkat) { - HChar name[25]; Word saved = SYSNO; + Bool curproc_file = False; PRINT("sys_readlinkat ( %" FMT_REGWORD "u, %#" FMT_REGWORD "x(%s), %#" FMT_REGWORD "x, %llu )", ARG1,ARG2,(char*)ARG2,ARG3,(ULong)ARG4); PRE_REG_READ4(ssize_t, "readlinkat", @@ -5334,23 +5377,24 @@ PRE(sys_readlinkat) PRE_MEM_RASCIIZ( "readlinkat(path)", ARG2 ); PRE_MEM_WRITE( "readlinkat(buf)", ARG3,ARG4 ); - if (VG_(have_slash_proc) == True) { + if (VG_(have_slash_proc) == True && (Int)ARG1 == VKI_AT_FDCWD) { /* * Handle the case where readlinkat is looking at /proc/curproc/file or * /proc/<pid>/file. */ - VG_(sprintf)(name, "/proc/%d/file", VG_(getpid)()); - if (ML_(safe_to_deref)((void*)ARG2, 1) - && (VG_(strcmp)((HChar *)ARG2, name) == 0 - || VG_(strcmp)((HChar *)ARG2, "/proc/curproc/file") == 0)) { - VG_(sprintf)(name, "/proc/curproc/fd/%d", VG_(cl_exec_fd)); - SET_STATUS_from_SysRes( VG_(do_syscall4)(saved, ARG1, (UWord)name, - ARG3, ARG4)); - return; - } + do_readlink((const HChar *)ARG2, (HChar *)ARG3, (SizeT)ARG4, status, &curproc_file); + } + + // @todo PJF there is still the case where fd refers to /proc or /proc/pid + // or /proc/curproc and path is relative pid/file, curptoc/file or just file + + if (!curproc_file) { + /* Normal case */ + SET_STATUS_from_SysRes( VG_(do_syscall4)(saved, ARG1, ARG2, ARG3, ARG4)); + } + if (SUCCESS && RES > 0) { + POST_MEM_WRITE( ARG3, RES ); } - /* Normal case */ - SET_STATUS_from_SysRes( VG_(do_syscall4)(saved, ARG1, ARG2, ARG3, ARG4)); } POST(sys_readlinkat) @@ -6696,7 +6740,7 @@ const SyscallTableEntry ML_(syscall_table)[] = { BSDX_(__NR_revoke, sys_revoke), // 56 GENX_(__NR_symlink, sys_symlink), // 57 - GENX_(__NR_readlink, sys_readlink), // 58 + BSDX_(__NR_readlink, sys_readlink), // 58 GENX_(__NR_execve, sys_execve), // 59 GENX_(__NR_umask, sys_umask), // 60 diff --git a/include/pub_tool_clientstate.h b/include/pub_tool_clientstate.h index 556ab03dd5..e25a59702a 100644 --- a/include/pub_tool_clientstate.h +++ b/include/pub_tool_clientstate.h @@ -63,6 +63,7 @@ extern Int VG_(args_for_valgrind_noexecpass); line. */ extern const HChar* VG_(args_the_exename); +extern const HChar* VG_(resolved_exename); #endif // __PUB_TOOL_CLIENTSTATE_H diff --git a/none/tests/freebsd/Makefile.am b/none/tests/freebsd/Makefile.am index 5fe5de3627..f956078d68 100644 --- a/none/tests/freebsd/Makefile.am +++ b/none/tests/freebsd/Makefile.am @@ -35,10 +35,13 @@ EXTRA_DIST = \ 452275.stderr.exp \ usrstack.vgtest \ usrstack.stderr.exp \ - usrstack.stdout.exp + usrstack.stdout.exp \ + proc_pid_file.vgtest \ + proc_pid_file.stderr.exp check_PROGRAMS = \ - auxv osrel swapcontext hello_world fexecve 452275 usrstack + auxv osrel swapcontext hello_world fexecve 452275 usrstack \ + proc_pid_file AM_CFLAGS += $(AM_FLAG_M3264_PRI) AM_CXXFLAGS += $(AM_FLAG_M3264_PRI) @@ -48,3 +51,5 @@ osrel_CFLAGS = ${AM_CFLAGS} swapcontext_CFLAGS = ${AM_CFLAGS} hello_world_SOURCES = hello_world.cpp + +proc_pid_file_SOURCES = proc_pid_file.cpp diff --git a/none/tests/freebsd/proc_pid_file.cpp b/none/tests/freebsd/proc_pid_file.cpp new file mode 100644 index 0000000000..cf9d185381 --- /dev/null +++ b/none/tests/freebsd/proc_pid_file.cpp @@ -0,0 +1,27 @@ +#include <iostream> +//#include <fstream> +#include <string> +//#include <cstdlib> +#include <unistd.h> +#include <fcntl.h> +#include <cassert> + +int main() +{ + char resolvedPath[PATH_MAX]; + auto count = readlink("/proc/curproc/file", resolvedPath, PATH_MAX); + resolvedPath[count] = '\0'; + //std::cout << "resolvedPath: " << resolvedPath << '\n'; + char resolvedPath2[PATH_MAX]; + auto count2 = readlinkat(AT_FDCWD, "/proc/curproc/file", resolvedPath2, PATH_MAX); + resolvedPath2[count2] = '\0'; + //std::cout << "resolvedPath2: " << resolvedPath2 << '\n'; + std::string rp(resolvedPath); + assert(rp == resolvedPath2); + + auto n = rp.rfind("proc_pid_file"); + + std::string filename(rp.substr(n)); + //std::cout << "filename: " << filename << '\n'; + assert(filename == "proc_pid_file"); +} diff --git a/none/tests/freebsd/proc_pid_file.stderr.exp b/none/tests/freebsd/proc_pid_file.stderr.exp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/none/tests/freebsd/proc_pid_file.vgtest b/none/tests/freebsd/proc_pid_file.vgtest new file mode 100644 index 0000000000..0361a5982b --- /dev/null +++ b/none/tests/freebsd/proc_pid_file.vgtest @@ -0,0 +1,3 @@ +prog: proc_pid_file +vgopts: -q + |
|
From: Paul F. <pj...@wa...> - 2023-01-30 21:33:13
|
On 30-01-23 22:20, Philippe Waroquiers wrote:
> What is the problem/error message/.... ?
<inline asm>:1:14: error: mach-o section specifier uses an unknown
section type
.pushsection ".debug_gdb_scripts", "MS",@progbits,1
^
<inline asm>:4:13: error: .popsection without corresponding .pushsection
.popsection
This is macOS, so it's mach-o rather than ELF object format.
I tried to search to see if there is an equivalent, but couldn't find
anything. I don't think that gdb gets much use on macOS these days,
mostly lldb under XCode.
A+
Paul
|
|
From: Philippe W. <phi...@sk...> - 2023-01-30 21:20:36
|
What is the problem/error message/.... ? On Sun, 2023-01-29 at 16:35 +0000, Paul Floyd wrote: > https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=ea733f262e37ae691d27122b534a141fc6854ba8 > > commit ea733f262e37ae691d27122b534a141fc6854ba8 > Author: Paul Floyd <pj...@wa...> > Date: Sun Jan 29 17:35:08 2023 +0100 > > macOS: Try to fix build, doesn't like .debug_gdb_scripts > > Diff: > --- > coregrind/vg_preloaded.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/coregrind/vg_preloaded.c b/coregrind/vg_preloaded.c > index 75a3b7ed0c..d6e05898c9 100644 > --- a/coregrind/vg_preloaded.c > +++ b/coregrind/vg_preloaded.c > @@ -49,6 +49,7 @@ > #include <features.h> > #endif > > > +#if !defined(VGO_darwin) > /* Instruct GDB via a .debug_gdb_scripts section to load the valgrind and tool > front-end commands. */ > /* Note: The "MS" section flags are to remove duplicates. */ > @@ -61,6 +62,7 @@ > "); > > > DEFINE_GDB_PY_SCRIPT(VG_LIBDIR "/valgrind-monitor.py") > +#endif > > > #if defined(VGO_linux) || defined(VGO_solaris) || defined(VGO_freebsd) > > > _______________________________________________ > Valgrind-developers mailing list > Val...@li... > https://lists.sourceforge.net/lists/listinfo/valgrind-developers |
|
From: Mark W. <ma...@kl...> - 2023-01-30 20:14:37
|
We've received word from our data centre hosts that they will have a network infrastructure outage tomorrow, Tuesday 2023-01-31, between 8am and 12am EST (UTC-5). We may follow that up with a server firmware-related update/boot. This impacts sourceware.org, builder.sourceware.org, patchwork.sourceware.org, inbox.sourceware.org, valgrind.org, elfutils.org, cygwin.com and gcc.gnu.org, which all may be unreachable for a couple of hours. Note that there are read-only mirrors of the git repositories at https://sr.ht/~sourceware/ if you need access during the outage. Please feel free to hang out at irc.libera.chat #overseers to follow the current status. |
|
From: Paul F. <pa...@so...> - 2023-01-30 20:13:53
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=a4e5942b32427ca2c22da2c19263fd6d26e039ef commit a4e5942b32427ca2c22da2c19263fd6d26e039ef Author: Paul Floyd <pj...@wa...> Date: Mon Jan 30 21:13:13 2023 +0100 Remove warning caused by D demangle testcase Diff: --- memcheck/tests/Makefile.am | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 1be744ebac..e5b2ae5863 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -466,6 +466,7 @@ check_PROGRAMS += dw4 endif bug464969_d_demangle_SOURCES = bug464969_d_demangle.cpp +bug464969_d_demangle_CXXFLAGS = $(AM_CXXFLAGS) @FLAG_W_NO_UNINITIALIZED@ if GZ_ZLIB check_PROGRAMS += cdebug_zlib @@ -526,12 +527,12 @@ leak_cpp_interior_SOURCES = leak_cpp_interior.cpp # Suppress various gcc warnings which are correct, but for things # we are actually testing for at runtime. accounting_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than -badfree_CFLAGS = $(AM_CFLAGS) -Wno-free-nonheap-object +badfree_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_FREE_NONHEAP_OBJECT@ bug155125_CFLAGS = $(AM_CFLAGS) -Wno-unused-result -Wno-alloc-size-larger-than mallinfo_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations malloc3_CFLAGS = $(AM_CFLAGS) -Wno-alloc-size-larger-than sbfragment_CFLAGS = $(AM_CFLAGS) -Wno-deprecated-declarations -strchr_CFLAGS = $(AM_CFLAGS) -Wno-uninitialized +strchr_CFLAGS = $(AM_CFLAGS) @FLAG_W_NO_UNINITIALIZED@ big_debuginfo_symbol_SOURCES = big_debuginfo_symbol.cpp big_debuginfo_symbol_CXXFLAGS = $(AM_CXXFLAGS) -std=c++0x |
|
From: Mark W. <ma...@so...> - 2023-01-30 09:32:02
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=42d35e6d2ad7e83414e82a691956777064106624 commit 42d35e6d2ad7e83414e82a691956777064106624 Author: Mark Wielaard <ma...@kl...> Date: Mon Jan 30 10:21:01 2023 +0100 bug464969_d_demangle.cpp: Always print "Xa" bug464969_d_demangle depends on producing an error about an uninitialized variable. But it prints something different to stdout based on the value of that variable. Which can produce failures. Make sure to always print the same thing to stdout. Diff: --- memcheck/tests/bug464969_d_demangle.cpp | 4 ++-- memcheck/tests/bug464969_d_demangle.stdout.exp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/memcheck/tests/bug464969_d_demangle.cpp b/memcheck/tests/bug464969_d_demangle.cpp index b66c79b387..00155ce048 100644 --- a/memcheck/tests/bug464969_d_demangle.cpp +++ b/memcheck/tests/bug464969_d_demangle.cpp @@ -4,9 +4,9 @@ extern "C" void _D4test4findFiPxaZPxa() { int a; if (a) - std::cout << "a\n"; + std::cout << "Xa\n"; else - std::cout << "!a\n"; + std::cout << "X" << "a\n"; } int main() diff --git a/memcheck/tests/bug464969_d_demangle.stdout.exp b/memcheck/tests/bug464969_d_demangle.stdout.exp index 60fc874768..987e3267a0 100644 --- a/memcheck/tests/bug464969_d_demangle.stdout.exp +++ b/memcheck/tests/bug464969_d_demangle.stdout.exp @@ -1 +1 @@ -!a +Xa |
|
From: Bart V. A. <bva...@so...> - 2023-01-29 23:42:14
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=4978c9f65742ced9cce4732bf4da40bc7324a8e4 commit 4978c9f65742ced9cce4732bf4da40bc7324a8e4 Author: Bart Van Assche <bva...@ac...> Date: Sun Jan 29 14:42:17 2023 -0800 drd/tests/pth_mutex_signal: Port to Darwin This patch includes a revert of commit 2e873534bb49 ("macOS: drd pth_mutex_signal test doesn't build"). Diff: --- drd/tests/Makefile.am | 5 +---- drd/tests/pth_mutex_signal.c | 17 +++++++++++++---- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index 157bedcf48..e3366a18a0 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -418,6 +418,7 @@ check_PROGRAMS = \ pth_detached3 \ pth_inconsistent_cond_wait \ pth_mutex_reinit \ + pth_mutex_signal \ pth_process_shared_mutex \ recursive_mutex \ rwlock_race \ @@ -502,10 +503,6 @@ if HAVE_PTHREAD_CREATE_GLIBC_2_0 check_PROGRAMS += pth_create_glibc_2_0 endif -if !VGCONF_OS_IS_DARWIN -check_PROGRAMS += pth_mutex_signal -endif - if HAVE_PTHREAD_SPINLOCK check_PROGRAMS += pth_spinlock endif diff --git a/drd/tests/pth_mutex_signal.c b/drd/tests/pth_mutex_signal.c index ec74696953..38fafdba8a 100644 --- a/drd/tests/pth_mutex_signal.c +++ b/drd/tests/pth_mutex_signal.c @@ -1,4 +1,6 @@ /* + * Verify that pthread_mutex_lock() is not interrupted by a signal. + * * See also https://bugs.kde.org/show_bug.cgi?id=445743. */ @@ -11,7 +13,6 @@ #include <unistd.h> #define STACK_SIZE 1024 * 512 -#define NATIVE_IO_INTERRUPT_SIGNAL (SIGRTMAX - 2) #define LONG_SLEEP_TIME 1000000 void *contender_start(void *arg) @@ -47,7 +48,7 @@ int main () signalAction.sa_sigaction = nullHandler; sigfillset(&signalAction.sa_mask); signalAction.sa_flags = 0; - sigaction(NATIVE_IO_INTERRUPT_SIGNAL, &signalAction, NULL); + sigaction(SIGINT, &signalAction, NULL); // initialize the mutex pthread_mutexattr_init(&mutex_attr); @@ -70,14 +71,22 @@ int main () } fprintf(stderr, "thread created\n"); pthread_attr_destroy(&thread_attr_contender); - + + // Block signals in the current thread such that signals are delivered to the + // 'contender' thread. + { + sigset_t mask; + sigfillset(&mask); + pthread_sigmask(SIG_BLOCK, &mask, NULL); + } + // wait until the thread is sleeping inside pthread_mutex_lock(). fprintf(stderr, "sleeping\n"); usleep(LONG_SLEEP_TIME); // signal thread fprintf(stderr, "signalling\n"); - pthread_kill(contender, NATIVE_IO_INTERRUPT_SIGNAL); + pthread_kill(contender, SIGINT); fprintf(stderr, "sleeping\n"); usleep(LONG_SLEEP_TIME); |
|
From: Paul F. <pa...@so...> - 2023-01-29 21:08:52
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=82282a6676a5c1b3784fd22fc097a0076dfcb7ca commit 82282a6676a5c1b3784fd22fc097a0076dfcb7ca Author: Paul Floyd <pj...@wa...> Date: Sun Jan 29 22:05:27 2023 +0100 Bug 464969 - D language demangling Patch from wit...@gm... (also added a testcase) Diff: --- .gitignore | 1 + NEWS | 1 + coregrind/m_demangle/demangle.c | 10 ++++++++-- memcheck/tests/Makefile.am | 5 +++++ memcheck/tests/bug464969_d_demangle.cpp | 17 +++++++++++++++++ memcheck/tests/bug464969_d_demangle.stderr.exp | 4 ++++ memcheck/tests/bug464969_d_demangle.stdout.exp | 1 + memcheck/tests/bug464969_d_demangle.vgtest | 2 ++ 8 files changed, 39 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b6c2852345..ae71cbbbdd 100644 --- a/.gitignore +++ b/.gitignore @@ -839,6 +839,7 @@ /memcheck/tests/bug155125 /memcheck/tests/bug287260 /memcheck/tests/bug340392 +/memcheck/tests/bug464969_d_demangle /memcheck/tests/calloc-overflow /memcheck/tests/cdebug_zlib /memcheck/tests/cdebug_zlib_gnu diff --git a/NEWS b/NEWS index 7990a8a56f..5e61efbbfe 100644 --- a/NEWS +++ b/NEWS @@ -93,6 +93,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 463027 broken check for MPX instruction support in assembler 464476 Firefox fails to start under Valgrind 464859 Build failures with GCC-13 (drd tsan_unittest) +464969 D language demangling To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_demangle/demangle.c b/coregrind/m_demangle/demangle.c index 3fd7cb75f5..a4031dc8ac 100644 --- a/coregrind/m_demangle/demangle.c +++ b/coregrind/m_demangle/demangle.c @@ -121,10 +121,12 @@ void VG_(demangle) ( Bool do_cxx_demangling, Bool do_z_demangling, // - C++ mangled symbols start with "_Z" (possibly with exceptions?) // - Rust "legacy" mangled symbols start with "_Z". // - Rust "v0" mangled symbols start with "_R". + // - D programming language mangled symbols start with "_D". // XXX: the Java/Rust/Ada demangling here probably doesn't work. See // https://bugs.kde.org/show_bug.cgi?id=445235 for details. if (do_cxx_demangling && VG_(clo_demangle) - && orig != NULL && orig[0] == '_' && (orig[1] == 'Z' || orig[1] == 'R')) { + && orig != NULL && orig[0] == '_' + && (orig[1] == 'Z' || orig[1] == 'R' || orig[1] == 'D')) { /* !!! vvv STATIC vvv !!! */ static HChar* demangled = NULL; /* !!! ^^^ STATIC ^^^ !!! */ @@ -134,7 +136,11 @@ void VG_(demangle) ( Bool do_cxx_demangling, Bool do_z_demangling, VG_(arena_free) (VG_AR_DEMANGLE, demangled); demangled = NULL; } - demangled = ML_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS ); + if (orig[1] == 'D') { + demangled = dlang_demangle ( orig, DMGL_ANSI | DMGL_PARAMS ); + } else { + demangled = ML_(cplus_demangle) ( orig, DMGL_ANSI | DMGL_PARAMS ); + } *result = (demangled == NULL) ? orig : demangled; } else { diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index aa936ac05e..1be744ebac 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -114,6 +114,8 @@ EXTRA_DIST = \ bug155125.stderr.exp bug155125.vgtest \ bug287260.stderr.exp bug287260.vgtest \ bug340392.stderr.exp bug340392.vgtest \ + bug464969_d_demangle.stderr.exp bug464969_d_demangle.vgtest \ + bug464969_d_demangle.stdout.exp \ calloc-overflow.stderr.exp calloc-overflow.vgtest\ cdebug_zlib.stderr.exp cdebug_zlib.vgtest \ cdebug_zlib_gnu.stderr.exp cdebug_zlib_gnu.vgtest \ @@ -381,6 +383,7 @@ check_PROGRAMS = \ bug155125 \ bug287260 \ bug340392 \ + bug464969_d_demangle \ calloc-overflow \ client-msg \ clientperm \ @@ -462,6 +465,8 @@ if DWARF4 check_PROGRAMS += dw4 endif +bug464969_d_demangle_SOURCES = bug464969_d_demangle.cpp + if GZ_ZLIB check_PROGRAMS += cdebug_zlib cdebug_zlib_SOURCES = cdebug.c diff --git a/memcheck/tests/bug464969_d_demangle.cpp b/memcheck/tests/bug464969_d_demangle.cpp new file mode 100644 index 0000000000..b66c79b387 --- /dev/null +++ b/memcheck/tests/bug464969_d_demangle.cpp @@ -0,0 +1,17 @@ +#include <iostream> + +extern "C" void _D4test4findFiPxaZPxa() +{ + int a; + if (a) + std::cout << "a\n"; + else + std::cout << "!a\n"; +} + +int main() +{ + _D4test4findFiPxaZPxa(); +} + + diff --git a/memcheck/tests/bug464969_d_demangle.stderr.exp b/memcheck/tests/bug464969_d_demangle.stderr.exp new file mode 100644 index 0000000000..e2c5b0b254 --- /dev/null +++ b/memcheck/tests/bug464969_d_demangle.stderr.exp @@ -0,0 +1,4 @@ +Conditional jump or move depends on uninitialised value(s) + at 0x........: test.find(int, const(char)*) (bug464969_d_demangle.cpp:6) + by 0x........: main (bug464969_d_demangle.cpp:14) + diff --git a/memcheck/tests/bug464969_d_demangle.stdout.exp b/memcheck/tests/bug464969_d_demangle.stdout.exp new file mode 100644 index 0000000000..60fc874768 --- /dev/null +++ b/memcheck/tests/bug464969_d_demangle.stdout.exp @@ -0,0 +1 @@ +!a diff --git a/memcheck/tests/bug464969_d_demangle.vgtest b/memcheck/tests/bug464969_d_demangle.vgtest new file mode 100644 index 0000000000..bf20ace9ef --- /dev/null +++ b/memcheck/tests/bug464969_d_demangle.vgtest @@ -0,0 +1,2 @@ +prog: bug464969_d_demangle +vgopts: -q |
|
From: Paul F. <pa...@so...> - 2023-01-29 17:02:21
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=2e873534bb49b7ea9310f7b799f8cbbc5fdc7470 commit 2e873534bb49b7ea9310f7b799f8cbbc5fdc7470 Author: Paul Floyd <pj...@wa...> Date: Sun Jan 29 18:00:59 2023 +0100 macOS: drd pth_mutex_signal test doesn't build pth_mutex_signal.c:50:13: error: use of undeclared identifier 'SIGRTMAX' sigaction(NATIVE_IO_INTERRUPT_SIGNAL, &signalAction, NULL); Put this target under a condition for the moment. Diff: --- drd/tests/Makefile.am | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drd/tests/Makefile.am b/drd/tests/Makefile.am index e3366a18a0..157bedcf48 100755 --- a/drd/tests/Makefile.am +++ b/drd/tests/Makefile.am @@ -418,7 +418,6 @@ check_PROGRAMS = \ pth_detached3 \ pth_inconsistent_cond_wait \ pth_mutex_reinit \ - pth_mutex_signal \ pth_process_shared_mutex \ recursive_mutex \ rwlock_race \ @@ -503,6 +502,10 @@ if HAVE_PTHREAD_CREATE_GLIBC_2_0 check_PROGRAMS += pth_create_glibc_2_0 endif +if !VGCONF_OS_IS_DARWIN +check_PROGRAMS += pth_mutex_signal +endif + if HAVE_PTHREAD_SPINLOCK check_PROGRAMS += pth_spinlock endif |
|
From: Paul F. <pa...@so...> - 2023-01-29 16:50:22
|
https://sourceware.org/git/gitweb.cgi?p=valgrind.git;h=44a6e87492a3c83f25e1d7b3158264121df0632e commit 44a6e87492a3c83f25e1d7b3158264121df0632e Author: Paul Floyd <pj...@wa...> Date: Sun Jan 29 17:49:11 2023 +0100 Compiler warning expansion to defined Clang doesn't like m_debuginfo/tinfl.c:182:45: warning: macro expansion producing 'defined' has undefined behavior [-Wexpansion-to-defined] Diff: --- coregrind/m_debuginfo/tinfl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coregrind/m_debuginfo/tinfl.c b/coregrind/m_debuginfo/tinfl.c index 890e0c4dd4..970e0b8275 100644 --- a/coregrind/m_debuginfo/tinfl.c +++ b/coregrind/m_debuginfo/tinfl.c @@ -51,7 +51,6 @@ typedef ULong mz_uint64; #define MINIZ_USE_UNALIGNED_LOADS_AND_STORES 1 #endif -#define MINIZ_LITTLE_ENDIAN ( defined(VG_LITTLEENDIAN) ) #define MINIZ_HAS_64BIT_REGISTERS ( VG_WORDSIZE == 8 ) // Works around MSVC's spammy "warning C4127: conditional expression is @@ -179,7 +178,7 @@ struct tinfl_decompressor_tag #define MZ_MIN(a,b) (((a)<(b))?(a):(b)) #define MZ_CLEAR_OBJ(obj) VG_(memset)(&(obj), 0, sizeof(obj)) -#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && MINIZ_LITTLE_ENDIAN +#if MINIZ_USE_UNALIGNED_LOADS_AND_STORES && defined(VG_LITTLEENDIAN) #define MZ_READ_LE16(p) *((const mz_uint16 *)(p)) #define MZ_READ_LE32(p) *((const mz_uint32 *)(p)) #else |