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
(96) |
Sep
(151) |
Oct
(129) |
Nov
(102) |
Dec
(74) |
|
From: Paul F. <pa...@so...> - 2025-12-07 21:30:42
|
https://sourceware.org/cgit/valgrind/commit/?id=c9fd2fd76eec900f7c7763cb9b16c0eaeac5dc6b commit c9fd2fd76eec900f7c7763cb9b16c0eaeac5dc6b Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 22:11:19 2025 +0100 Darwin: make fixup_macho_loadcmds.c less version dependent Remove a load of DARWIN_VERS checks. It's a pointless maintenance burden. Add suppport for SDK >= 10.4.6. First step to adding macOS 10.14 Mojave support. Diff: --- coregrind/fixup_macho_loadcmds.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/coregrind/fixup_macho_loadcmds.c b/coregrind/fixup_macho_loadcmds.c index 1a5cdf62ad..b751829fbd 100644 --- a/coregrind/fixup_macho_loadcmds.c +++ b/coregrind/fixup_macho_loadcmds.c @@ -117,14 +117,10 @@ #include <mach-o/fat.h> #include <mach/i386/thread_status.h> -/* Get hold of DARWIN_VERS, and check it has a sane value. */ +/* Check that DARWIN_VERS is defined */ #include "config.h" -#if DARWIN_VERS != DARWIN_10_5 && DARWIN_VERS != DARWIN_10_6 \ - && DARWIN_VERS != DARWIN_10_7 && DARWIN_VERS != DARWIN_10_8 \ - && DARWIN_VERS != DARWIN_10_9 && DARWIN_VERS != DARWIN_10_10 \ - && DARWIN_VERS != DARWIN_10_11 && DARWIN_VERS != DARWIN_10_12 \ - && DARWIN_VERS != DARWIN_10_13 -# error "Unknown DARWIN_VERS value. This file only compiles on Darwin." +#if !defined(DARWIN_VERS) +# error "DARWIN_VERS not defind. This file only compiles on Darwin." #endif @@ -519,8 +515,13 @@ void modify_macho_loadcmds ( HChar* filename, fail("has __UNIXSTACK, but wrong ::vmaddr"); if (seg->vmsize != expected_stack_size) fail("has __UNIXSTACK, but wrong ::vmsize"); +#if SDK_VERS >= SDK_10_14_6 + if (seg->maxprot != 3) + fail("has __UNIXSTACK, but wrong ::maxprot (should be 3)"); +#else if (seg->maxprot != 7) fail("has __UNIXSTACK, but wrong ::maxprot (should be 7)"); +#endif if (seg->initprot != 3) fail("has __UNIXSTACK, but wrong ::initprot (should be 3)"); if (seg->nsects != 0) |
|
From: Philippe W. <phi...@so...> - 2025-12-07 20:15:53
|
https://sourceware.org/cgit/valgrind/commit/?id=ba56e9dee171b92ef03168c2bb014de1962d1f0e commit ba56e9dee171b92ef03168c2bb014de1962d1f0e Author: Philippe Waroquiers <phi...@sk...> Date: Sun Dec 7 21:14:20 2025 +0100 If valgrind crashes (e.g. on SEGV) and debug log > 0, report aspacemgr status Might help to see what goes wrong in bug 511717 gdbdserver read memory SIGSEGV Diff: --- coregrind/m_libcassert.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/coregrind/m_libcassert.c b/coregrind/m_libcassert.c index 5859912496..35a988c65d 100644 --- a/coregrind/m_libcassert.c +++ b/coregrind/m_libcassert.c @@ -27,6 +27,7 @@ */ #include "pub_core_basics.h" +#include "pub_core_debuglog.h" #include "pub_core_vki.h" #include "pub_core_vkiscnums.h" #include "pub_core_threadstate.h" @@ -499,6 +500,10 @@ static void report_and_quit ( const HChar* report, False, // exited_threads startRegsIN); + if (VG_(debugLog_getLevel) > 0) { + VG_(am_show_nsegments) (1, "report_and_quit"); + (void) VG_(am_do_sync_check) ("report_and_quit", __FILE__, __LINE__); + } if (VG_(clo_xml)) // After flushing outputs VG_(printf_xml)("</valgrindoutput>\n"); |
|
From: Paul F. <pa...@so...> - 2025-12-07 12:31:55
|
https://sourceware.org/cgit/valgrind/commit/?id=ec89bf448f02f3d727c13a7e4dae1eff90e48544 commit ec89bf448f02f3d727c13a7e4dae1eff90e48544 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 13:30:19 2025 +0100 Darwin: fix debug only build Was filing to link. Optimised builds were smart enough to optimise away a call to a function that I haven't merged into the repo yet. Diff: --- coregrind/m_debuginfo/readmacho.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index 66fd57e06d..2c59d09deb 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -215,7 +215,9 @@ static DiSlice map_image_aboard ( DebugInfo* di, /* only for err msgs */ // unfortunately, all the data needed for parsing from the DSC is spread across many places in memory // and there is no way to know for sure the size of the DSC perfectly, so this is the best method at the moment // and it's _very_ unsafe +#if (DARWIN_VERS >= DARWIN_10_15) mimg = ML_(img_from_memory)(rx_map->avma, MACH_DSC_END - rx_map->avma, filename); +#endif } else { mimg = ML_(img_from_local_file)(filename); } |
|
From: Paul F. <pa...@so...> - 2025-12-07 10:52:58
|
https://sourceware.org/cgit/valgrind/commit/?id=965d8e484b3653c0ea70a1fd3d1dd28de5184778 commit 965d8e484b3653c0ea70a1fd3d1dd28de5184778 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 11:48:51 2025 +0100 Darwin syscall: initial wrapper for kernelrpc_mach_vm_purgable_control_trap Need to add verification of regs and read/write mem. Diff: --- coregrind/m_syswrap/priv_syswrap-darwin.h | 5 +++-- coregrind/m_syswrap/syswrap-darwin.c | 17 ++++++++++++++++- include/vki/vki-scnums-darwin.h | 1 + 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index 2a8d2809d9..d3fd32458c 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -726,8 +726,9 @@ DECL_TEMPLATE(darwin, mach_voucher_extract_attr_recipe_trap); // MACH 72 // Mach traps #if DARWIN_VERS >= DARWIN_10_8 -DECL_TEMPLATE(darwin, kernelrpc_mach_vm_allocate_trap); -DECL_TEMPLATE(darwin, kernelrpc_mach_vm_deallocate_trap); +DECL_TEMPLATE(darwin, kernelrpc_mach_vm_allocate_trap); // MACH 10 +DECL_TEMPLATE(darwin, kernelrpc_mach_vm_purgable_control_trap); // MACH 11 +DECL_TEMPLATE(darwin, kernelrpc_mach_vm_deallocate_trap); // MACH 12 DECL_TEMPLATE(darwin, kernelrpc_mach_vm_protect_trap); DECL_TEMPLATE(darwin, kernelrpc_mach_vm_map_trap); DECL_TEMPLATE(darwin, kernelrpc_mach_port_allocate_trap); diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index b265765bf8..67fdd9e267 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -9814,6 +9814,7 @@ PRE(kernelrpc_mach_vm_allocate_trap) PRE_MEM_WRITE("kernelrpc_mach_vm_allocate_trap(address)", a2, sizeof(void*)); } + POST(kernelrpc_mach_vm_allocate_trap) { UWord a1; UWord a2; ULong a3; UWord a4; @@ -9835,6 +9836,20 @@ POST(kernelrpc_mach_vm_allocate_trap) } } +// MACH 11 +// kern_return_t _kernelrpc_mach_vm_purgable_control_trap(mach_port_name_t target, +// mach_vm_offset_t address, +// vm_purgable_t control, +// int *state); +PRE(kernelrpc_mach_vm_purgable_control_trap) +{ + // FIXME PJF munge? + PRINT("kernelrpc_mach_vm_purgable_control_trap" + "(target:%#lx, address:%#lx, control:%ld, state:%#lx)", + ARG1, ARG2, SARG3, ARG4); + // FIXME PJF PRE_REG_READ and READ/WRITE MEM +} + PRE(kernelrpc_mach_vm_deallocate_trap) { UWord a1; ULong a2; ULong a3; @@ -11554,7 +11569,7 @@ const SyscallTableEntry ML_(mach_trap_table)[] = { _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(10)), # endif - _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(11)), + MACX_(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(11), kernelrpc_mach_vm_purgable_control_trap), # if DARWIN_VERS >= DARWIN_10_8 MACXY(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(12), kernelrpc_mach_vm_deallocate_trap), diff --git a/include/vki/vki-scnums-darwin.h b/include/vki/vki-scnums-darwin.h index 094852bca7..ae1618b52b 100644 --- a/include/vki/vki-scnums-darwin.h +++ b/include/vki/vki-scnums-darwin.h @@ -141,6 +141,7 @@ // osfmk/mach/syscall_sw.h #define __NR_kernelrpc_mach_vm_allocate_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(10) +#define __NR_kernelrpc_mach_vm_purgable_control_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(11) #define __NR_kernelrpc_mach_vm_deallocate_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(12) |
|
From: Paul F. <pa...@so...> - 2025-12-07 08:55:14
|
https://sourceware.org/cgit/valgrind/commit/?id=f916877a38e88b935574530a8cc4ca98ccfd1d07 commit f916877a38e88b935574530a8cc4ca98ccfd1d07 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 09:52:04 2025 +0100 Darwin syscall: initial wrapper for mach_voucher_extract_attr_recipe It doesn't do any checking yet. However, with this change running TextEditor with --tool=none gets as far as drawing a white box on the screen. Then it fails because there is a missing mach trap handler for /* 11 */ MACH_TRAP(_kernelrpc_mach_vm_purgable_control_trap, 4, 5, munge_wlww), Diff: --- coregrind/m_syswrap/priv_syswrap-darwin.h | 1 + coregrind/m_syswrap/syswrap-darwin.c | 15 ++++++++++++++- include/vki/vki-scnums-darwin.h | 2 ++ 3 files changed, 17 insertions(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/priv_syswrap-darwin.h b/coregrind/m_syswrap/priv_syswrap-darwin.h index 1e770d43a0..2a8d2809d9 100644 --- a/coregrind/m_syswrap/priv_syswrap-darwin.h +++ b/coregrind/m_syswrap/priv_syswrap-darwin.h @@ -722,6 +722,7 @@ DECL_TEMPLATE(darwin, mach_msg_bootstrap); DECL_TEMPLATE(darwin, mach_msg_host); DECL_TEMPLATE(darwin, mach_msg_task); DECL_TEMPLATE(darwin, mach_msg_thread); +DECL_TEMPLATE(darwin, mach_voucher_extract_attr_recipe_trap); // MACH 72 // Mach traps #if DARWIN_VERS >= DARWIN_10_8 diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 1835988126..b265765bf8 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -10689,15 +10689,28 @@ PRE(host_create_mach_voucher_trap) PRINT("host_create_mach_voucher_trap" "(host:%s, recipes:%#lx, recipes_size:%ld, voucher:%#lx)", name_for_port(ARG1), ARG2, ARG3, ARG4); + // FIXME PJF PRE_REG_READ? PRE_MEM_READ( "host_create_mach_voucher_trap(recipes)", ARG2, ARG3 ); PRE_MEM_WRITE( "host_create_mach_voucher_trap(voucher)", ARG4, sizeof(mach_port_name_t) ); } + POST(host_create_mach_voucher_trap) { vg_assert(SUCCESS); POST_MEM_WRITE( ARG4, sizeof(mach_port_name_t) ); } +// MACH 72 +// kern_return_t mach_voucher_extract_attr_recipe(ipc_voucher_t voucher, +// mach_voucher_attr_key_t key, +// mach_voucher_attr_raw_recipe_t raw_recipe, +// mach_voucher_attr_raw_recipe_size_t *in_out_size) +PRE(mach_voucher_extract_attr_recipe_trap) +{ + PRINT("mach_voucher_extract_attr_recipe(voucher:%#lx, key:%lu, raw_recipe:%#lx, in_out_size:%#lx)", ARG1, ARG2, ARG3, ARG4); + // FIXME PJF add MEM READ/WRITE and POST as needed +} + PRE(task_register_dyld_image_infos) { //#pragma pack(4) @@ -11673,7 +11686,7 @@ const SyscallTableEntry ML_(mach_trap_table)[] = { _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(70)), #endif _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(71)), - _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(72)), + MACX_(__NR_mach_voucher_extract_attr_recipe_trap, mach_voucher_extract_attr_recipe_trap), _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(73)), _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(74)), _____(VG_DARWIN_SYSCALL_CONSTRUCT_MACH(75)), diff --git a/include/vki/vki-scnums-darwin.h b/include/vki/vki-scnums-darwin.h index f7f3b11057..094852bca7 100644 --- a/include/vki/vki-scnums-darwin.h +++ b/include/vki/vki-scnums-darwin.h @@ -213,6 +213,8 @@ #define __NR_host_create_mach_voucher_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(70) #endif +#define __NR_mach_voucher_extract_attr_recipe_trap VG_DARWIN_SYSCALL_CONSTRUCT_MACH(72) + #define __NR_mach_timebase_info VG_DARWIN_SYSCALL_CONSTRUCT_MACH(89) #define __NR_mach_wait_until VG_DARWIN_SYSCALL_CONSTRUCT_MACH(90) #define __NR_mk_timer_create VG_DARWIN_SYSCALL_CONSTRUCT_MACH(91) |
|
From: Paul F. <pa...@so...> - 2025-12-07 08:44:47
|
https://sourceware.org/cgit/valgrind/commit/?id=24ee9fc71c3913d2049a95900478901cd59b838d commit 24ee9fc71c3913d2049a95900478901cd59b838d Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 09:43:39 2025 +0100 Darwin syswrap: remove a couple of duplicate table entries Probably harmless but it was generating a couple of compiler warnings Diff: --- coregrind/m_syswrap/syswrap-darwin.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 3bbfb76e61..1835988126 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -11106,7 +11106,6 @@ const SyscallTableEntry ML_(syscall_table)[] = { #else _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(178)), // ??? #endif - _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(178)), // ??? _____(VG_DARWIN_SYSCALL_CONSTRUCT_UNIX(179)), // ??? MACX_(__NR_kdebug_trace, kdebug_trace), // 180 GENX_(__NR_setgid, sys_setgid), @@ -11445,7 +11444,6 @@ const SyscallTableEntry ML_(syscall_table)[] = { MACXY(__NR_necp_match_policy, necp_match_policy), // 460 MACXY(__NR_getattrlistbulk, getattrlistbulk), // 461 MACXY(__NR_openat, openat), // 463 - MACX_(__NR_mkdirat, mkdirat), // 475 #if DARWIN_VERS >= DARWIN_10_13 MACXY(__NR_openat_nocancel, openat_nocancel), // 464 #endif |
|
From: Paul F. <pa...@so...> - 2025-12-07 08:37:01
|
https://sourceware.org/cgit/valgrind/commit/?id=95a1dfad820a6befb122aaab31743aeba3ab5062 commit 95a1dfad820a6befb122aaab31743aeba3ab5062 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 09:36:20 2025 +0100 FreeBSD regtest: minor typo in test error message Diff: --- memcheck/tests/freebsd/get_set_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/memcheck/tests/freebsd/get_set_context.c b/memcheck/tests/freebsd/get_set_context.c index e0b7db63b1..e62666084d 100644 --- a/memcheck/tests/freebsd/get_set_context.c +++ b/memcheck/tests/freebsd/get_set_context.c @@ -69,7 +69,7 @@ int main(void) if (-1 == swapcontext(ucp2, ucp)) { perror("swapcontext failed: "); } - fprintf(stderr, "should never see swapcontest return\n"); + fprintf(stderr, "should never see swapcontext return\n"); } assert(flag == 5); |
|
From: Paul F. <pa...@so...> - 2025-12-07 07:55:17
|
https://sourceware.org/cgit/valgrind/commit/?id=a779c501550173dbee98a6713402fafb161e59a7 commit a779c501550173dbee98a6713402fafb161e59a7 Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 08:50:32 2025 +0100 Darwin mach_msg_host: move assign_port_name to post There's a GrP comment saying that assign_port_name should only be called on success. And indeed when it is called in the PRE and it can't find the info for the port then the code will assert. Diff: --- coregrind/m_syswrap/syswrap-darwin.c | 32 +++++++++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 13ca4eb722..3bbfb76e61 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -5407,7 +5407,8 @@ PRE(host_request_notification) } // GrP fixme only do this on success - assign_port_name(req->notify_port.name, "host_notify-%p"); + // PJF moved to POST(mach_msg_post) + //assign_port_name(req->notify_port.name, "host_notify-%p"); } @@ -8771,6 +8772,7 @@ PRE(mach_msg) else if (mh->msgh_request_port == vg_host_port) { // message sent to mach_host_self() CALL_PRE(mach_msg_host); + AFTER = POST_FN(mach_msg_host); return; } else if (is_task_port(mh->msgh_request_port)) { @@ -8971,6 +8973,34 @@ POST(mach_msg_unhandled_check) PRINT("mach_msg_unhandled_check tid:%d missed mapping change()", tid); } +POST(mach_msg_host) +{ + mach_msg_header_t *mh = (mach_msg_header_t *)ARG1; + + // FIXME PJF put this in a header rather than have a copy and paste duplicate +#pragma pack(4) + typedef struct { + mach_msg_header_t Head; + /* start of the kernel processed data */ + mach_msg_body_t msgh_body; + mach_msg_port_descriptor_t notify_port; + /* end of the kernel processed data */ + NDR_record_t NDR; + host_flavor_t notify_type; + } Request; +#pragma pack() + + switch (mh->msgh_id) { + case 217: { + Request *req = (Request *)ARG1; + assign_port_name(req->notify_port.name, "host_notify-%p"); + } + break; + default: + break; + } +} + /* --------------------------------------------------------------------- other Mach traps |
|
From: Paul F. <pa...@so...> - 2025-12-07 06:56:47
|
https://sourceware.org/cgit/valgrind/commit/?id=55129845cd0e2a8415b945953a035265b417afaf commit 55129845cd0e2a8415b945953a035265b417afaf Author: Paul Floyd <pj...@wa...> Date: Sun Dec 7 07:54:23 2025 +0100 Darwin stacktraces: add a hack to prevent segfault when dereferencing bp Can now turn a couple more helgrind tests back on. Need to get to the bottom of the bp dereferencing issue. There is a test already so it us supposed to be safe. Diff: --- coregrind/m_stacktrace.c | 15 ++++++++++++++- helgrind/tests/shared_timed_mutex.vgtest | 2 +- helgrind/tests/tc22_exit_w_lock.vgtest | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/coregrind/m_stacktrace.c b/coregrind/m_stacktrace.c index fa2dc09644..5175f79fef 100644 --- a/coregrind/m_stacktrace.c +++ b/coregrind/m_stacktrace.c @@ -691,7 +691,20 @@ UInt VG_(get_StackTrace_wrk) ( ThreadId tid_if_known, fact that we are prodding at & ((UWord*)fp)[1] and so need to adjust the limit check accordingly. Omitting this has been observed to cause segfaults on rare occasions. */ - if (fp_min <= uregs.xbp && uregs.xbp <= fp_max - 1 * sizeof(UWord)) { + if (fp_min <= uregs.xbp && uregs.xbp <= fp_max - 1 * sizeof(UWord) +#if defined(VGO_darwin) + // FIXME PJF temporary? workaround for segfaults + // without this extra check there will be some SIGSEGVs which end stuck + // in an infinite loop + + // The faulting address seems to be in a fairly small rw- mapping + // (according to lldb) + // happens in Helgrind multithread apps, error arises in + // sync_signalhandler (called from darwin_signal_demux with signal 11) + + && ML_(safe_to_deref)((void*)uregs.xbp, 2*sizeof(UWord)) +#endif + ) { /* fp looks sane, so use it. */ uregs.xip = (((UWord*)uregs.xbp)[1]); if (0 == uregs.xip || 1 == uregs.xip) break; diff --git a/helgrind/tests/shared_timed_mutex.vgtest b/helgrind/tests/shared_timed_mutex.vgtest index 8903894e6a..d3a044379c 100644 --- a/helgrind/tests/shared_timed_mutex.vgtest +++ b/helgrind/tests/shared_timed_mutex.vgtest @@ -1,3 +1,3 @@ -prereq: test -e ../../drd/tests/shared_timed_mutex && ! ../../tests/os_test darwin +prereq: test -e ../../drd/tests/shared_timed_mutex vgopts: --read-var-info=yes prog: ../../drd/tests/shared_timed_mutex diff --git a/helgrind/tests/tc22_exit_w_lock.vgtest b/helgrind/tests/tc22_exit_w_lock.vgtest index 8dd7531ec5..2e6190a727 100644 --- a/helgrind/tests/tc22_exit_w_lock.vgtest +++ b/helgrind/tests/tc22_exit_w_lock.vgtest @@ -1,3 +1,3 @@ -prereq: test -e tc22_exit_w_lock && ! ../../tests/os_test darwin +prereq: test -e tc22_exit_w_lock prog: tc22_exit_w_lock cleanup: rm -f vgcore.* |
|
From: Paul F. <pa...@so...> - 2025-12-06 10:10:19
|
https://sourceware.org/cgit/valgrind/commit/?id=ec228db38313830d374edf1519d314c88a51b98e commit ec228db38313830d374edf1519d314c88a51b98e Author: Paul Floyd <pj...@wa...> Date: Sat Dec 6 11:09:19 2025 +0100 Darwin client stack: add an assert to check the stringtable doesn't get overwritten As per the previous change for FreeBSD. Diff: --- coregrind/m_initimg/initimg-darwin.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_initimg/initimg-darwin.c b/coregrind/m_initimg/initimg-darwin.c index 0befeaef39..d4257c9544 100644 --- a/coregrind/m_initimg/initimg-darwin.c +++ b/coregrind/m_initimg/initimg-darwin.c @@ -453,6 +453,8 @@ Addr setup_client_stack( void* init_sp, vg_assert((strtab-stringbase) == stringsize); + vg_assert((HChar*)ptr <= stringbase); + if (VG_(resolved_exename) == NULL) { const HChar *exe_name = VG_(find_executable)(VG_(args_the_exename)); HChar interp_name[VKI_PATH_MAX]; |
|
From: Paul F. <pa...@so...> - 2025-12-06 09:56:21
|
https://sourceware.org/cgit/valgrind/commit/?id=c48791a0db7ee5e69fd061c696608c121bb5b190 commit c48791a0db7ee5e69fd061c696608c121bb5b190 Author: Paul Floyd <pj...@wa...> Date: Sat Dec 6 10:50:38 2025 +0100 FreeBSD client stack: add an assert to check the stringtable doesn't get overwritten There's already an assert that the stringsize calculated matches the stringsize writte. This adds a check that the pointer table area does not overwrite the stringtable (that is, that the NULL pointer after the last auxv entry pointer does not overwrite the first string [either the interpreter or argv[0]) Diff: --- coregrind/m_initimg/initimg-freebsd.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index cd127736ce..40f74168c9 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -841,6 +841,8 @@ static Addr setup_client_stack(const void* init_sp, vg_assert((strtab-stringbase) == stringsize); + vg_assert((HChar*)auxv < stringbase); + /* client_SP is pointing at client's argc/argv */ if (0) { |
|
From: Paul F. <pa...@so...> - 2025-12-06 09:35:59
|
https://sourceware.org/cgit/valgrind/commit/?id=34a1e01deacf1a9b1e99720a1c19149e35581707 commit 34a1e01deacf1a9b1e99720a1c19149e35581707 Author: Paul Floyd <pj...@wa...> Date: Sat Dec 6 08:19:36 2025 +0100 Darwin configure: updates to SDK checking and not yet suppoorted Darwin versions Merged from Louis Brunner I was just adding support for OSX 10.13 but that is just making more work (avoiding parts of merges that will probably need to be added back later). This should allow me to merge code that uses macros for OSX/macOS versions which don't yet have support in the repo. Diff: --- configure.ac | 323 ++++++++++++++++++++++++++--------- coregrind/Makefile.am | 12 +- coregrind/m_syswrap/syswrap-darwin.c | 10 ++ 3 files changed, 261 insertions(+), 84 deletions(-) diff --git a/configure.ac b/configure.ac index 54df9c1e19..82f8e8c3ab 100644 --- a/configure.ac +++ b/configure.ac @@ -117,33 +117,15 @@ rm $tmpfile # We don't want gcc < 3.0 AC_MSG_CHECKING([for a supported version of gcc]) -# Obtain the compiler version. -# -# A few examples of how the ${CC} --version output looks like: -# -# ######## gcc variants ######## -# Arch Linux: i686-pc-linux-gnu-gcc (GCC) 4.6.2 -# Debian Linux: gcc (Debian 4.3.2-1.1) 4.3.2 -# openSUSE: gcc (SUSE Linux) 4.5.1 20101208 [gcc-4_5-branch revision 167585] -# Exherbo Linux: x86_64-pc-linux-gnu-gcc (Exherbo gcc-4.6.2) 4.6.2 -# MontaVista Linux for ARM: arm-none-linux-gnueabi-gcc (Sourcery G++ Lite 2009q1-203) 4.3.3 -# OS/X 10.6: i686-apple-darwin10-gcc-4.2.1 (GCC) 4.2.1 (Apple Inc. build 5666) (dot 3) -# OS/X 10.7: i686-apple-darwin11-llvm-gcc-4.2 (GCC) 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00) -# -# ######## clang variants ######## -# Clang: clang version 2.9 (tags/RELEASE_29/final) -# Apple clang: Apple clang version 3.1 (tags/Apple/clang-318.0.58) (based on LLVM 3.1svn) -# FreeBSD clang: FreeBSD clang version 3.1 (branches/release_31 156863) 20120523 -# -# ######## Apple LLVM variants ######## -# Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn) -# Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn) -# [ if test "x`${CC} --version | $SED -n -e 's/.*\Apple \(LLVM\) version.*clang.*/\1/p'`" = "xLLVM" ; then is_clang="applellvm" gcc_version=`${CC} --version | $SED -n -e 's/.*LLVM version \([0-9.]*\).*$/\1/p'` +elif test "x`${CC} --version | $SED -n -e 's/.*\Apple \(clang\) version.*clang.*/\1/p'`" = "xclang" ; +then + is_clang="applellvm" + gcc_version=`${CC} --version | $SED -n -e 's/.*clang version \([0-9.]*\).*$/\1/p'` elif test "x`${CC} --version | $SED -n -e 's/.*\(clang\) version.*/\1/p'`" = "xclang" ; then is_clang="clang" @@ -164,6 +146,82 @@ fi AM_CONDITIONAL(COMPILER_IS_CLANG, test $is_clang = clang -o $is_clang = applellvm) AM_CONDITIONAL(COMPILER_IS_ICC, test $is_clang = icc) +AC_CANONICAL_HOST + +# macOS: Detect the Xcode SDK path and inject it in different tools +case $host_os in + *darwin*) + AC_ARG_WITH([darwin-platform], + [ --with-darwin-platform=PLAT Specify which Darwin platform we are compiling for (macOS, iOS, etc)], + [ + # TODO: some kind of case-insensitive check? + if test "x$withval" == "xmacOS"; then + darwin_platform="macosx" + elif test "x$withval" == "xmacos"; then + darwin_platform="macosx" + elif test "x$withval" == "xiOS"; then + darwin_platform="iphoneos" + elif test "x$withval" == "xios"; then + darwin_platform="iphoneos" + else + darwin_platform="$withval" + fi + ], + [ + darwin_platform="macosx" + ]) + + AC_ARG_WITH([darwin-version], + [ --with-darwin-version=VERS Specify which version of Darwin you are targetting (useful for cross-compilation, depends on the darwin-platform)], + [ + darwin_version="$withval" + ], + [ + darwin_version="" + ]) + + AC_ARG_VAR([DEVELOPER_DIR],[Overrides the active developer directory (used in gcc, xcrun, etc)]) + AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no]) + + AC_MSG_CHECKING([for Xcode SDK]) + AC_ARG_WITH([xcode-path], + [ --with-xcode-path=PATH Specify path for Xcode SDK], + [ + # Set defaults in case `xcrun` fails + xcodedir="$withval" + xcodedir_inc="$xcodedir/usr/include" + xcodedir_lib="$xcodedir/usr/lib" + # Defining DEVELOPER_DIR will override which version of gcc, xcrun, etc is being used + export DEVELOPER_DIR="$xcodedir" + ], + [ + # Use system defaults, in case `xcrun` fails + xcodedir="active developer directory" + xcodedir_inc="/usr/include" + xcodedir_lib="/usr/lib" + ]) + + darwin_sdk="$darwin_platform$darwin_version" + if test "x$XCRUN" != "xno"; then + if test "x$darwin_version" != "x"; then + if test x`xcrun --sdk $darwin_sdk --show-sdk-version` != x$darwin_version; then + AC_MSG_ERROR([Couldn't find SDK for $darwin_sdk version $darwin_version (check 'xcodebuild -showsdks' for available ones)]) + fi + fi + + xcrundir=`xcrun --sdk $darwin_sdk --show-sdk-path` + if test ! -z "$xcrundir"; then + xcodedir="$xcrundir" + xcodedir_inc="$xcodedir/usr/include" + xcodedir_lib="$xcodedir/usr/lib" + fi + else + AC_MSG_WARN([Couldn't find xcrun, most Xcode-related autodetection will be disabled and the build might fail]) + fi + AC_MSG_RESULT([$xcodedir]) + ;; +esac + # Note: m4 arguments are quoted with [ and ] so square brackets in shell # statements have to be quoted. case "${is_clang}-${gcc_version}" in @@ -193,8 +251,6 @@ esac # configure-time, and distinguishes them from the VGA_*/VGO_*/VGP_* # variables used when compiling C files. -AC_CANONICAL_HOST - AC_MSG_CHECKING([for a supported CPU]) # ARCH_MAX reflects the most that this CPU can do: for example if it @@ -387,27 +443,67 @@ case "${host_os}" in *darwin*) AC_MSG_RESULT([ok (${host_os})]) VGCONF_OS="darwin" - AC_DEFINE([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5]) - AC_DEFINE([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6]) - AC_DEFINE([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7]) - AC_DEFINE([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8]) - AC_DEFINE([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9]) - AC_DEFINE([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10]) - AC_DEFINE([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11]) - AC_DEFINE([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12]) - AC_DEFINE([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13]) - AC_DEFINE([DARWIN_10_14], 101400, [DARWIN_VERS value for macOS 10.14 / iOS 12]) - AC_DEFINE([DARWIN_10_15], 101500, [DARWIN_VERS value for macOS 10.15 / iOS 13]) - AC_DEFINE([DARWIN_11_00], 110000, [DARWIN_VERS value for macOS 11.0 / iOS 14]) - AC_DEFINE([DARWIN_12_00], 120000, [DARWIN_VERS value for macOS 12.0 / iOS 15]) - AC_DEFINE([DARWIN_13_00], 130000, [DARWIN_VERS value for macOS 13.0 / iOS 16]) - AC_DEFINE([DARWIN_14_00], 140000, [DARWIN_VERS value for macOS 14.0 / iOS 17]) - AC_DEFINE([DARWIN_15_00], 150000, [DARWIN_VERS value for macOS 15.0 / iOS 18]) - AC_DEFINE([DARWIN_15_04], 150400, [DARWIN_VERS value for macOS 15.4]) - AC_DEFINE([DARWIN_26_00], 260000, [DARWIN_VERS value for macOS / iOS 26]) + + AC_DEFUN([AC_ADD_DARWIN_VERS],[ + $1=$2 + AC_DEFINE_UNQUOTED([$1], [$$1], [DARWIN_VERS value for $3]) + AC_SUBST($1) + ]) + AC_ADD_DARWIN_VERS([DARWIN_10_5], 100500, [DARWIN_VERS value for Mac OS X 10.5]) + AC_ADD_DARWIN_VERS([DARWIN_10_6], 100600, [DARWIN_VERS value for Mac OS X 10.6 / iOS 4]) + AC_ADD_DARWIN_VERS([DARWIN_10_7], 100700, [DARWIN_VERS value for Mac OS X 10.7 / iOS 5]) + AC_ADD_DARWIN_VERS([DARWIN_10_8], 100800, [DARWIN_VERS value for Mac OS X 10.8 / iOS 6]) + AC_ADD_DARWIN_VERS([DARWIN_10_9], 100900, [DARWIN_VERS value for Mac OS X 10.9 / iOS 7]) + AC_ADD_DARWIN_VERS([DARWIN_10_10], 101000, [DARWIN_VERS value for Mac OS X 10.10 / iOS 8]) + AC_ADD_DARWIN_VERS([DARWIN_10_11], 101100, [DARWIN_VERS value for Mac OS X 10.11 / iOS 9]) + AC_ADD_DARWIN_VERS([DARWIN_10_12], 101200, [DARWIN_VERS value for macOS 10.12 / iOS 10]) + AC_ADD_DARWIN_VERS([DARWIN_10_13], 101300, [DARWIN_VERS value for macOS 10.13 / iOS 11]) + AC_ADD_DARWIN_VERS([DARWIN_10_14], 101400, [DARWIN_VERS value for macOS 10.14 / iOS 12]) + AC_ADD_DARWIN_VERS([DARWIN_10_15], 101500, [DARWIN_VERS value for macOS 10.15 / iOS 13]) + AC_ADD_DARWIN_VERS([DARWIN_11_00], 110000, [DARWIN_VERS value for macOS 11.0 / iOS 14]) + AC_ADD_DARWIN_VERS([DARWIN_12_00], 120000, [DARWIN_VERS value for macOS 12.0 / iOS 15]) + AC_ADD_DARWIN_VERS([DARWIN_13_00], 130000, [DARWIN_VERS value for macOS 13.0 / iOS 16]) + AC_ADD_DARWIN_VERS([DARWIN_14_00], 140000, [DARWIN_VERS value for macOS 14.0 / iOS 17]) + AC_ADD_DARWIN_VERS([DARWIN_15_00], 150000, [DARWIN_VERS value for macOS 15.0 / iOS 18]) + AC_ADD_DARWIN_VERS([DARWIN_15_04], 150400, [DARWIN_VERS value for macOS 15.4]) + AC_ADD_DARWIN_VERS([DARWIN_26_00], 260000, [DARWIN_VERS value for macOS / iOS 26]) + + AC_DEFINE([SDK_10_XX], 101200, [SDK_VERS value for Xcode SDK earlier than macOS 10.13 / iOS 11]) + AC_DEFINE([SDK_10_13], 101300, [SDK_VERS value for Xcode SDK macOS 10.13 / iOS 11]) + AC_DEFINE([SDK_10_14], 101400, [SDK_VERS value for Xcode SDK macOS 10.14 / iOS 12]) + AC_DEFINE([SDK_10_14_6], 101406, [SDK_VERS value for Xcode SDK macOS 10.14.6 / iOS 12]) + AC_DEFINE([SDK_10_15], 101500, [SDK_VERS value for Xcode SDK macOS 10.15 / iOS 13]) + AC_DEFINE([SDK_11_0], 110000, [SDK_VERS value for Xcode SDK macOS 11.0 / iOS 14]) + AC_DEFINE([SDK_12_0], 120000, [SDK_VERS value for Xcode SDK macOS 12.0 / iOS 15]) + AC_DEFINE([SDK_13_0], 130000, [SDK_VERS value for Xcode SDK macOS 13.0 / iOS 16]) + AC_DEFINE([SDK_14_0], 140000, [SDK_VERS value for Xcode SDK macOS 14.0 / iOS 17]) + AC_DEFINE([SDK_15_0], 150000, [SDK_VERS value for Xcode SDK macOS 15.0 / iOS 18]) + AC_DEFINE([SDK_26_0], 260000, [SDK_VERS value for Xcode SDK macOS / iOS 26]) + + # Substitute the Xcode include path detected earlier + AC_SUBST(SDK_INC_DIR, [$xcodedir_inc]) + AC_SUBST(SDK_LIB_DIR, [$xcodedir_lib]) + + AC_MSG_CHECKING([for the Darwin platform]) + case "${darwin_platform}" in + macosx) + ;; + iphoneos) + ;; + *) + AC_MSG_RESULT([unsupported Darwin platform (${darwin_platform})]) + AC_MSG_ERROR([Valgrind works on macOS (macosx) and iOS (iphoneos)]) + esac + AC_MSG_RESULT([ok (${darwin_platform})]) AC_MSG_CHECKING([for the kernel version]) + kernel=$darwin_version + if test "x$kernel" = "x"; then + if test "${host_cpu}" != "${build_cpu}"; then + AC_MSG_WARN([You are cross-compiling without specifying the target\'s darwin-version, valgrind might not work.]) + fi kernel=`uname -r` + fi # Nb: for Darwin we set DEFAULT_SUPP here. That's because Darwin # has only one relevant version, the OS version. The `uname` check @@ -425,66 +521,162 @@ case "${host_os}" in # time support for 10.5 (the 9.* pattern just below), I'll leave it # in for now, just in case anybody wants to give it a try. But I'm # assuming that 3.7.0 is a Snow Leopard and Lion-only release. + DARWIN_DRD_SUPP="darwin10-drd.supp" case "${kernel}" in 9.*) AC_MSG_RESULT([Darwin 9.x (${kernel}) / Mac OS X 10.5 Leopard]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_5, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_5 DEFAULT_SUPP="$srcdir/darwin9.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin9-drd.supp ${DEFAULT_SUPP}" ;; 10.*) AC_MSG_RESULT([Darwin 10.x (${kernel}) / Mac OS X 10.6 Snow Leopard]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_6, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_6 DEFAULT_SUPP="$srcdir/darwin10.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 11.*) AC_MSG_RESULT([Darwin 11.x (${kernel}) / Mac OS X 10.7 Lion]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_7, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_7 DEFAULT_SUPP="$srcdir/darwin11.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 12.*) AC_MSG_RESULT([Darwin 12.x (${kernel}) / Mac OS X 10.8 Mountain Lion]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_8, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_8 DEFAULT_SUPP="$srcdir/darwin12.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 13.*) AC_MSG_RESULT([Darwin 13.x (${kernel}) / Mac OS X 10.9 Mavericks]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_9, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_9 DEFAULT_SUPP="$srcdir/darwin13.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 14.*) AC_MSG_RESULT([Darwin 14.x (${kernel}) / Mac OS X 10.10 Yosemite]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_10, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_10 DEFAULT_SUPP="$srcdir/darwin14.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 15.*) AC_MSG_RESULT([Darwin 15.x (${kernel}) / Mac OS X 10.11 El Capitan]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_11, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_11 DEFAULT_SUPP="$srcdir/darwin15.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 16.*) AC_MSG_RESULT([Darwin 16.x (${kernel}) / macOS 10.12 Sierra]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_12, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_12 DEFAULT_SUPP="$srcdir/darwin16.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; 17.*) AC_MSG_RESULT([Darwin 17.x (${kernel}) / macOS 10.13 High Sierra]) - AC_DEFINE([DARWIN_VERS], DARWIN_10_13, [Darwin / Mac OS X version]) + DARWIN_VERS=$DARWIN_10_13 DEFAULT_SUPP="$srcdir/darwin17.supp ${DEFAULT_SUPP}" DEFAULT_SUPP="$srcdir/darwin10-drd.supp ${DEFAULT_SUPP}" ;; *) - AC_MSG_RESULT([unsupported (${kernel})]) - AC_MSG_ERROR([Valgrind works on Darwin 10.x, 11.x, 12.x, 13.x, 14.x, 15.x, 16.x and 17.x (Mac OS X 10.6/7/8/9/10/11 and macOS 10.12/13)]) + AC_MSG_RESULT([unsupported (${darwin_platform} ${kernel})]) + AC_MSG_ERROR([Valgrind works on Darwin 10.x-25.x (Mac OS X 10.6-10.11, macOS 10.12-15.0, iOS 4-18 and macOS/iOS 26)]) ;; esac + + if test -f "$srcdir/darwin${DARWIN_KERNEL_VERS}.supp"; then + DEFAULT_SUPP="$srcdir/darwin${DARWIN_KERNEL_VERS}.supp ${DEFAULT_SUPP}" + fi + + AC_DEFINE_UNQUOTED([DARWIN_VERS], $DARWIN_VERS, [Darwin / Mac OS X / macOS / iOS version]) + AC_SUBST(DARWIN_VERS) + DEFAULT_SUPP="$srcdir/${DARWIN_DRD_SUPP} ${DEFAULT_SUPP}" + + AC_MSG_CHECKING([for the the minimum macOS SDK version]) + case "${darwin_platform}" in + macosx) + DARWIN_MIN_SDK="10.6" + ld_os_min_vers_arg="-macosx_version_min ${DARWIN_MIN_SDK}" + clang_os_min_vers_arg="-mmacosx-version-min=${DARWIN_MIN_SDK}" + if test $DARWIN_VERS -ge $DARWIN_11_00; then + if test $ARCH_MAX = "arm64"; then + # arm64 is only supported on macOS 11.0 and later + # this means that when you use a lower version it automatically caps it to 11.0 + DARWIN_MIN_SDK="11.0" + else + DARWIN_MIN_SDK="10.8" + fi + + # they changed the names around 11.0 + ld_os_min_vers_arg="-macos_version_min ${DARWIN_MIN_SDK}" + clang_os_min_vers_arg="-mmacos-version-min=${DARWIN_MIN_SDK}" + fi + ;; + iphoneos) + IPHONE_MIN_SDK=4 + clang_os_min_vers_arg="-miphoneos-version-min=${IPHONE_MIN_SDK}" + ld_os_min_vers_arg="-miphoneos-version-min=${IPHONE_MIN_SDK}" + ;; + *) + AC_MSG_RESULT([unsupported Darwin platform (${darwin_platform})]) + AC_MSG_ERROR([Valgrind works on macOS (macosx) and iOS (iphoneos)]) + esac + AC_MSG_RESULT([ok (${clang_os_min_vers_arg} ${ld_os_min_vers_arg})]) + + # Ensure clang receive the right minimum version argument + AC_SUBST(CLANG_OS_MIN_VERS_ARG, [$clang_os_min_vers_arg]) + AC_SUBST(LD_OS_MIN_VERS_ARG, [$ld_os_min_vers_arg]) + + AC_MSG_CHECKING([for the Xcode SDK version]) + sdkversion="legacy" + if test "x$XCRUN" != "xno"; then + sdkversion=`xcrun --sdk $darwin_sdk --show-sdk-version` + fi + case "${darwin_platform}-${sdkversion}" in + macosx-10.13*|iphoneos-11.*) + AC_DEFINE([SDK_VERS], SDK_10_13, [SDK version]) + ;; + macosx-10.14.6) + AC_DEFINE([SDK_VERS], SDK_10_14_6, [SDK version]) + ;; + macosx-10.14*|iphoneos-12.*) + AC_DEFINE([SDK_VERS], SDK_10_14, [SDK version]) + ;; + macosx-10.15*|iphoneos-13.*) + AC_DEFINE([SDK_VERS], SDK_10_15, [SDK version]) + ;; + macosx-11.*|iphoneos-14.*) + AC_DEFINE([SDK_VERS], SDK_11_0, [SDK version]) + ;; + macosx-12.*|iphoneos-15.*) + AC_DEFINE([SDK_VERS], SDK_12_0, [SDK version]) + ;; + macosx-13.*|iphoneos-16.*) + AC_DEFINE([SDK_VERS], SDK_13_0, [SDK version]) + ;; + macosx-14.*|iphoneos-17.*) + AC_DEFINE([SDK_VERS], SDK_14_0, [SDK version]) + ;; + macosx-15.*|iphoneos-18.*) + AC_DEFINE([SDK_VERS], SDK_15_0, [SDK version]) + ;; + *-26.*) + AC_DEFINE([SDK_VERS], SDK_26_0, [SDK version]) + ;; + legacy) + AC_DEFINE([SDK_VERS], SDK_10_XX, [SDK version]) + ;; + macosx-10.5*|macosx-10.6*|macosx-10.7*|macosx-10.8*|macosx-10.9*|macosx-10.10*|macosx-10.11*|macosx-10.12*) + AC_DEFINE([SDK_VERS], SDK_10_XX, [SDK version]) + ;; + iphoneos-4.*|iphoneos-5.*|iphoneos-6.*|iphoneos-7.*|iphoneos-8.*|iphoneos-9.*|iphoneos-10.*) + AC_DEFINE([SDK_VERS], SDK_10_XX, [SDK version]) + ;; + *) + AC_MSG_RESULT([unsupported (${sdkversion})]) + AC_MSG_ERROR([Valgrind works on Darwin 10.x-25.x (Mac OS X 10.6-10.11, macOS 10.12-15.0, iOS 4-18 and macOS/iOS 26)]) + ;; + esac + AC_MSG_RESULT([${sdkversion}]) ;; solaris2.11*) @@ -1126,31 +1318,6 @@ AC_ARG_WITH(tmpdir, AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory]) AC_SUBST(VG_TMPDIR, [$tmpdir]) -#---------------------------------------------------------------------------- -# Detect xcode path -#---------------------------------------------------------------------------- -AM_COND_IF([VGCONF_OS_IS_DARWIN], -[AC_CHECK_PROG([XCRUN], [xcrun], [yes], [no]) -AC_MSG_CHECKING([for xcode sdk include path]) -AC_ARG_WITH(xcodedir, - [ --with-xcode-path=PATH Specify path for xcode sdk includes], - [xcodedir="$withval"], - [ - if test "x$XCRUN" != "xno" -a ! -d /usr/include; then - xcrundir=`xcrun --sdk macosx --show-sdk-path` - if test -z "$xcrundir"; then - xcodedir="/usr/include" - else - xcodedir="$xcrundir/usr/include" - fi - else - xcodedir="/usr/include" - fi - ]) -AC_MSG_RESULT([$xcodedir]) -AC_DEFINE_UNQUOTED(XCODE_DIR, "$xcodedir", [xcode sdk include directory]) -AC_SUBST(XCODE_DIR, [$xcodedir])]) - #---------------------------------------------------------------------------- # Where to install gdb scripts, defaults to VG_LIBDIR (pkglibexecdir) #---------------------------------------------------------------------------- diff --git a/coregrind/Makefile.am b/coregrind/Makefile.am index 4ead1542b0..65369ebcd2 100644 --- a/coregrind/Makefile.am +++ b/coregrind/Makefile.am @@ -167,10 +167,10 @@ mach_hdrs += \ m_mach/thread_act.h \ m_mach/vm_map.h mach_defs += \ - @XCODE_DIR@/mach/mach_vm.defs \ - @XCODE_DIR@/mach/task.defs \ - @XCODE_DIR@/mach/thread_act.defs \ - @XCODE_DIR@/mach/vm_map.defs + @SDK_INC_DIR@/mach/mach_vm.defs \ + @SDK_INC_DIR@/mach/task.defs \ + @SDK_INC_DIR@/mach/thread_act.defs \ + @SDK_INC_DIR@/mach/vm_map.defs endif # Be careful w.r.t. parallel builds. See section 27.9 of the automake info @@ -178,9 +178,9 @@ endif $(abs_builddir)/m_mach: mkdir -p $@ $(mach_user_srcs): $(mach_defs) $(abs_builddir)/m_mach - (cd m_mach && mig $(mach_defs)) + (cd m_mach && mig -I@SDK_INC_DIR@ $(mach_defs)) $(mach_hdrs): $(mach_defs) $(mach_user_srcs) $(abs_builddir)/m_mach - (cd m_mach && mig $(mach_defs)) + (cd m_mach && mig -I@SDK_INC_DIR@ $(mach_defs)) #---------------------------------------------------------------------------- # Headers diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 28ae9b4d51..13ca4eb722 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -972,9 +972,19 @@ void update_syncstats ( CheckHowOften cho, // reorder static UInt reorder_ctr = 0; if (i > 0 && 0 == (1 & reorder_ctr++)) { +#if defined(VGA_amd64) + // Some kind of compiler xmm-based optimization which causes a EXC_I386_GPFLT + // happens on amd64 on later macOS versions (seen on 15.0). + // Instead we do a boring memcpy. + SyncStats tmp; + VG_(memcpy)(&tmp, &syncstats[i-1], sizeof(SyncStats)); + VG_(memcpy)(&syncstats[i-1], &syncstats[i], sizeof(SyncStats)); + VG_(memcpy)(&syncstats[i], &tmp, sizeof(SyncStats)); +#else SyncStats tmp = syncstats[i-1]; syncstats[i-1] = syncstats[i]; syncstats[i] = tmp; +#endif } } |
|
From: Paul F. <pa...@so...> - 2025-12-05 21:08:57
|
https://sourceware.org/cgit/valgrind/commit/?id=46bc7241a79e68663b707b40b1866cc8303924c3 commit 46bc7241a79e68663b707b40b1866cc8303924c3 Author: Paul Floyd <pj...@wa...> Date: Fri Dec 5 21:59:34 2025 +0100 Darwin: also clean up client stack creation Make stringbase and strtab be based off clstack_end + 1 rather than clstack_end. clstack_end is the address of the last byte of the stack, not one past the end of the stack. That means that it is not word aligned. Adding 1 makes the calculation word aligned. Depending on the length of the string table with rounding it could happen that the executable_path pointer would overwrite the start of argv[0] in the string table. I think that that there are supposed to be 0-16 bytes between the end of the pointers and the string table (or is that ELF?). Diff: --- coregrind/m_initimg/initimg-darwin.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/coregrind/m_initimg/initimg-darwin.c b/coregrind/m_initimg/initimg-darwin.c index 3ddc9806c6..0befeaef39 100644 --- a/coregrind/m_initimg/initimg-darwin.c +++ b/coregrind/m_initimg/initimg-darwin.c @@ -360,16 +360,8 @@ Addr setup_client_stack( void* init_sp, stringsize += VG_(strlen)(*cpp) + 1; } - // @todo PJF there is a bug in the size calculation or rounding - // somewhere. This should be "+= 2" (one of the pointer to exec - // path and one for the terminating NULL pointer). When I run - // "./tests/vg_regtest none/tests" from a Korn shell script - // then the allexec32/64 tests fail because they print out "argv[0]". - // I think that what happens is that writing to "ptr" overwrites the - // start of strtab resulting in the argv[0] the exe name being a - // string starting with 8 \0s (not tested) - /* Darwin executable_path + NULL */ - auxsize += 3 * sizeof(Word); + /* NULL separator and executable path */ + auxsize += 2 * sizeof(HChar **); if (info->executable_path) { stringsize += 1 + VG_(strlen)(info->executable_path); } @@ -395,7 +387,7 @@ Addr setup_client_stack( void* init_sp, client_SP = VG_ROUNDDN(client_SP, 32); /* make stack 32 byte aligned */ /* base of the string table (aligned) */ - stringbase = strtab = (HChar *)clstack_end + stringbase = strtab = (HChar *)clstack_end + 1 - VG_ROUNDUP(stringsize, sizeof(int)); /* The max stack size */ |
|
From: Paul F. <pa...@so...> - 2025-12-05 20:46:52
|
https://sourceware.org/cgit/valgrind/commit/?id=7769d95480ec28e2ebcf475d04a5b495d5502e59 commit 7769d95480ec28e2ebcf475d04a5b495d5502e59 Author: Paul Floyd <pj...@wa...> Date: Fri Dec 5 21:44:56 2025 +0100 FreeBSD: a bit of cleaning of client stack creation Remove some commented out rounding Make stringbase point to a word boundary, not one before Diff: --- coregrind/m_initimg/initimg-freebsd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/coregrind/m_initimg/initimg-freebsd.c b/coregrind/m_initimg/initimg-freebsd.c index 09f3dda847..cd127736ce 100644 --- a/coregrind/m_initimg/initimg-freebsd.c +++ b/coregrind/m_initimg/initimg-freebsd.c @@ -473,17 +473,14 @@ static Addr setup_client_stack(const void* init_sp, break; case VKI_AT_CANARYLEN: canarylen = cauxv->u.a_val; - /*VG_ROUNDUP(stringsize, sizeof(Word));*/ stringsize += canarylen; break; case VKI_AT_PAGESIZESLEN: pagesizeslen = cauxv->u.a_val; - /*VG_ROUNDUP(stringsize, sizeof(Word));*/ stringsize += pagesizeslen; break; #if 0 case VKI_AT_TIMEKEEP: - /*VG_ROUNDUP(stringsize, sizeof(Word));*/ stringsize += sizeof(struct vki_vdso_timehands); break; #endif @@ -519,7 +516,7 @@ static Addr setup_client_stack(const void* init_sp, client_SP = VG_ROUNDDN(client_SP, 16); /* make stack 16 byte aligned */ /* base of the string table (aligned) */ - stringbase = strtab = (HChar *)clstack_end + stringbase = strtab = (HChar *)clstack_end + 1 - VG_ROUNDUP(stringsize, sizeof(int)); clstack_start = VG_PGROUNDDN(client_SP); |
|
From: Paul F. <pa...@so...> - 2025-12-05 12:50:14
|
https://sourceware.org/cgit/valgrind/commit/?id=19054d9a8fe14c6b20f989c2c8ff3d7eea8ce40a commit 19054d9a8fe14c6b20f989c2c8ff3d7eea8ce40a Author: Paul Floyd <pj...@wa...> Date: Fri Dec 5 13:47:19 2025 +0100 Darwin: no need to turn off alignment assert in leak check Mixed up 2 files with previous commit. This also contains a missing proto and the previous commit fixes issues with badly formed segments. Needs more investigation. Diff: --- coregrind/m_debuginfo/priv_readmacho.h | 3 +++ memcheck/mc_main.c | 14 -------------- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/coregrind/m_debuginfo/priv_readmacho.h b/coregrind/m_debuginfo/priv_readmacho.h index 5ff5d048ce..c945d9b185 100644 --- a/coregrind/m_debuginfo/priv_readmacho.h +++ b/coregrind/m_debuginfo/priv_readmacho.h @@ -37,6 +37,9 @@ it. Also count the number of RW segements. */ extern Bool ML_(check_macho_and_get_rw_loads)( Int fd, Int* rw_loads ); +/* Same as above, but reads from memory instead of a file descriptor. */ +extern Bool ML_(check_macho_and_get_rw_loads_from_memory)( const void* buf, SizeT size, Int* rw_loads ); + /* The central function for reading Mach-O debug info. For the object/exe specified by the DebugInfo, find Mach-O sections, then read the symbols, line number info, file name info, CFA (stack-unwind diff --git a/memcheck/mc_main.c b/memcheck/mc_main.c index d4ac9fc202..d6c14923c5 100644 --- a/memcheck/mc_main.c +++ b/memcheck/mc_main.c @@ -5893,21 +5893,7 @@ Bool MC_(is_within_valid_secondary) ( Addr a ) Bool MC_(is_valid_aligned_word) ( Addr a ) { tl_assert(sizeof(UWord) == 4 || sizeof(UWord) == 8); -#if defined(VGO_darwin) - // on Darwin some of the memcheck/tests/leak-autofreepool-* - // tests are failing here. VALGRIND_MALLOCLIKE_BLOCK is passed - // an address that is not word aligned. But that's also the case - // on other platforms, on FreeBSD leak-autofreepool 0 uses addresses - // that are only 2 aligned. The problem is more likely that Darwin - // should not be looking at this chunk of memory. - if (!VG_IS_WORD_ALIGNED(a) && VG_(clo_verbosity) > 1) - { - VG_(printf)("In %s, invariant violation, pointer %p should be word aligned\n", __func__, (void*)a); - MC_(pp_describe_addr) (VG_(current_DiEpoch)(), a); - } -#else tl_assert(VG_IS_WORD_ALIGNED(a)); -#endif if (get_vabits8_for_aligned_word32 (a) != VA_BITS8_DEFINED) return False; if (sizeof(UWord) == 8) { |
|
From: Paul F. <pa...@so...> - 2025-12-05 12:45:56
|
https://sourceware.org/cgit/valgrind/commit/?id=a68eb0348e8ee91411898bd2e3d74205e41fb5b1 commit a68eb0348e8ee91411898bd2e3d74205e41fb5b1 Author: Paul Floyd <pj...@wa...> Date: Fri Dec 5 13:44:41 2025 +0100 Darwin: add a couple of missing function prototypes Diff: --- coregrind/m_aspacemgr/aspacemgr-linux.c | 55 +++++++++++++++++++++++++++++++-- coregrind/m_debuginfo/priv_image.h | 2 ++ 2 files changed, 55 insertions(+), 2 deletions(-) diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index d5715c4448..3bc5cb0441 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -864,6 +864,7 @@ static void sync_check_mapping_callback ( Addr addr, SizeT len, UInt prot, #if defined(VGO_darwin) // GrP fixme kernel info doesn't have dev/inode + // FIXME PJF but now ino is being used for vm tag cmp_devino = False; // GrP fixme V and kernel don't agree on offsets @@ -1473,8 +1474,9 @@ static void add_segment ( const NSegment* seg ) Addr sEnd = seg->end; #if defined(VGO_darwin) - // FIXME: the cast is unfortunate but I don't want to change every callsite to call 2 functions - fill_segment((NSegment*) (Addr) seg); + // FIXME: adding for all segments causes some failures and alignment crashes in leak check + // need to debug more + //fill_segment((NSegment*) (Addr) seg); #endif aspacem_assert(sStart <= sEnd); @@ -1611,6 +1613,10 @@ static void read_maps_callback ( Addr addr, SizeT len, UInt prot, seg.fnIdx = ML_(am_allocate_segname)( filename ); if (0) show_nsegment( 2,0, &seg ); +#if defined(VGO_darwin) + // FIXME this is the one that causes problems with leak checks + //fill_segment( &seg ); +#endif add_segment( &seg ); } @@ -1923,10 +1929,16 @@ Addr VG_(am_startup) ( Addr sp_at_startup ) if (aspacem_cStart > Addr_MIN) { init_resvn(&seg, Addr_MIN, aspacem_cStart-1); +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment(&seg); } if (aspacem_maxAddr < Addr_MAX) { init_resvn(&seg, aspacem_maxAddr+1, Addr_MAX); +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment(&seg); } @@ -1936,6 +1948,9 @@ Addr VG_(am_startup) ( Addr sp_at_startup ) valgrind allocations at the boundary, this is kind of necessary in order to get it to start allocating in the right place. */ init_resvn(&seg, aspacem_vStart, aspacem_vStart + VKI_PAGE_SIZE - 1); +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment(&seg); VG_(am_show_nsegments)(2, "Initial layout"); @@ -2323,6 +2338,9 @@ VG_(am_notify_client_mmap)( Addr a, SizeT len, UInt prot, UInt flags, seg.isFF = (flags & VKI_MAP_FIXED); #endif } +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; return needDiscard; @@ -2354,6 +2372,9 @@ VG_(am_notify_client_shmat)( Addr a, SizeT len, UInt prot ) seg.hasR = toBool(prot & VKI_PROT_READ); seg.hasW = toBool(prot & VKI_PROT_WRITE); seg.hasX = toBool(prot & VKI_PROT_EXEC); +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; return needDiscard; @@ -2454,6 +2475,9 @@ Bool VG_(am_notify_munmap)( Addr start, SizeT len ) else seg.kind = SkFree; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); /* Unmapping could create two adjacent free segments, so a preen is @@ -2565,6 +2589,9 @@ SysRes VG_(am_mmap_named_file_fixed_client_flags) } #if defined(VGO_freebsd) seg.isFF = (flags & VKI_MAP_FIXED); +#endif +#if defined(VGO_darwin) + fill_segment( &seg ); #endif add_segment( &seg ); @@ -2624,6 +2651,9 @@ SysRes VG_(am_mmap_anon_fixed_client) ( Addr start, SizeT length, UInt prot ) seg.hasR = toBool(prot & VKI_PROT_READ); seg.hasW = toBool(prot & VKI_PROT_WRITE); seg.hasX = toBool(prot & VKI_PROT_EXEC); +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; @@ -2683,6 +2713,9 @@ static SysRes am_mmap_anon_float_client ( SizeT length, Int prot, Bool isCH ) seg.hasW = toBool(prot & VKI_PROT_WRITE); seg.hasX = toBool(prot & VKI_PROT_EXEC); seg.isCH = isCH; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; @@ -2785,6 +2818,9 @@ SysRes VG_(am_mmap_anon_float_valgrind)( SizeT length ) seg.hasR = True; seg.hasW = True; seg.hasX = True; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; @@ -2877,6 +2913,9 @@ static SysRes VG_(am_mmap_file_float_valgrind_flags) ( SizeT length, UInt prot, } #if defined(VGO_freebsd) seg.isFF = (flags & VKI_MAP_FIXED); +#endif +#if defined(VGO_darwin) + fill_segment( &seg ); #endif add_segment( &seg ); @@ -3099,6 +3138,9 @@ Bool VG_(am_create_reservation) ( Addr start, SizeT length, reservation. */ seg.end = end1; seg.smode = smode; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; @@ -3272,6 +3314,9 @@ const NSegment *VG_(am_extend_map_client)( Addr addr, SizeT delta ) NSegment seg_copy = *seg; seg_copy.end += delta; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg_copy ); if (0) @@ -3345,6 +3390,9 @@ Bool VG_(am_relocate_nooverlap_client)( /*OUT*/Bool* need_discard, } seg.start = new_addr; seg.end = new_addr + new_len - 1; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); /* Create a free hole in the old location. */ @@ -3360,6 +3408,9 @@ Bool VG_(am_relocate_nooverlap_client)( /*OUT*/Bool* need_discard, else seg.kind = SkFree; +#if defined(VGO_darwin) + fill_segment( &seg ); +#endif add_segment( &seg ); AM_SANITY_CHECK; diff --git a/coregrind/m_debuginfo/priv_image.h b/coregrind/m_debuginfo/priv_image.h index 90de98dfc5..56dfbb85d3 100644 --- a/coregrind/m_debuginfo/priv_image.h +++ b/coregrind/m_debuginfo/priv_image.h @@ -61,6 +61,8 @@ DiImage* ML_(img_from_local_file)(const HChar* fullpath); DiImage* ML_(img_from_fd)(Int fd, const HChar* fullpath); +DiImage* ML_(img_from_memory)(Addr a, SizeT len, const HChar* fullpath); + /* Create an image by connecting to a Valgrind debuginfo server (auxprogs/valgrind-di-server.c). |filename| contains the object name to ask for; it must be a plain filename, not absolute, not a |
|
From: Florian K. <fk...@so...> - 2025-12-04 20:39:02
|
https://sourceware.org/cgit/valgrind/commit/?id=b08a821fc0b6030f49e80be759cf6907f7a62ce0 commit b08a821fc0b6030f49e80be759cf6907f7a62ce0 Author: Florian Krohm <fl...@ei...> Date: Thu Dec 4 20:38:24 2025 +0000 arm: Remove global arm_hwcaps and one FIXME. Followup to cd9d7d0d2edeef5ef37582c6d6fa55ca3c3bcccd Diff: --- VEX/priv/host_arm_defs.c | 4 +++- VEX/priv/host_arm_defs.h | 3 --- VEX/priv/host_arm_isel.c | 3 --- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/VEX/priv/host_arm_defs.c b/VEX/priv/host_arm_defs.c index a838565a20..3ca8b22a5d 100644 --- a/VEX/priv/host_arm_defs.c +++ b/VEX/priv/host_arm_defs.c @@ -39,7 +39,7 @@ #include "host_generic_regs.h" #include "host_arm_defs.h" -UInt arm_hwcaps = 0; +static UInt arm_hwcaps; /* --------- Registers. --------- */ @@ -3080,6 +3080,8 @@ Int emit_ARMInstr ( /*MB_MOD*/Bool* is_profInc, vassert(mode64 == False); vassert(0 == (((HWord)buf) & 3)); + arm_hwcaps = archinfo_host->hwcaps; + switch (i->tag) { case ARMin_Alu: { UInt instr, subopc; diff --git a/VEX/priv/host_arm_defs.h b/VEX/priv/host_arm_defs.h index d6dbc4ee27..b8399075d9 100644 --- a/VEX/priv/host_arm_defs.h +++ b/VEX/priv/host_arm_defs.h @@ -32,9 +32,6 @@ #include "libvex.h" // VexArch #include "host_generic_regs.h" // HReg -extern UInt arm_hwcaps; - - /* --------- Registers. --------- */ #define ST_IN static inline diff --git a/VEX/priv/host_arm_isel.c b/VEX/priv/host_arm_isel.c index 90bc699fc4..71bf871c4f 100644 --- a/VEX/priv/host_arm_isel.c +++ b/VEX/priv/host_arm_isel.c @@ -6553,9 +6553,6 @@ HInstrArray* iselSB_ARM ( const IRSB* bb, /* guard against unexpected space regressions */ vassert(sizeof(ARMInstr) <= 28); - /* hwcaps should not change from one ISEL call to another. */ - arm_hwcaps = hwcaps_host; // JRS 2012 Mar 31: FIXME (RM) - /* Make up an initial environment to use. */ env = LibVEX_Alloc_inline(sizeof(ISelEnv)); env->vreg_ctr = 0; |
|
From: Martin C. <mc...@so...> - 2025-12-04 13:01:56
|
https://sourceware.org/cgit/valgrind/commit/?id=37d9e2085e0ac28a3fa807670c1055bdadb5f773 commit 37d9e2085e0ac28a3fa807670c1055bdadb5f773 Author: Martin Cermak <mc...@re...> Date: Thu Dec 4 14:00:59 2025 +0100 Add ARG4 checks for quotactl and quotactl_fd syswraps ARG4 can point to different things of varion sizes based on the cmd arg. Handle all the possible options and provide missing checks. https://bugs.kde.org/show_bug.cgi?id=509634 Diff: --- NEWS | 1 + coregrind/m_syswrap/syswrap-amd64-linux.c | 4 +- coregrind/m_syswrap/syswrap-arm-linux.c | 4 +- coregrind/m_syswrap/syswrap-arm64-linux.c | 4 +- coregrind/m_syswrap/syswrap-linux.c | 131 +++++++++++++++++++++++++-- coregrind/m_syswrap/syswrap-mips32-linux.c | 4 +- coregrind/m_syswrap/syswrap-mips64-linux.c | 8 +- coregrind/m_syswrap/syswrap-nanomips-linux.c | 2 +- coregrind/m_syswrap/syswrap-ppc32-linux.c | 4 +- coregrind/m_syswrap/syswrap-ppc64-linux.c | 4 +- coregrind/m_syswrap/syswrap-riscv64-linux.c | 4 +- coregrind/m_syswrap/syswrap-s390x-linux.c | 4 +- coregrind/m_syswrap/syswrap-x86-linux.c | 4 +- include/vki/vki-linux.h | 51 +++++++++++ 14 files changed, 199 insertions(+), 30 deletions(-) diff --git a/NEWS b/NEWS index 6068d611d4..0731634f8c 100644 --- a/NEWS +++ b/NEWS @@ -256,6 +256,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 509572 s390x: Overhaul BFP testsuite 509590 Run the LTP tests with LTP_QUIET 509567 unhandled amd64-linux syscall: 443 (quotactl_fd) +509634 Add ARG4 checks for quotactl and quotactl_fd syswraps 509642 Add missing ppc64-linux syswraps 509643 Add missing s390x-linux syswraps 510169 Update the LTP version in valgrind testsuite to 20250930 diff --git a/coregrind/m_syswrap/syswrap-amd64-linux.c b/coregrind/m_syswrap/syswrap-amd64-linux.c index 5dccb47b3e..a6e76690ad 100644 --- a/coregrind/m_syswrap/syswrap-amd64-linux.c +++ b/coregrind/m_syswrap/syswrap-amd64-linux.c @@ -684,7 +684,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_delete_module, sys_delete_module), // 176 // (__NR_get_kernel_syms, sys_ni_syscall), // 177 // (__NR_query_module, sys_ni_syscall), // 178 - LINX_(__NR_quotactl, sys_quotactl), // 179 + LINXY(__NR_quotactl, sys_quotactl), // 179 // (__NR_nfsservctl, sys_nfsservctl), // 180 // (__NR_getpmsg, sys_ni_syscall), // 181 @@ -896,7 +896,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-arm-linux.c b/coregrind/m_syswrap/syswrap-arm-linux.c index af3ec18ddf..b7860710c4 100644 --- a/coregrind/m_syswrap/syswrap-arm-linux.c +++ b/coregrind/m_syswrap/syswrap-arm-linux.c @@ -708,7 +708,7 @@ static SyscallTableEntry syscall_main_table[] = { //zz //zz // Nb: get_kernel_syms() was removed 2.4-->2.6 // GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130 - LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY(__NR_quotactl, sys_quotactl), // 131 GENX_(__NR_getpgid, sys_getpgid), // 132 GENX_(__NR_fchdir, sys_fchdir), // 133 //zz // (__NR_bdflush, sys_bdflush), // 134 */Linux @@ -1068,7 +1068,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_(__NR_faccessat2, sys_faccessat2), // 439 LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-arm64-linux.c b/coregrind/m_syswrap/syswrap-arm64-linux.c index 05a39ed07f..890bb7b8f9 100644 --- a/coregrind/m_syswrap/syswrap-arm64-linux.c +++ b/coregrind/m_syswrap/syswrap-arm64-linux.c @@ -608,7 +608,7 @@ static SyscallTableEntry syscall_main_table[] = { GENX_(__NR_close, sys_close), // 57 LINX_(__NR_vhangup, sys_vhangup), // 58 LINXY(__NR_pipe2, sys_pipe2), // 59 - LINX_(__NR_quotactl, sys_quotactl), // 60 + LINXY(__NR_quotactl, sys_quotactl), // 60 GENXY(__NR_getdents64, sys_getdents64), // 61 LINX_(__NR_lseek, sys_lseek), // 62 GENXY(__NR_read, sys_read), // 63 @@ -847,7 +847,7 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-linux.c b/coregrind/m_syswrap/syswrap-linux.c index e17aff6a43..3bfbef7614 100644 --- a/coregrind/m_syswrap/syswrap-linux.c +++ b/coregrind/m_syswrap/syswrap-linux.c @@ -2655,19 +2655,19 @@ PRE(sys_io_destroy) } static -void common_pre_io_getevents(ThreadId tid, UWord a1, UWord a2, UWord a3, UWord a4, UWord a5, UWord a6, UWord* flags, const HChar* funtion_name) +void common_pre_io_getevents(ThreadId tid, UWord a1, UWord a2, UWord a3, UWord a4, UWord a5, UWord a6, UWord* flags, const HChar* function_name) { HChar buf[25]; *flags |= SfMayBlock; PRINT("sys_%s ( %llu, %lld, %lld, %#" FMT_REGWORD "x, %#" - FMT_REGWORD "x )", funtion_name, + FMT_REGWORD "x )", function_name, (ULong)a1,(Long)a2,(Long)a3,a4,a5); if (a3 > 0) { - VG_(snprintf)(buf, 25, "%s(events)", funtion_name); + VG_(snprintf)(buf, 25, "%s(events)", function_name); PRE_MEM_WRITE( buf, a4, sizeof(struct vki_io_event)*a3 ); } if (a5 != 0) { - VG_(snprintf)(buf, 25, "%s(timeout)", funtion_name); + VG_(snprintf)(buf, 25, "%s(timeout)", function_name); PRE_MEM_READ( buf, a5, sizeof(struct vki_timespec)); } @@ -2688,7 +2688,7 @@ PRE(sys_io_getevents) } static -void common_post_sys_io_events(ThreadId tid, UWord a4, SyscallStatus* status, const HChar* funtion_name) +void common_post_sys_io_events(ThreadId tid, UWord a4, SyscallStatus* status, const HChar* function_name) { Int i; vg_assert(SUCCESS); @@ -2736,7 +2736,7 @@ void common_post_sys_io_events(ThreadId tid, UWord a4, SyscallStatus* status, co default: VG_(message)(Vg_DebugMsg, "Warning: unhandled %s opcode: %u\n", - funtion_name, + function_name, cb->aio_lio_opcode); break; } @@ -4125,14 +4125,124 @@ POST(sys_dup3) ML_(record_fd_open_named)(tid, RES); } +static +void common_pre_quotactl_p4_check(ThreadId tid, Int subop, Int a4, SyscallStatus* status, const HChar* function_name) +{ + HChar buf[25]; + VG_(snprintf)(buf, sizeof(buf), "%s(addr)", function_name); + switch (subop) { + case VKI_Q_QUOTAON: + // The addr argument points to the pathname of a file + // containing the quotas for the filesystem. + PRE_MEM_RASCIIZ( buf, a4 ); + break; + case VKI_Q_QUOTAOFF: + // The addr and id arguments are ignored. + break; + case VKI_Q_GETQUOTA: + // Get disk quota limits and current usage for user or group id. The + // addr argument is a pointer to a dqblk structure defined in + // <sys/quota.h> as follows: + if (a4 != 0) + PRE_MEM_WRITE(buf, a4, sizeof(struct vki_dqblk)); + break; + case VKI_Q_GETNEXTQUOTA: + // The addr argument is a pointer to a nextdqblk structure + // whose fields are as for the dqblk, except for the addition + // of a dqb_id field that is used to return the ID for which + // quota information is being returned: + if (a4 != 0) + PRE_MEM_WRITE(buf, a4, sizeof(struct vki_nextdqblk)); + break; + case VKI_Q_SETQUOTA: + // Set quota information for user or group id, using the + // information supplied in the dqblk structure pointed to by + // addr. + if (a4 != 0) + PRE_MEM_READ(buf, a4, sizeof(struct vki_dqblk)); + break; + case VKI_Q_GETINFO: + // The addr argument should be a pointer to a dqinfo structure. + if (a4 != 0) + PRE_MEM_WRITE(buf, a4, sizeof(struct vki_dqinfo)); + break; + case VKI_Q_SETINFO: + // The addr argument should be a pointer to a dqinfo structure + if (a4 != 0) + PRE_MEM_READ(buf, a4, sizeof(struct vki_dqinfo)); + break; + case VKI_Q_GETFMT: + // The addr argument should be a pointer to a 4-byte buffer where the + // format number will be stored. + if (a4 != 0) + PRE_MEM_WRITE(buf, a4, 4); + break; + case VKI_Q_SYNC: + // The addr and id arguments are ignored. + break; + // case VKI_Q_GETSTATS: was only supported up to Linux 2.4.21 - skipping) + default: + return; + } +} + +static +void common_post_quotactl_p4_check(ThreadId tid, Int subop, Int a4, const HChar* function_name) +{ + switch (subop) { + case VKI_Q_GETQUOTA: + // Get disk quota limits and current usage for user or group id. The + // addr argument is a pointer to a dqblk structure defined in + // <sys/quota.h> as follows: + if (a4 != 0) + POST_MEM_WRITE(a4, sizeof(struct vki_dqblk)); + break; + case VKI_Q_GETNEXTQUOTA: + // The addr argument is a pointer to a nextdqblk structure + // whose fields are as for the dqblk, except for the addition + // of a dqb_id field that is used to return the ID for which + // quota information is being returned: + if (a4 != 0) + POST_MEM_WRITE(a4, sizeof(struct vki_nextdqblk)); + break; + case VKI_Q_GETINFO: + // The addr argument should be a pointer to a dqinfo structure. + if (a4 != 0) + POST_MEM_WRITE(a4, sizeof(struct vki_dqinfo)); + break; + case VKI_Q_GETFMT: + // The addr argument should be a pointer to a 4-byte buffer where the + // format number will be stored. + if (a4 != 0) + POST_MEM_WRITE(a4, 4); + break; + // case VKI_Q_GETSTATS: was only supported up to Linux 2.4.21 - skipping) + default: + return; + } +} + + PRE(sys_quotactl) { + // SYSCALL_DEFINE4(quotactl, + // unsigned int, cmd, + // const char __user *, special, + // qid_t, id, + // void __user *, addr) + Int subop = ARG1 >> VKI_SUBCMDSHIFT; PRINT("sys_quotactl (0x%" FMT_REGWORD "x, %#" FMT_REGWORD "x, 0x%" FMT_REGWORD "x, 0x%" FMT_REGWORD "x )", ARG1, ARG2, ARG3, ARG4); PRE_REG_READ4(long, "quotactl", unsigned int, cmd, const char *, special, vki_qid_t, id, void *, addr); PRE_MEM_RASCIIZ( "quotactl(special)", ARG2 ); + common_pre_quotactl_p4_check(tid, subop, ARG4, status, "quotactl"); +} +POST(sys_quotactl) +{ + Int subop = ARG1 >> VKI_SUBCMDSHIFT; + common_post_quotactl_p4_check(tid, subop, ARG4, "quotactl"); } PRE(sys_quotactl_fd) @@ -4142,13 +4252,20 @@ PRE(sys_quotactl_fd) // unsigned int, cmd, // qid_t, id, // void __user *, addr) - PRINT("sys_quotactl (0x%" FMT_REGWORD "x, 0x%#" FMT_REGWORD "x, 0x%" + Int subop = ARG2 >> VKI_SUBCMDSHIFT; + PRINT("sys_quotactl_fd (0x%" FMT_REGWORD "x, 0x%#" FMT_REGWORD "x, 0x%" FMT_REGWORD "x, 0x%" FMT_REGWORD "x )", ARG1, ARG2, ARG3, ARG4); PRE_REG_READ4(long, "quotactl_fd", unsigned int, fd, unsigned int, cmd, vki_qid_t, id, void *, addr); if (!ML_(fd_allowed)(ARG1, "quotactl_fd", tid, False)) SET_STATUS_Failure( VKI_EBADF ); + common_pre_quotactl_p4_check(tid, subop, ARG4, status, "quotactl_fd"); +} +POST(sys_quotactl_fd) +{ + Int subop = ARG2 >> VKI_SUBCMDSHIFT; + common_post_quotactl_p4_check(tid, subop, ARG4, "quotactl_fd"); } PRE(sys_waitid) diff --git a/coregrind/m_syswrap/syswrap-mips32-linux.c b/coregrind/m_syswrap/syswrap-mips32-linux.c index 1262449250..5541f4c723 100644 --- a/coregrind/m_syswrap/syswrap-mips32-linux.c +++ b/coregrind/m_syswrap/syswrap-mips32-linux.c @@ -896,7 +896,7 @@ static SyscallTableEntry syscall_main_table[] = { //.. GENX_(__NR_init_module, sys_init_module), // 128 //.. // (__NR_delete_module, sys_delete_module), // 129 //.. GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130 - //.. LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY (__NR_quotactl, sys_quotactl), // 131 GENX_ (__NR_getpgid, sys_getpgid), // 132 GENX_ (__NR_fchdir, sys_fchdir), // 133 //.. // (__NR_bdflush, sys_bdflush), // 134 @@ -1178,7 +1178,7 @@ static SyscallTableEntry syscall_main_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), // 446 diff --git a/coregrind/m_syswrap/syswrap-mips64-linux.c b/coregrind/m_syswrap/syswrap-mips64-linux.c index f39bb58cc1..57a522d87a 100644 --- a/coregrind/m_syswrap/syswrap-mips64-linux.c +++ b/coregrind/m_syswrap/syswrap-mips64-linux.c @@ -644,7 +644,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_ (__NR_delete_module, sys_delete_module), GENX_ (__NR_get_kernel_syms, sys_ni_syscall), GENX_ (__NR_query_module, sys_ni_syscall), - LINX_ (__NR_quotactl, sys_quotactl), + LINXY (__NR_quotactl, sys_quotactl), /* GENX_(__NR_nfsservctl,sys_nfsservctl), */ GENXY (__NR_getpmsg, sys_getpmsg), GENX_ (__NR_putpmsg, sys_putpmsg), @@ -799,9 +799,9 @@ static SyscallTableEntry syscall_main_table[] = { LINXY (__NR_listmount, sys_listmount), LINX_ (__NR_mseal, sys_mseal), LINX_ (__NR_futex_waitv, sys_futex_waitv), - LINX_ (__NR_quotactl_fd, sys_quotactl_fd), - LINXY(__NR_file_getattr, sys_file_getattr), - LINX_(__NR_file_setattr, sys_file_setattr), + LINXY (__NR_quotactl_fd, sys_quotactl_fd), + LINXY (__NR_file_getattr, sys_file_getattr), + LINX_ (__NR_file_setattr, sys_file_setattr), }; SyscallTableEntry * ML_(get_linux_syscall_entry) ( UInt sysno ) diff --git a/coregrind/m_syswrap/syswrap-nanomips-linux.c b/coregrind/m_syswrap/syswrap-nanomips-linux.c index 00bd2e756e..ac4d6aa7e6 100644 --- a/coregrind/m_syswrap/syswrap-nanomips-linux.c +++ b/coregrind/m_syswrap/syswrap-nanomips-linux.c @@ -592,7 +592,7 @@ static SyscallTableEntry syscall_main_table[] = { GENX_ (__NR_close, sys_close), LINX_ (__NR_vhangup, sys_vhangup), LINXY (__NR_pipe2, sys_pipe2), - LINX_ (__NR_quotactl, sys_quotactl), + LINXY (__NR_quotactl, sys_quotactl), GENXY (__NR_getdents64, sys_getdents64), LINXY (__NR__llseek, sys_llseek), GENXY (__NR_read, sys_read), diff --git a/coregrind/m_syswrap/syswrap-ppc32-linux.c b/coregrind/m_syswrap/syswrap-ppc32-linux.c index 99f71b7a66..d3b84a57d5 100644 --- a/coregrind/m_syswrap/syswrap-ppc32-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc32-linux.c @@ -770,7 +770,7 @@ static SyscallTableEntry syscall_table[] = { //.. //.. // Nb: get_kernel_syms() was removed 2.4-->2.6 //.. GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130 -//.. LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY(__NR_quotactl, sys_quotactl), // 131 GENX_(__NR_getpgid, sys_getpgid), // 132 GENX_(__NR_fchdir, sys_fchdir), // 133 //.. // (__NR_bdflush, sys_bdflush), // 134 */Linux @@ -1076,7 +1076,7 @@ static SyscallTableEntry syscall_table[] = { LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_ (__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_ (__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY (__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-ppc64-linux.c b/coregrind/m_syswrap/syswrap-ppc64-linux.c index e8996b6b78..56b16bb8fb 100644 --- a/coregrind/m_syswrap/syswrap-ppc64-linux.c +++ b/coregrind/m_syswrap/syswrap-ppc64-linux.c @@ -757,7 +757,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_delete_module, sys_delete_module), // 129 // _____(__NR_get_kernel_syms, sys_get_kernel_syms), // 130 - LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY(__NR_quotactl, sys_quotactl), // 131 GENX_(__NR_getpgid, sys_getpgid), // 132 GENX_(__NR_fchdir, sys_fchdir), // 133 // _____(__NR_bdflush, sys_bdflush), // 134 @@ -1054,7 +1054,7 @@ static SyscallTableEntry syscall_table[] = { LINXY (__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_ (__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_ (__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY (__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-riscv64-linux.c b/coregrind/m_syswrap/syswrap-riscv64-linux.c index 3dbae3cb67..3774c797e8 100644 --- a/coregrind/m_syswrap/syswrap-riscv64-linux.c +++ b/coregrind/m_syswrap/syswrap-riscv64-linux.c @@ -368,7 +368,7 @@ static SyscallTableEntry syscall_main_table[] = { GENX_(__NR_close, sys_close), /* 57 */ LINX_(__NR_vhangup, sys_vhangup), /* 58 */ LINXY(__NR_pipe2, sys_pipe2), /* 59 */ - LINX_(__NR_quotactl, sys_quotactl), /* 60 */ + LINXY(__NR_quotactl, sys_quotactl), /* 60 */ GENXY(__NR_getdents64, sys_getdents64), /* 61 */ LINX_(__NR_lseek, sys_lseek), /* 62 */ GENXY(__NR_read, sys_read), /* 63 */ @@ -598,7 +598,7 @@ static SyscallTableEntry syscall_main_table[] = { LINX_(__NR_faccessat2, sys_faccessat2), /* 439 */ LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), /* 441 */ LINX_(__NR_mount_setattr, sys_mount_setattr), /* 442 */ - LINX_(__NR_quotactl_fd, sys_quotactl_fd), /* 443 */ + LINXY(__NR_quotactl_fd, sys_quotactl_fd), /* 443 */ LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), /* 444 */ LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), /* 445 */ LINX_(__NR_landlock_restrict_self, sys_landlock_restrict_self), /* 446 */ diff --git a/coregrind/m_syswrap/syswrap-s390x-linux.c b/coregrind/m_syswrap/syswrap-s390x-linux.c index d96adecde3..8d45a55b11 100644 --- a/coregrind/m_syswrap/syswrap-s390x-linux.c +++ b/coregrind/m_syswrap/syswrap-s390x-linux.c @@ -568,7 +568,7 @@ static SyscallTableEntry syscall_table[] = { LINX_(__NR_delete_module, sys_delete_module), // 129 GENX_(130, sys_ni_syscall), /* unimplemented (by the kernel) */ // 130 - LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY(__NR_quotactl, sys_quotactl), // 131 GENX_(__NR_getpgid, sys_getpgid), // 132 GENX_(__NR_fchdir, sys_fchdir), // 133 // ?????(__NR_bdflush, ), // 134 @@ -887,7 +887,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/coregrind/m_syswrap/syswrap-x86-linux.c b/coregrind/m_syswrap/syswrap-x86-linux.c index a83c02b046..b6224321f3 100644 --- a/coregrind/m_syswrap/syswrap-x86-linux.c +++ b/coregrind/m_syswrap/syswrap-x86-linux.c @@ -1316,7 +1316,7 @@ static SyscallTableEntry syscall_table[] = { //zz //zz // Nb: get_kernel_syms() was removed 2.4-->2.6 GENX_(__NR_get_kernel_syms, sys_ni_syscall), // 130 - LINX_(__NR_quotactl, sys_quotactl), // 131 + LINXY(__NR_quotactl, sys_quotactl), // 131 GENX_(__NR_getpgid, sys_getpgid), // 132 GENX_(__NR_fchdir, sys_fchdir), // 133 //zz // (__NR_bdflush, sys_bdflush), // 134 */Linux @@ -1677,7 +1677,7 @@ static SyscallTableEntry syscall_table[] = { LINXY(__NR_epoll_pwait2, sys_epoll_pwait2), // 441 LINX_(__NR_mount_setattr, sys_mount_setattr), // 442 - LINX_(__NR_quotactl_fd, sys_quotactl_fd), // 443 + LINXY(__NR_quotactl_fd, sys_quotactl_fd), // 443 LINXY(__NR_landlock_create_ruleset, sys_landlock_create_ruleset), // 444 LINX_(__NR_landlock_add_rule, sys_landlock_add_rule), // 445 diff --git a/include/vki/vki-linux.h b/include/vki/vki-linux.h index 48aacea22f..e0636378c4 100644 --- a/include/vki/vki-linux.h +++ b/include/vki/vki-linux.h @@ -5610,6 +5610,57 @@ struct vki_file_attr { __vki_u32 fa_cowextsize; /* CoW extsize field value (get/set) */ }; +//---------------------------------------------------------------------- +// From uapi/linux/mount.h +//---------------------------------------------------------------------- + +#define VKI_SUBCMDMASK 0x00ff +#define VKI_SUBCMDSHIFT 8 + +#define VKI_Q_SYNC 0x800001 /* sync disk copy of a filesystems quotas */ +#define VKI_Q_QUOTAON 0x800002 /* turn quotas on */ +#define VKI_Q_QUOTAOFF 0x800003 /* turn quotas off */ +#define VKI_Q_GETFMT 0x800004 /* get quota format used on given filesystem */ +#define VKI_Q_GETINFO 0x800005 /* get information about quota files */ +#define VKI_Q_SETINFO 0x800006 /* set information about quota files */ +#define VKI_Q_GETQUOTA 0x800007 /* get user quota structure */ +#define VKI_Q_SETQUOTA 0x800008 /* set user quota structure */ +#define VKI_Q_GETNEXTQUOTA 0x800009 /* get disk limits and usage >= ID */ + +struct vki_dqblk + { + __vki_u64 dqb_bhardlimit; /* absolute limit on disk quota blocks alloc */ + __vki_u64 dqb_bsoftlimit; /* preferred limit on disk quota blocks */ + __vki_u64 dqb_curspace; /* current quota block count */ + __vki_u64 dqb_ihardlimit; /* maximum # allocated inodes */ + __vki_u64 dqb_isoftlimit; /* preferred inode limit */ + __vki_u64 dqb_curinodes; /* current # allocated inodes */ + __vki_u64 dqb_btime; /* time limit for excessive disk use */ + __vki_u64 dqb_itime; /* time limit for excessive files */ + __vki_u32 dqb_valid; /* bitmask of QIF_* constants */ + }; + + +struct vki_nextdqblk { + __vki_u64 dqb_bhardlimit; + __vki_u64 dqb_bsoftlimit; + __vki_u64 dqb_curspace; + __vki_u64 dqb_ihardlimit; + __vki_u64 dqb_isoftlimit; + __vki_u64 dqb_curinodes; + __vki_u64 dqb_btime; + __vki_u64 dqb_itime; + __vki_u32 dqb_valid; + __vki_u32 dqb_id; +}; + +struct vki_dqinfo { + __vki_u64 dqi_bgrace; + __vki_u64 dqi_igrace; + __vki_u32 dqi_flags; /* DFQ_* */ + __vki_u32 dqi_valid; +}; + /*--------------------------------------------------------------------*/ /*--- end ---*/ /*--------------------------------------------------------------------*/ |
|
From: Florian K. <fk...@so...> - 2025-12-03 22:29:52
|
https://sourceware.org/cgit/valgrind/commit/?id=cd9d7d0d2edeef5ef37582c6d6fa55ca3c3bcccd commit cd9d7d0d2edeef5ef37582c6d6fa55ca3c3bcccd Author: Florian Krohm <fl...@ei...> Date: Wed Dec 3 22:26:57 2025 +0000 Change the data type of libvex_Backend::emit. Both the s390 and arm insn emitters need to know the host's hardware capabilities. Today, these are provided by means of global variables s390_host_hwcaps and arm_hwcaps. To eliminate that kludge the emit function is changed. Instead of passing VexEndness we now pass a pointer to VexArchInfo which provides both the endianess and hardware capabilities. Those global variables will be removed in a followup patch. Diff: --- VEX/priv/host_amd64_defs.c | 2 +- VEX/priv/host_amd64_defs.h | 2 +- VEX/priv/host_arm64_defs.c | 2 +- VEX/priv/host_arm64_defs.h | 2 +- VEX/priv/host_arm_defs.c | 2 +- VEX/priv/host_arm_defs.h | 2 +- VEX/priv/host_mips_defs.c | 2 +- VEX/priv/host_mips_defs.h | 2 +- VEX/priv/host_nanomips_defs.c | 2 +- VEX/priv/host_nanomips_defs.h | 2 +- VEX/priv/host_ppc_defs.c | 3 ++- VEX/priv/host_ppc_defs.h | 2 +- VEX/priv/host_riscv64_defs.c | 2 +- VEX/priv/host_riscv64_defs.h | 2 +- VEX/priv/host_s390_defs.c | 2 +- VEX/priv/host_s390_defs.h | 2 +- VEX/priv/host_x86_defs.c | 2 +- VEX/priv/host_x86_defs.h | 2 +- VEX/priv/main_main.c | 8 ++++---- 19 files changed, 23 insertions(+), 22 deletions(-) diff --git a/VEX/priv/host_amd64_defs.c b/VEX/priv/host_amd64_defs.c index d7d1ab1aad..e834e82536 100644 --- a/VEX/priv/host_amd64_defs.c +++ b/VEX/priv/host_amd64_defs.c @@ -2592,7 +2592,7 @@ static UChar* do_ffree_st ( UChar* p, Int n ) Int emit_AMD64Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const AMD64Instr* i, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_amd64_defs.h b/VEX/priv/host_amd64_defs.h index 4c16db17bf..731fd2efd3 100644 --- a/VEX/priv/host_amd64_defs.h +++ b/VEX/priv/host_amd64_defs.h @@ -836,7 +836,7 @@ extern Int emit_AMD64Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const AMD64Instr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_arm64_defs.c b/VEX/priv/host_arm64_defs.c index da52748eb9..b00aad94d5 100644 --- a/VEX/priv/host_arm64_defs.c +++ b/VEX/priv/host_arm64_defs.c @@ -3627,7 +3627,7 @@ static UInt* do_load_or_store64 ( UInt* p, Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const ARM64Instr* i, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_arm64_defs.h b/VEX/priv/host_arm64_defs.h index 4f5b1bce3e..83bb6a286e 100644 --- a/VEX/priv/host_arm64_defs.h +++ b/VEX/priv/host_arm64_defs.h @@ -1115,7 +1115,7 @@ extern void mapRegs_ARM64Instr ( HRegRemap*, ARM64Instr*, Bool ); extern Int emit_ARM64Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const ARM64Instr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo *archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_arm_defs.c b/VEX/priv/host_arm_defs.c index 39d89f7e87..a838565a20 100644 --- a/VEX/priv/host_arm_defs.c +++ b/VEX/priv/host_arm_defs.c @@ -3069,7 +3069,7 @@ static UInt* do_load_or_store32 ( UInt* p, Int emit_ARMInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const ARMInstr* i, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_arm_defs.h b/VEX/priv/host_arm_defs.h index 904bd0c43c..d6dbc4ee27 100644 --- a/VEX/priv/host_arm_defs.h +++ b/VEX/priv/host_arm_defs.h @@ -1057,7 +1057,7 @@ extern void mapRegs_ARMInstr ( HRegRemap*, ARMInstr*, Bool ); extern Int emit_ARMInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const ARMInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_mips_defs.c b/VEX/priv/host_mips_defs.c index ad92c055c9..d018aac841 100644 --- a/VEX/priv/host_mips_defs.c +++ b/VEX/priv/host_mips_defs.c @@ -3768,7 +3768,7 @@ static UChar *mkMoveReg(UChar * p, UInt r_dst, UInt r_src) Int emit_MIPSInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const MIPSInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_mips_defs.h b/VEX/priv/host_mips_defs.h index 423f68ea09..838368b85c 100644 --- a/VEX/priv/host_mips_defs.h +++ b/VEX/priv/host_mips_defs.h @@ -1006,7 +1006,7 @@ extern void mapRegs_MIPSInstr (HRegRemap *, MIPSInstr *, Bool mode64); extern Int emit_MIPSInstr (/*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const MIPSInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_nanomips_defs.c b/VEX/priv/host_nanomips_defs.c index 3e91c904f6..19b4ee0fa4 100644 --- a/VEX/priv/host_nanomips_defs.c +++ b/VEX/priv/host_nanomips_defs.c @@ -1343,7 +1343,7 @@ Int emit_NANOMIPSInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const NANOMIPSInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_nanomips_defs.h b/VEX/priv/host_nanomips_defs.h index beb8084797..aa40b1e140 100644 --- a/VEX/priv/host_nanomips_defs.h +++ b/VEX/priv/host_nanomips_defs.h @@ -393,7 +393,7 @@ extern Int emit_NANOMIPSInstr (/*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const NANOMIPSInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_ppc_defs.c b/VEX/priv/host_ppc_defs.c index dfefcb3fd4..7dc9714572 100644 --- a/VEX/priv/host_ppc_defs.c +++ b/VEX/priv/host_ppc_defs.c @@ -4154,7 +4154,7 @@ static UChar* mkFormVA ( UChar* p, UInt opc1, UInt r1, UInt r2, */ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const PPCInstr* i, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, @@ -4167,6 +4167,7 @@ Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc, vex_printf("asm ");ppPPCInstr(i, mode64); vex_printf("\n"); } + VexEndness endness_host = archinfo_host->endness; switch (i->tag) { case Pin_LI: diff --git a/VEX/priv/host_ppc_defs.h b/VEX/priv/host_ppc_defs.h index c57afd50b5..df376e21c7 100644 --- a/VEX/priv/host_ppc_defs.h +++ b/VEX/priv/host_ppc_defs.h @@ -1269,7 +1269,7 @@ extern void mapRegs_PPCInstr ( HRegRemap*, PPCInstr* , Bool mode64); extern Int emit_PPCInstr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const PPCInstr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_riscv64_defs.c b/VEX/priv/host_riscv64_defs.c index 152d4ae92c..dcb1a968de 100644 --- a/VEX/priv/host_riscv64_defs.c +++ b/VEX/priv/host_riscv64_defs.c @@ -1774,7 +1774,7 @@ Int emit_RISCV64Instr(/*MB_MOD*/ Bool* is_profInc, Int nbuf, const RISCV64Instr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_riscv64_defs.h b/VEX/priv/host_riscv64_defs.h index 7a97f90ef4..97a8420f79 100644 --- a/VEX/priv/host_riscv64_defs.h +++ b/VEX/priv/host_riscv64_defs.h @@ -612,7 +612,7 @@ Int emit_RISCV64Instr(/*MB_MOD*/ Bool* is_profInc, Int nbuf, const RISCV64Instr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 04b06c4cfe..3479bbc91b 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -10896,7 +10896,7 @@ s390_insn_vec_replicate_emit(UChar *buf, const s390_insn *insn) Int emit_S390Instr(Bool *is_profinc, UChar *buf, Int nbuf, const s390_insn *insn, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo *archinfo, const void *disp_cp_chain_me_to_slowEP, const void *disp_cp_chain_me_to_fastEP, const void *disp_cp_xindir, diff --git a/VEX/priv/host_s390_defs.h b/VEX/priv/host_s390_defs.h index 48ea79f18d..a743abb501 100644 --- a/VEX/priv/host_s390_defs.h +++ b/VEX/priv/host_s390_defs.h @@ -885,7 +885,7 @@ UInt ppHRegS390(HReg); void getRegUsage_S390Instr( HRegUsage *, const s390_insn *, Bool ); void mapRegs_S390Instr ( HRegRemap *, s390_insn *, Bool ); Int emit_S390Instr ( Bool *, UChar *, Int, const s390_insn *, Bool, - VexEndness, const void *, const void *, + const VexArchInfo *, const void *, const void *, const void *, const void *); const RRegUniverse *getRRegUniverse_S390( void ); void genSpill_S390 ( HInstr **, HInstr **, HReg , Int , Bool ); diff --git a/VEX/priv/host_x86_defs.c b/VEX/priv/host_x86_defs.c index 200c122fd8..5b50d8a536 100644 --- a/VEX/priv/host_x86_defs.c +++ b/VEX/priv/host_x86_defs.c @@ -2122,7 +2122,7 @@ static UChar* push_word_from_tags ( UChar* p, UShort tags ) Int emit_X86Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const X86Instr* i, - Bool mode64, VexEndness endness_host, + Bool mode64, const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/host_x86_defs.h b/VEX/priv/host_x86_defs.h index ecd74e6a53..65cca18f6f 100644 --- a/VEX/priv/host_x86_defs.h +++ b/VEX/priv/host_x86_defs.h @@ -717,7 +717,7 @@ extern void mapRegs_X86Instr ( HRegRemap*, X86Instr*, Bool ); extern Int emit_X86Instr ( /*MB_MOD*/Bool* is_profInc, UChar* buf, Int nbuf, const X86Instr* i, Bool mode64, - VexEndness endness_host, + const VexArchInfo* archinfo_host, const void* disp_cp_chain_me_to_slowEP, const void* disp_cp_chain_me_to_fastEP, const void* disp_cp_xindir, diff --git a/VEX/priv/main_main.c b/VEX/priv/main_main.c index 32a78190ad..e979952853 100644 --- a/VEX/priv/main_main.c +++ b/VEX/priv/main_main.c @@ -780,9 +780,9 @@ static void libvex_BackEnd ( const VexTranslateArgs *vta, const VexAbiInfo*, Int, Int, Bool, Bool, Addr ); Int (*emit) ( /*MB_MOD*/Bool*, - UChar*, Int, const HInstr*, Bool, VexEndness, - const void*, const void*, const void*, - const void* ); + UChar*, Int, const HInstr*, Bool, + const VexArchInfo*, const void*, + const void*, const void*, const void* ); Bool (*preciseMemExnsFn) ( Int, Int, VexRegisterUpdates ); const RRegUniverse* rRegUniv = NULL; @@ -1232,7 +1232,7 @@ static void libvex_BackEnd ( const VexTranslateArgs *vta, } j = emit( &hi_isProfInc, insn_bytes, sizeof insn_bytes, hi, - mode64, vta->archinfo_host.endness, + mode64, &vta->archinfo_host, vta->disp_cp_chain_me_to_slowEP, vta->disp_cp_chain_me_to_fastEP, vta->disp_cp_xindir, |
|
From: Florian K. <fk...@so...> - 2025-12-03 17:16:24
|
https://sourceware.org/cgit/valgrind/commit/?id=fabbec1163e1f5854f5553d6b627525ec614d8b9 commit fabbec1163e1f5854f5553d6b627525ec614d8b9 Author: Florian Krohm <fl...@ei...> Date: Wed Dec 3 17:15:42 2025 +0000 s390: Remove unused function parameter Diff: --- VEX/priv/host_s390_defs.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/VEX/priv/host_s390_defs.c b/VEX/priv/host_s390_defs.c index 063ede22af..04b06c4cfe 100644 --- a/VEX/priv/host_s390_defs.c +++ b/VEX/priv/host_s390_defs.c @@ -10620,8 +10620,7 @@ s390_insn_xassisted_emit(UChar *buf, const s390_insn *insn, The dispatch counter is a 32-bit value. */ static UChar * -s390_insn_evcheck_emit(UChar *buf, const s390_insn *insn, - VexEndness endness_host) +s390_insn_evcheck_emit(UChar *buf, const s390_insn *insn) { s390_amode *amode; UInt b, d; @@ -11060,7 +11059,7 @@ emit_S390Instr(Bool *is_profinc, UChar *buf, Int nbuf, const s390_insn *insn, break; case S390_INSN_EVCHECK: - end = s390_insn_evcheck_emit(buf, insn, endness_host); + end = s390_insn_evcheck_emit(buf, insn); break; case S390_INSN_XDIRECT: |
|
From: Paul F. <pa...@so...> - 2025-12-01 21:26:44
|
https://sourceware.org/cgit/valgrind/commit/?id=c15bcfe15bd785a528725eebb7d985fcb8a86bed commit c15bcfe15bd785a528725eebb7d985fcb8a86bed Author: Paul Floyd <pj...@wa...> Date: Mon Dec 1 22:26:10 2025 +0100 Darwin regtest: DRD filters and more suppressions Diff: --- darwin17.supp | 39 +++++++++++++++++++++++++++++++++++++++ drd/tests/filter_stderr.in | 1 + 2 files changed, 40 insertions(+) diff --git a/darwin17.supp b/darwin17.supp index 528a9f139a..71d79d844e 100644 --- a/darwin17.supp +++ b/darwin17.supp @@ -1056,3 +1056,42 @@ fun:xpc_pipe_routine } +{ + OSX1013:drd:__si_module_static_cache_block_invoke + drd:MutexErr + fun:pthread_mutex_init + fun:__si_module_static_cache_block_invoke +} + +{ + OSX1013:drd:setlocale + drd:ConflictingAccess + ... + fun:setlocale +} + +{ + OSX1013:drd:std::__1::__thread_specific_ptr<std::__1::__thread_struct>::set_pointer(std::__1::__thread_struct*) + + drd:ConflictingAccess + fun:_ZNSt3__121__thread_specific_ptrINS_15__thread_structEE11set_pointerEPS1_ +} + +{ + OSX1013:drd:std::__1::__thread_local_data + drd:ConflictingAccess + fun:_ZNSt3__119__thread_local_dataEv +} + +{ + OSX1013:drd:get_counter + drd:ConflictingAccess + fun:_ZL11get_counterv +} + +{ + OSX1013:drd:gomp_barier_wait + drd:ConflictingAccess + fun:gomp_barrier_wait + fun:child +} diff --git a/drd/tests/filter_stderr.in b/drd/tests/filter_stderr.in index fea9bcff9d..bde4e597ab 100644 --- a/drd/tests/filter_stderr.in +++ b/drd/tests/filter_stderr.in @@ -38,6 +38,7 @@ $SED \ -e "s/[A-Za-z_]* (pthread_create.c:[0-9]*)/(within libpthread-?.?.so)/" \ -e "s/[A-Za-z_]* (in [^ ]*libpthread-[0-9.]*\.so)/(within libpthread-?.?.so)/" \ -e "s/... (in \/lib\/libthr.so.3)/start_thread/" \ +-e "s/_pthread_body (in \/...libc...)/start_thread/" \ -e "s:(within /lib[0-9]*/ld-[0-9.]*\.so):(within ld-?.?.so):" \ -e "s/was held during [0-9][0-9]*/was held during .../" \ -e "s: BSS section of [^<]*/: BSS section of :g" \ |
|
From: Paul F. <pa...@so...> - 2025-12-01 08:05:42
|
https://sourceware.org/cgit/valgrind/commit/?id=6da5389ecf5f6efe3c174d64eb2e60194c728f96 commit 6da5389ecf5f6efe3c174d64eb2e60194c728f96 Author: Paul Floyd <pj...@wa...> Date: Mon Dec 1 09:04:46 2025 +0100 Darwin: update readmacho code Code from Louis Brunner Diff: --- coregrind/m_debuginfo/readmacho.c | 520 ++++++++++++++++++++++++++++---------- coregrind/pub_core_mach.h | 36 ++- 2 files changed, 423 insertions(+), 133 deletions(-) diff --git a/coregrind/m_debuginfo/readmacho.c b/coregrind/m_debuginfo/readmacho.c index dc2023bc77..66fd57e06d 100644 --- a/coregrind/m_debuginfo/readmacho.c +++ b/coregrind/m_debuginfo/readmacho.c @@ -37,6 +37,7 @@ #include "pub_core_libcfile.h" #include "pub_core_libcproc.h" #include "pub_core_aspacemgr.h" /* for mmaping debuginfo files */ +#include "pub_core_mach.h" /* VG_(dyld_cache_get_slide) */ #include "pub_core_machine.h" /* VG_ELF_CLASS */ #include "pub_core_options.h" #include "pub_core_oset.h" @@ -145,7 +146,7 @@ Bool ML_(check_macho_and_get_rw_loads)( Int fd, Int* rw_loads ) return True; } - const struct MACH_HEADER* mh = (const struct MACH_HEADER*)macho_header; + const struct MACH_HEADER* mh = (const struct MACH_HEADER*)macho_header; vg_assert(mh); if (mh->magic != MAGIC) { return False; @@ -154,15 +155,36 @@ Bool ML_(check_macho_and_get_rw_loads)( Int fd, Int* rw_loads ) HChar* macho_load_commands = ML_(dinfo_zalloc)("di.readmacho.macho_load_commands", mh->sizeofcmds); preadres = VG_(pread)( fd, macho_load_commands, mh->sizeofcmds, sizeof(struct MACH_HEADER) ); if (sr_isError(preadres) || sr_Res(preadres) < mh->sizeofcmds) { - ML_(dinfo_free)(macho_load_commands); - return False; + ML_(dinfo_free)(macho_load_commands); + return False; } - *rw_loads = count_rw_loads((const struct load_command*)macho_load_commands, mh->ncmds); ML_(dinfo_free)(macho_load_commands); return True; } +Bool ML_(check_macho_and_get_rw_loads_from_memory)( const void* buf, SizeT szB, Int* rw_loads ) +{ + vg_assert(buf); + vg_assert(rw_loads); + + if (szB < sizeof(struct fat_header)) { + return False; + } + if (check_fat_macho_and_get_rw_loads(buf, rw_loads)) { + return True; + } + + const struct MACH_HEADER* mh = (const struct MACH_HEADER*)buf; + vg_assert(mh); + if (mh->magic != MAGIC) { + return False; + } + + *rw_loads = count_rw_loads((const struct load_command*)((const HChar*)mh + sizeof(struct MACH_HEADER)), mh->ncmds); + return True; +} + /* Unmap an image mapped in by map_image_aboard. */ static void unmap_image ( /*MOD*/DiSlice* sli ) @@ -174,19 +196,29 @@ static void unmap_image ( /*MOD*/DiSlice* sli ) } } - /* Open the given file, find the thin part if necessary, do some checks, and return a DiSlice containing details of both the thin part and (implicitly, via the contained DiImage*) the fat part. returns DiSlice_INVALID if it fails. If it succeeds, the returned slice is guaranteed to refer to a valid(ish) Mach-O image. */ static DiSlice map_image_aboard ( DebugInfo* di, /* only for err msgs */ - const HChar* filename ) + const HChar* filename, + const DebugInfoMapping* rx_map ) { DiSlice sli = DiSlice_INVALID; /* First off, try to map the thing in. */ - DiImage* mimg = ML_(img_from_local_file)(filename); + DiImage* mimg; + + if (rx_map != NULL) { + // FIXME: basically, we make a slice from the place where the mach_header is until the end of the memory space + // unfortunately, all the data needed for parsing from the DSC is spread across many places in memory + // and there is no way to know for sure the size of the DSC perfectly, so this is the best method at the moment + // and it's _very_ unsafe + mimg = ML_(img_from_memory)(rx_map->avma, MACH_DSC_END - rx_map->avma, filename); + } else { + mimg = ML_(img_from_local_file)(filename); + } if (mimg == NULL) { VG_(message)(Vg_UserMsg, "warning: connection to image %s failed\n", filename ); @@ -199,7 +231,7 @@ static DiSlice map_image_aboard ( DebugInfo* di, /* only for err msgs */ DiOffT fh_be_ioff = 0; struct fat_header fh_be; struct fat_header fh; - + // Assume initially that we have a thin image, and narrow // the bounds if it turns out to be fat. This stores |mimg| as // |sli.img|, so NULL out |mimg| after this point, for the sake of @@ -240,6 +272,8 @@ static DiSlice map_image_aboard ( DebugInfo* di, /* only for err msgs */ Int cputype = CPU_TYPE_X86; # elif defined(VGA_amd64) Int cputype = CPU_TYPE_X86_64; +# elif defined(VGA_arm64) + Int cputype = CPU_TYPE_ARM64; # else # error "unknown architecture" # endif @@ -328,20 +362,108 @@ static DiSlice map_image_aboard ( DebugInfo* di, /* only for err msgs */ /*--- ---*/ /*------------------------------------------------------------*/ +static +void add_symbol( /*OUT*/XArray* /* DiSym */ syms, + struct _DebugInfo* di, + struct NLIST* nl, Addr sym_addr, + const HChar* prefix, + DiCursor strtab_cur, UInt strtab_sz ) +{ + DiSym disym; + + // "start_according_to_valgrind" + static const HChar* s_a_t_v = NULL; /* do not make non-static */ + + Bool inside_text = di->text_present && sym_addr >= di->text_avma && sym_addr < di->text_avma + di->text_size; + Bool inside_data = di->data_present && sym_addr >= di->data_avma && sym_addr < di->data_avma + di->data_size; + Bool inside_d_data = di->sdata_present && sym_addr >= di->sdata_avma && sym_addr < di->sdata_avma + di->sdata_size; + + if (di->trace_symtab) { + HChar* str = ML_(cur_read_strdup)( + ML_(cur_plus)(strtab_cur, nl->n_un.n_strx), + "di.read_symtab.1"); + VG_(printf)("nlist raw: avma %010lx %s in %s %s\n", + sym_addr, str, + inside_text ? "__TEXT" : inside_data ? "__DATA" : inside_d_data ? "__DATA_DIRTY" : "???", + prefix + ); + ML_(dinfo_free)(str); + } + + /* If no part of the symbol falls within the mapped range, + ignore it. */ + if (!inside_text && !inside_data && !inside_d_data) { + return; + } + + /* skip names which point outside the string table; + following these risks segfaulting Valgrind */ + if (nl->n_un.n_strx < 0 || nl->n_un.n_strx >= strtab_sz) { + return; + } + + HChar* name + = ML_(cur_read_strdup)( ML_(cur_plus)(strtab_cur, nl->n_un.n_strx), + "di.read_symtab.2"); + + /* skip nameless symbols; these appear to be common, but + useless */ + if (*name == 0) { + ML_(dinfo_free)(name); + return; + } + + if (prefix[0]) { + HChar* newname = ML_(dinfo_zalloc)("di.read_symtab.3", + VG_(strlen)(prefix) + VG_(strlen)(name)); + VG_(strcpy)(newname, prefix); + VG_(strcat)(newname, name); + ML_(dinfo_free)(name); + name = newname; + } + + VG_(bzero_inline)(&disym, sizeof(disym)); + disym.avmas.main = sym_addr; + SET_TOCPTR_AVMA(disym, 0); + SET_LOCAL_EP_AVMA(disym, 0); + disym.pri_name = ML_(addStr)(di, name, -1); + disym.sec_names = NULL; + disym.size = // let canonicalize fix it + di->text_avma+di->text_size - sym_addr; + disym.isText = inside_text; + disym.isIFunc = False; + disym.isGlobal = inside_data || inside_d_data; + // Lots of user function names get prepended with an underscore. Eg. the + // function 'f' becomes the symbol '_f'. And the "below main" + // function is called "start". So we skip the leading underscore, and + // if we see 'start' and --show-below-main=no, we rename it as + // "start_according_to_valgrind", which makes it easy to spot later + // and display as "(below main)". + if (disym.pri_name[0] == '_') { + disym.pri_name++; + } + else if (!VG_(clo_show_below_main) && VG_STREQ(disym.pri_name, "start")) { + if (s_a_t_v == NULL) + s_a_t_v = ML_(addStr)(di, "start_according_to_valgrind", -1); + vg_assert(s_a_t_v); + disym.pri_name = s_a_t_v; + } + + vg_assert(disym.pri_name); + VG_(addToXA)( syms, &disym ); + ML_(dinfo_free)(name); +} + /* Read a symbol table (nlist). Add the resulting candidate symbols to 'syms'; the caller will post-process them and hand them off to ML_(addSym) itself. */ static void read_symtab( /*OUT*/XArray* /* DiSym */ syms, - struct _DebugInfo* di, + struct _DebugInfo* di, DiCursor symtab_cur, UInt symtab_count, DiCursor strtab_cur, UInt strtab_sz ) { Int i; - DiSym disym; - - // "start_according_to_valgrind" - static const HChar* s_a_t_v = NULL; /* do not make non-static */ for (i = 0; i < symtab_count; i++) { struct NLIST nl; @@ -358,72 +480,37 @@ void read_symtab( /*OUT*/XArray* /* DiSym */ syms, } else { continue; } - - if (di->trace_symtab) { - HChar* str = ML_(cur_read_strdup)( - ML_(cur_plus)(strtab_cur, nl.n_un.n_strx), - "di.read_symtab.1"); - VG_(printf)("nlist raw: avma %010lx %s\n", sym_addr, str ); - ML_(dinfo_free)(str); - } - /* If no part of the symbol falls within the mapped range, - ignore it. */ - if (sym_addr <= di->text_avma - || sym_addr >= di->text_avma+di->text_size) { - continue; - } - - /* skip names which point outside the string table; - following these risks segfaulting Valgrind */ - if (nl.n_un.n_strx < 0 || nl.n_un.n_strx >= strtab_sz) { - continue; - } - - HChar* name - = ML_(cur_read_strdup)( ML_(cur_plus)(strtab_cur, nl.n_un.n_strx), - "di.read_symtab.2"); + add_symbol(syms, di, &nl, sym_addr, "", strtab_cur, strtab_sz); + } +} - /* skip nameless symbols; these appear to be common, but - useless */ - if (*name == 0) { - ML_(dinfo_free)(name); - continue; - } +// See reason for disabling later in this file +#if 0 +static +void add_indirect_symbols( /*OUT*/XArray* /* DiSym */ syms, + struct _DebugInfo* di, + struct SECTION* section, SizeT entry_size, + DiCursor indir_cur, UInt indir_count, + DiCursor symtab_cur, UInt symtab_count, + DiCursor strtab_cur, UInt strtab_sz ) +{ + for (Int i = 0; i < indir_count; i++) { + Int index; + struct NLIST nl; + ML_(cur_read_get)(&index, + ML_(cur_plus)(indir_cur, i * sizeof(Int)), + sizeof(index)); + ML_(cur_read_get)(&nl, + ML_(cur_plus)(symtab_cur, index * sizeof(struct NLIST)), + sizeof(nl)); - VG_(bzero_inline)(&disym, sizeof(disym)); - disym.avmas.main = sym_addr; - SET_TOCPTR_AVMA(disym, 0); - SET_LOCAL_EP_AVMA(disym, 0); - disym.pri_name = ML_(addStr)(di, name, -1); - disym.sec_names = NULL; - disym.size = // let canonicalize fix it - di->text_avma+di->text_size - sym_addr; - disym.isText = True; - disym.isIFunc = False; - disym.isGlobal = False; - // Lots of user function names get prepended with an underscore. Eg. the - // function 'f' becomes the symbol '_f'. And the "below main" - // function is called "start". So we skip the leading underscore, and - // if we see 'start' and --show-below-main=no, we rename it as - // "start_according_to_valgrind", which makes it easy to spot later - // and display as "(below main)". - if (disym.pri_name[0] == '_') { - disym.pri_name++; - } - else if (!VG_(clo_show_below_main) && VG_STREQ(disym.pri_name, "start")) { - if (s_a_t_v == NULL) - s_a_t_v = ML_(addStr)(di, "start_according_to_valgrind", -1); - vg_assert(s_a_t_v); - disym.pri_name = s_a_t_v; - } + Addr sym_addr = di->text_bias + section->addr + i * entry_size; - vg_assert(disym.pri_name); - VG_(addToXA)( syms, &disym ); - ML_(dinfo_free)(name); + add_symbol(syms, di, &nl, sym_addr, section->sectname, strtab_cur, strtab_sz); } } - +#endif /* Compare DiSyms by their start address, and for equal addresses, use the primary name as a secondary sort key. */ @@ -536,7 +623,7 @@ static Bool file_exists_p(const HChar *path) } -/* Search for an existing dSYM file as a possible separate debug file. +/* Search for an existing dSYM file as a possible separate debug file. Adapted from gdb. */ static HChar * find_separate_debug_file (const HChar *executable_name) @@ -545,7 +632,7 @@ find_separate_debug_file (const HChar *executable_name) HChar *dot_ptr; HChar *slash_ptr; HChar *dsymfile; - + /* Make sure the object file name itself doesn't contain ".dSYM" in it or we will end up with an infinite loop where after we add a dSYM symbol file, it will then enter this function asking if there is a debug file for the @@ -554,23 +641,23 @@ find_separate_debug_file (const HChar *executable_name) { /* Check for the existence of a .dSYM file for a given executable. */ basename_str = VG_(basename) (executable_name); - dsymfile = ML_(dinfo_zalloc)("di.readmacho.dsymfile", + dsymfile = ML_(dinfo_zalloc)("di.readmacho.dsymfile", VG_(strlen) (executable_name) + VG_(strlen) (APPLE_DSYM_EXT_AND_SUBDIRECTORY) + VG_(strlen) (basename_str) + 1 ); - + /* First try for the dSYM in the same directory as the original file. */ VG_(strcpy) (dsymfile, executable_name); VG_(strcat) (dsymfile, APPLE_DSYM_EXT_AND_SUBDIRECTORY); VG_(strcat) (dsymfile, basename_str); - + if (file_exists_p (dsymfile)) return dsymfile; - + /* Now search for any parent directory that has a '.' in it so we can find - Mac OS X applications, bundles, plugins, and any other kinds of files. + Mac OS X applications, bundles, plugins, and any other kinds of files. Mac OS X application bundles wil have their program in "/some/path/MyApp.app/Contents/MacOS/MyApp" (or replace ".app" with ".bundle" or ".plugin" for other types of bundles). So we look for any @@ -595,7 +682,7 @@ find_separate_debug_file (const HChar *executable_name) if (file_exists_p (dsymfile)) return dsymfile; } - + /* NULL terminate the string at the '.' character and append the path down to the dSYM file. */ *dot_ptr = '\0'; @@ -603,11 +690,11 @@ find_separate_debug_file (const HChar *executable_name) VG_(strcat) (dot_ptr, basename_str); if (file_exists_p (dsymfile)) return dsymfile; - + /* NULL terminate the string at the '.' locatated by the strrchr() function again. */ *dot_ptr = '\0'; - + /* We found a previous extension '.' character and did not find a dSYM file so now find previous directory delimiter so we don't try multiple times on a file name that may have a version number @@ -640,7 +727,7 @@ static DiSlice getsectdata ( DiSlice img, Int c; for (c = 0; c < mh.ncmds; c++) { - struct load_command cmd; + struct load_command cmd; ML_(cur_read_get)(&cmd, cur, sizeof(cmd)); if (cmd.cmd == LC_SEGMENT_CMD) { struct SEGMENT_COMMAND seg; @@ -652,7 +739,7 @@ static DiSlice getsectdata ( DiSlice img, for (s = 0; s < seg.nsects; s++) { struct SECTION sect; ML_(cur_step_get)(§, §s_cur, sizeof(sect)); - if (0 == VG_(strncmp)(sect.sectname, sectname, + if (0 == VG_(strncmp)(sect.sectname, sectname, sizeof(sect.sectname))) { DiSlice res = img; res.ioff = sect.offset; @@ -741,17 +828,31 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) DiCursor dysym_cur = DiCursor_INVALID; HChar* dsymfilename = NULL; Bool have_uuid = False; + Bool from_memory = False; // True if we're reading from DSC + Bool have_rw = False; + Addr kernel_slide = 0; // Used when from_memory is True UChar uuid[16]; Word i; + struct SEGMENT_COMMAND data_const = {.cmd = 0}; + struct SEGMENT_COMMAND link_edit = {.cmd = 0}; const DebugInfoMapping* rx_map = NULL; const DebugInfoMapping* rw_map = NULL; - /* mmap the object file to look for di->soname and di->text_bias + /* mmap the object file to look for di->soname and di->text_bias and uuid and nlist */ /* This should be ensured by our caller (that we're in the accept state). */ vg_assert(di->fsm.have_rx_map); +#if DARWIN_VERS >= DARWIN_11_00 + if (di->from_memory) { + from_memory = True; + kernel_slide = VG_(dyld_cache_get_slide)(); + } +#endif + if (di->fsm.rw_map_count) { + have_rw = True; + } for (i = 0; i < VG_(sizeXA)(di->fsm.maps); i++) { const DebugInfoMapping* map = VG_(indexXA)(di->fsm.maps, i); @@ -759,19 +860,27 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) rx_map = map; if (map->rw && !rw_map) rw_map = map; - if (rx_map && rw_map) + if (rx_map && (rw_map || !have_rw)) break; } vg_assert(rx_map); + vg_assert(!have_rw || rw_map); - if (VG_(clo_verbosity) > 1) + if (VG_(clo_verbosity) > 1) { + if (!have_rw) { + VG_(message)(Vg_DebugMsg, + "%s (rx at %#lx)\n", di->fsm.filename, + rx_map->avma); + } else { VG_(message)(Vg_DebugMsg, "%s (rx at %#lx, rw at %#lx)\n", di->fsm.filename, rx_map->avma, rw_map->avma ); + } + } VG_(memset)(&uuid, 0, sizeof(uuid)); - msli = map_image_aboard( di, di->fsm.filename ); + msli = map_image_aboard( di, di->fsm.filename, from_memory ? rx_map : NULL ); if (!ML_(sli_is_valid)(msli)) { ML_(symerr)(di, False, "Connect to main image failed."); goto fail; @@ -782,19 +891,15 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) /* Poke around in the Mach-O header, to find some important stuff. */ // Find LC_SYMTAB and LC_DYSYMTAB, if present. - // Read di->soname from LC_ID_DYLIB if present, - // or from LC_ID_DYLINKER if present, + // Read di->soname from LC_ID_DYLIB if present, + // or from LC_ID_DYLINKER if present, // or use "NONE". // Get di->text_bias (aka slide) based on the corresponding LC_SEGMENT // Get uuid for later dsym search di->text_bias = 0; - if (VG_(clo_verbosity) > 1 || VG_(clo_trace_redir)) - VG_(message)(Vg_DebugMsg, "Reading syms from %s\n", - di->fsm.filename ); - - { + { DiCursor cmd_cur = ML_(cur_from_sli)(msli); struct MACH_HEADER mh; @@ -808,13 +913,13 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) for (c = 0; c < mh.ncmds; c++) { struct load_command cmd; ML_(cur_read_get)(&cmd, cmd_cur, sizeof(cmd)); - + if (cmd.cmd == LC_SYMTAB) { sym_cur = cmd_cur; - } + } else if (cmd.cmd == LC_DYSYMTAB) { dysym_cur = cmd_cur; - } + } else if (cmd.cmd == LC_ID_DYLIB && mh.filetype == MH_DYLIB) { // GrP fixme bundle? struct dylib_command dcmd; @@ -879,7 +984,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) if (!di->text_present && 0 == VG_(strcmp)(&seg.segname[0], "__TEXT") /* DDD: is the next line a kludge? -- JRS */ - && seg.fileoff == 0 && seg.filesize != 0) { + && (from_memory || seg.fileoff == 0) && seg.filesize != 0) { di->text_present = True; di->text_svma = (Addr)seg.vmaddr; di->text_avma = rx_map->avma; @@ -893,18 +998,56 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) di->text_debug_svma = di->text_svma; di->text_debug_bias = di->text_bias; } + if (0 == VG_(strcmp)(seg.segname, "__DATA_CONST")) { + data_const = seg; + } /* Try for __DATA */ - if (!di->data_present + if (have_rw && !di->data_present && 0 == VG_(strcmp)(&seg.segname[0], "__DATA") /* && DDD:seg->fileoff == 0 */ && seg.filesize != 0) { di->data_present = True; di->data_svma = (Addr)seg.vmaddr; di->data_avma = rw_map->avma; +#if defined(VGA_arm64) + // FIXME: the same mmap contains both __DATA_CONST, __DATA and __DATA_DIRTY + // this means that symbols in __DATA/__DATA_DIRTY are offset by the size of __DATA_CONST + // not sure when this started to be an issue so I am going to gate this under arm64 for now + if (data_const.cmd != 0) { + di->data_avma += data_const.vmsize; + } +#endif di->data_size = seg.vmsize; di->data_bias = di->data_avma - di->data_svma; di->data_debug_svma = di->data_svma; di->data_debug_bias = di->data_bias; } + /* We store __DATA_DIRTY inside .sdata (because they correspond somewhat). + Some binaries have very important information there, + notably dyld and its dyld_all_image_infos. */ + if (have_rw && !di->sdata_present + && 0 == VG_(strcmp)(&seg.segname[0], "__DATA_DIRTY") + /* && DDD:seg->fileoff == 0 */ && seg.filesize != 0) { + di->sdata_present = True; + di->sdata_svma = (Addr)seg.vmaddr; + // FIXME: assumes __DATA was found first (which in practice should be fine) + di->sdata_avma = rw_map->avma + di->data_size; +#if defined(VGA_arm64) + // FIXME: the same mmap contains both __DATA_CONST, __DATA and __DATA_DIRTY + // this means that symbols in __DATA/__DATA_DIRTY are offset by the size of __DATA_CONST + // not sure when this started to be an issue so I am going to gate this under arm64 for now + if (data_const.cmd != 0) { + di->sdata_avma += data_const.vmsize; + } +#endif + di->sdata_size = seg.vmsize; + di->sdata_bias = di->sdata_avma - di->sdata_svma; + di->sdata_debug_svma = di->sdata_svma; + di->sdata_debug_bias = di->sdata_bias; + } + /* Try for __LINKEDIT */ + if (0 == VG_(strcmp)(&seg.segname[0], "__LINKEDIT")) { + link_edit = seg; + } } else if (cmd.cmd == LC_UUID) { ML_(cur_read_get)(&uuid, cmd_cur, sizeof(uuid)); @@ -915,6 +1058,11 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) } } + if (from_memory && link_edit.cmd == 0) { + ML_(symerr)(di, False, "Invalid Mach-O file (missing __LINKEDIT)."); + goto fail; + } + if (!di->soname) { di->soname = ML_(dinfo_strdup)("di.readmacho.noname", "NONE"); } @@ -930,13 +1078,19 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) // We already asserted that .. vg_assert(msli.img != NULL && msli.szB > 0); - if (ML_(cur_is_valid)(sym_cur) && ML_(cur_is_valid)(dysym_cur)) { + if (ML_(cur_is_valid)(sym_cur)) { + // Some binaries (e.g. Valgrind's tools themselves, like memcheck) + // don't have dynamic symbols because they are static binaries. + // Let's try to load symbols using a single table. + Bool has_dynamic = ML_(cur_is_valid)(dysym_cur); struct symtab_command symcmd; struct dysymtab_command dysymcmd; ML_(cur_read_get)(&symcmd, sym_cur, sizeof(symcmd)); - ML_(cur_read_get)(&dysymcmd, dysym_cur, sizeof(dysymcmd)); + if (has_dynamic) { + ML_(cur_read_get)(&dysymcmd, dysym_cur, sizeof(dysymcmd)); + } /* Read nlist symbol table */ DiCursor syms = DiCursor_INVALID; @@ -944,25 +1098,50 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) XArray* /* DiSym */ candSyms = NULL; Word nCandSyms; - if (msli.szB < symcmd.stroff + symcmd.strsize - || msli.szB < symcmd.symoff + symcmd.nsyms - * sizeof(struct NLIST)) { + // FIXME: there is no real nice way to check this when using DSC + // the chunk that msli points to is only the mach_header + load_commands + // but not the actual sections (__TEXT, __DATA, __LINKEDIT, etc) + // so those checks will always fail because they point to data much further in memory + // (as DSC groups all this kind of data together for X amount of images) + if (!from_memory + && (msli.szB < symcmd.stroff + symcmd.strsize + || msli.szB < symcmd.symoff + symcmd.nsyms * sizeof(struct NLIST))) { ML_(symerr)(di, False, "Invalid Mach-O file (5 too small)."); goto fail; - } - if (dysymcmd.ilocalsym + dysymcmd.nlocalsym > symcmd.nsyms - || dysymcmd.iextdefsym + dysymcmd.nextdefsym > symcmd.nsyms) { + } + if (has_dynamic + && (dysymcmd.ilocalsym + dysymcmd.nlocalsym > symcmd.nsyms + || dysymcmd.iextdefsym + dysymcmd.nextdefsym > symcmd.nsyms)) { ML_(symerr)(di, False, "Invalid Mach-O file (bad symbol table)."); goto fail; } - syms = ML_(cur_plus)(ML_(cur_from_sli)(msli), symcmd.symoff); - strs = ML_(cur_plus)(ML_(cur_from_sli)(msli), symcmd.stroff); - - if (VG_(clo_verbosity) > 1) + if (from_memory) { + // First, we calculate the real position of __LINKEDIT in the DSC by adding the slide + // Then we get the offset of syms/strings within __LINKEDIT by removing the fileoffset + // Then we add the __LINKEDIT address + // Finally we calculate the proper offset of those addresses compared to the mach_header slice + Addr link_edit_addr = link_edit.vmaddr + kernel_slide; + syms = ML_(cur_from_sli)(msli); + syms.ioff = (link_edit_addr + (symcmd.symoff - link_edit.fileoff)) - rx_map->avma; + strs = ML_(cur_from_sli)(msli); + strs.ioff = (link_edit_addr + (symcmd.stroff - link_edit.fileoff)) - rx_map->avma; + } else { + syms = ML_(cur_plus)(ML_(cur_from_sli)(msli), symcmd.symoff); + strs = ML_(cur_plus)(ML_(cur_from_sli)(msli), symcmd.stroff); + } + + if (VG_(clo_verbosity) > 1) { + if (has_dynamic) { VG_(message)(Vg_DebugMsg, - " reading syms from primary file (%d %d)\n", + " reading syms from primary file (%u %u)\n", dysymcmd.nextdefsym, dysymcmd.nlocalsym ); + } else { + VG_(message)(Vg_DebugMsg, + " reading syms from primary file (%u)\n", + symcmd.nsyms ); + } + } /* Read candidate symbols into 'candSyms', so we can truncate overlapping ends and generally tidy up, before presenting @@ -972,18 +1151,95 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) ML_(dinfo_free), sizeof(DiSym) ); - // extern symbols - read_symtab(candSyms, - di, - ML_(cur_plus)(syms, - dysymcmd.iextdefsym * sizeof(struct NLIST)), - dysymcmd.nextdefsym, strs, symcmd.strsize); - // static and private_extern symbols - read_symtab(candSyms, - di, - ML_(cur_plus)(syms, - dysymcmd.ilocalsym * sizeof(struct NLIST)), - dysymcmd.nlocalsym, strs, symcmd.strsize); + if (has_dynamic) { + // extern symbols + read_symtab(candSyms, + di, + ML_(cur_plus)(syms, + dysymcmd.iextdefsym * sizeof(struct NLIST)), + dysymcmd.nextdefsym, strs, symcmd.strsize); + // static and private_extern symbols + read_symtab(candSyms, + di, + ML_(cur_plus)(syms, + dysymcmd.ilocalsym * sizeof(struct NLIST)), + dysymcmd.nlocalsym, strs, symcmd.strsize); + +// Due to the usage of dyld_cache, I am unsure how to properly capture the stubs from there +// moreover we don't have a rw_map for those so loads of logic need to change above. +// This is only really useful when reading librairies from disk which is limited now. +// Finally, there is also a weird overflow of some kind on arm64 macOS 15. +// So I am disabling this for now. +#if 0 + { + DiCursor cmd_cur = ML_(cur_from_sli)(msli); + DiCursor indirs = DiCursor_INVALID; + + if (from_memory) { + Addr link_edit_addr = link_edit.vmaddr + kernel_slide; + indirs = ML_(cur_from_sli)(msli); + indirs.ioff = (link_edit_addr + (dysymcmd.indirectsymoff - link_edit.fileoff)) - rx_map->avma; + } else { + indirs = ML_(cur_plus)(ML_(cur_from_sli)(msli), dysymcmd.indirectsymoff); + } + + struct MACH_HEADER mh; + ML_(cur_step_get)(&mh, &cmd_cur, sizeof(mh)); + for (Int c = 0; c < mh.ncmds; c++) { + struct load_command cmd; + ML_(cur_read_get)(&cmd, cmd_cur, sizeof(cmd)); + + if (cmd.cmd == LC_SEGMENT_CMD) { + struct SEGMENT_COMMAND seg; + ML_(cur_read_get)(&seg, cmd_cur, sizeof(seg)); + + for (i = 0; i < seg.nsects; i += 1) { + DiCursor sect_cur = ML_(cur_plus)(cmd_cur, sizeof(seg)); + struct SECTION sect; + ML_(cur_read_get)(§, sect_cur, sizeof(sect)); + Int indexOfIndirects = sect.reserved1; + + if ((sect.flags & S_SYMBOL_STUBS) == S_SYMBOL_STUBS) { + Int sizeOfStub = sect.reserved2; + Int amountOfStubs = sect.size / sizeOfStub; + if (indexOfIndirects + amountOfStubs > dysymcmd.nindirectsyms) { + ML_(symerr)(di, False, "Invalid Mach-O file (invalid stub section)."); + goto fail; + } + // add symbols where we have stub assembly + add_indirect_symbols(candSyms, di, + §, sizeOfStub, + ML_(cur_plus)(indirs, indexOfIndirects * sizeof(UInt)), amountOfStubs, + syms, symcmd.nsyms, strs, symcmd.strsize); + } + if ((sect.flags & S_LAZY_SYMBOL_POINTERS) == S_LAZY_SYMBOL_POINTERS) { + Int sizeOfPointer = VG_WORDSIZE; + Int amountOfPointers = sect.size / sizeOfPointer; + if (indexOfIndirects + amountOfPointers > dysymcmd.nindirectsyms) { + ML_(symerr)(di, False, "Invalid Mach-O file (invalid lazy symbol section)."); + goto fail; + } + // add symbols where we have lazy symbol pointers + add_indirect_symbols(candSyms, di, + §, sizeOfPointer, + ML_(cur_plus)(indirs, indexOfIndirects * sizeof(UInt)), amountOfPointers, + syms, symcmd.nsyms, strs, symcmd.strsize); + } + + sect_cur = ML_(cur_plus)(sect_cur, sizeof(sect)); + } + } + + cmd_cur = ML_(cur_plus)(cmd_cur, cmd.cmdsize); + } + } +#endif + } else { + read_symtab(candSyms, + di, + syms, + symcmd.nsyms, strs, symcmd.strsize); + } /* tidy up the cand syms -- trim overlapping ends. May resize candSyms. */ @@ -1027,7 +1283,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) if (VG_(clo_verbosity) > 1) VG_(message)(Vg_DebugMsg, " dSYM= %s\n", dsymfilename); - dsli = map_image_aboard( di, dsymfilename ); + dsli = map_image_aboard( di, dsymfilename, NULL ); if (!ML_(sli_is_valid)(dsli)) { ML_(symerr)(di, False, "Connect to debuginfo image failed " "(first attempt)."); @@ -1065,7 +1321,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) VG_(message)(Vg_DebugMsg, "%sdSYM directory %s; consider using " "--dsymutil=yes\n", VG_(clo_verbosity) > 1 ? " " : "", - dsymfilename ? "has wrong UUID" : "is missing"); + dsymfilename ? "has wrong UUID" : "is missing"); goto success; } @@ -1073,7 +1329,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) { Int r; const HChar* dsymutil = "/usr/bin/dsymutil "; - HChar* cmd = ML_(dinfo_zalloc)( "di.readmacho.tmp1", + HChar* cmd = ML_(dinfo_zalloc)( "di.readmacho.tmp1", VG_(strlen)(dsymutil) + VG_(strlen)(di->fsm.filename) + 32 /* misc */ ); @@ -1097,7 +1353,7 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) if (VG_(clo_verbosity) > 1) VG_(message)(Vg_DebugMsg, " dsyms= %s\n", dsymfilename); - dsli = map_image_aboard( di, dsymfilename ); + dsli = map_image_aboard( di, dsymfilename, NULL ); if (!ML_(sli_is_valid)(dsli)) { ML_(symerr)(di, False, "Connect to debuginfo image failed " "(second attempt)."); @@ -1173,13 +1429,13 @@ Bool ML_(read_macho_debug_info)( struct _DebugInfo* di ) eh_frame_svma + di->text_bias, True/*is_ehframe*/); } - + if (ML_(sli_is_valid)(debug_info_mscn)) { if (VG_(clo_verbosity) > 1) { if (0) VG_(message)(Vg_DebugMsg, "Reading dwarf3 for %s (%#lx) from %s" - " (%lld %lld %lld %lld %lld %lld)\n", + " (%llu %llu %llu %llu %llu %llu)\n", di->fsm.filename, di->text_avma, dsymfilename, debug_info_mscn.szB, debug_abbv_mscn.szB, debug_line_mscn.szB, debug_str_mscn.szB, diff --git a/coregrind/pub_core_mach.h b/coregrind/pub_core_mach.h index 694bbee376..cbce0309ad 100644 --- a/coregrind/pub_core_mach.h +++ b/coregrind/pub_core_mach.h @@ -34,7 +34,7 @@ #define DARWIN_FAKE_MEMORY_PATH "/dev/macos/internals/" //-------------------------------------------------------------------- -// PURPOSE: This module contains the Mach kernel interface, +// PURPOSE: This module contains the Mach kernel interface, // for operating systems like Darwin / Mac OS X that use it. //-------------------------------------------------------------------- @@ -44,6 +44,40 @@ extern void VG_(mach_init)(void); // Record system memory after aspace has been init'd extern void VG_(mach_record_system_memory)(void); +// MACH_DSC_END represent a guess to where the dyld shared cache ends +// there is no way to know for sure and even if we could, +// it would be a pain to carry that value around all of V +// so we just use a guess and hope for the best. +// Why is this value needed? +// We only use it in a single context: when reading the dyld shared cache directly from memory +// we use it as a bound when reading symbols with DebugInfo. +// How is this value calculated? +// - amd64: end of user addressable space, which makes sense as the DSC is mapped at the end of the address space +// - x86: end of user addressable space, note that there should not be any x86 valgrind with DSC support so this is just a placeholder +// - arm64: +// - the DSC is mapped at 0x180000000 + some ASLR slider +// - the size depends on the macOS version but is usually less than 0xFFFFFFFF +// - thus it should be around 0x280000000 but I have seen it reach above +// - thus we use 0x300000000 which is also where we tell V that client memory starts +#if defined(VGP_amd64_darwin) +#define MACH_DSC_END 0x7ffffffff000 +#elif defined(VGP_x86_darwin) +#define MACH_DSC_END 0xfffff000 +#elif defined(VGP_arm64_darwin) +#define MACH_DSC_END 0x300000000 +#else +#error "Unsupported platform" +#endif + +#if DARWIN_VERS >= DARWIN_11_00 +// Dyld shared cache (DSC) parsing, which is required as system libraries are not provided on disk +// starting with macOS 11.0 (Big Sur) +extern void VG_(dyld_cache_init)(const HChar*); +extern int VG_(dyld_cache_might_be_in)(const HChar*); +extern int VG_(dyld_cache_load_library)(const HChar*); +extern Addr VG_(dyld_cache_get_slide)(void); +#endif + #endif // __PUB_CORE_MACH_H #endif // defined(VGO_darwin) |
|
From: Paul F. <pa...@so...> - 2025-12-01 07:19:44
|
https://sourceware.org/cgit/valgrind/commit/?id=b599858486bb7db6d2ff3e6ddc4e7f71791d393d commit b599858486bb7db6d2ff3e6ddc4e7f71791d393d Author: Paul Floyd <pj...@wa...> Date: Mon Dec 1 08:18:56 2025 +0100 Linux Helgrind: add a suppression for _dl_allocate_tls_init Seen on Fedora 43 amd64 Diff: --- glibc-2.X-helgrind.supp.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glibc-2.X-helgrind.supp.in b/glibc-2.X-helgrind.supp.in index 9b1ef9ae48..61d4e1d724 100644 --- a/glibc-2.X-helgrind.supp.in +++ b/glibc-2.X-helgrind.supp.in @@ -356,3 +356,9 @@ obj:/usr/lib/*/libnss_mdns4*.so.* } +{ + helgrind---_dl_allocate_tls_init + Helgrind:Race + fun:mempcpy + fun:_dl_allocate_tls_init +} |
|
From: Paul F. <pa...@so...> - 2025-12-01 07:13:25
|
https://sourceware.org/cgit/valgrind/commit/?id=cfc8b0706a9a0fbf05525a0ce142e2bf4cc53fed commit cfc8b0706a9a0fbf05525a0ce142e2bf4cc53fed Author: Paul Floyd <pj...@wa...> Date: Mon Dec 1 08:12:30 2025 +0100 Linux DRD suppression: add an entry for __is_decorate_maps_enabled Seen on Fedora 43 Diff: --- drd/tests/std_thread2.supp | 7 +++++++ glibc-2.X-drd.supp.in | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drd/tests/std_thread2.supp b/drd/tests/std_thread2.supp index 40741b06f8..39a201da9a 100644 --- a/drd/tests/std_thread2.supp +++ b/drd/tests/std_thread2.supp @@ -98,3 +98,10 @@ drd:ConflictingAccess fun:__set_vma_name } + +{ + drd-libc-__is_decorate_maps_enabled + drd:ConflictingAccess + fun:__is_decorate_maps_enabled +} + diff --git a/glibc-2.X-drd.supp.in b/glibc-2.X-drd.supp.in index 419ff2256c..6866904470 100644 --- a/glibc-2.X-drd.supp.in +++ b/glibc-2.X-drd.supp.in @@ -369,3 +369,9 @@ fun:_dl_exception_create_format } +{ + drd-libc-__is_decorate_maps_enabled + drd:ConflictingAccess + fun:__is_decorate_maps_enabled +} + |
|
From: Florian K. <fk...@so...> - 2025-11-30 21:53:33
|
https://sourceware.org/cgit/valgrind/commit/?id=e6a4ea43e1c3d96ec41fd4bea4a5d8bec8535f4a commit e6a4ea43e1c3d96ec41fd4bea4a5d8bec8535f4a Author: Florian Krohm <fl...@ei...> Date: Sun Nov 30 21:52:32 2025 +0000 NEWS / README.s390 update BZ 509562 closed Diff: --- NEWS | 2 ++ README.s390 | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 2cedad448a..6068d611d4 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ X86/macOS 10.13, AMD64/macOS 10.13 and nanoMIPS/Linux. * ================== PLATFORM CHANGES ================= +s390x: Machine models older than z196 are no longer supported. * ==================== TOOL CHANGES =================== @@ -28,6 +29,7 @@ are not entered into bugzilla tend to get forgotten about or ignored. 228343 none/tests/darwin/bug228343 fails on OS X 413369 unhandled amd64-darwin syscall: unix:151 (getpgid) 487055 memcheck/tests/x86-linux/scalar fails running in Docker +509562 s390x: Define minimum required machine model 510416 Missing syswraps for file_getattr and file_setattr 510864 Add SSE4.1 PMAXSD and PMINSD instructions support for 32-bit x86 511329 Darwin and FreeBSD: Move setting of carry flag out of diff --git a/README.s390 b/README.s390 index d0661731c6..980285ab7f 100644 --- a/README.s390 +++ b/README.s390 @@ -1,7 +1,8 @@ Requirements ------------ -- You need GCC 3.4 or later to compile the s390 port. +- You need a GCC-compatible compiler with C11 support to compile + the s390 port. - Valgrind requires a machine not older than z196 to run. |