From: Paul Floyd Date: Tue, 28 Apr 2026 20:03:22 +0000 (+0200) Subject: Bug 519539 - Darwin shm_open mode is optional and depends on oflag X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=HEAD;p=thirdparty%2Fvalgrind.git Bug 519539 - Darwin shm_open mode is optional and depends on oflag --- diff --git a/NEWS b/NEWS index 50b8be88b..4967fe770 100644 --- a/NEWS +++ b/NEWS @@ -14,7 +14,6 @@ for nanoMIPS/Linux. macOS is supported up to version 13 Ventura (amd64 only). * ==================== TOOL CHANGES =================== - * ==================== FIXED BUGS ==================== The following bugs have been fixed or resolved. Note that "n-i-bz" @@ -25,6 +24,7 @@ than mailing the developers (or mailing lists) directly -- bugs that are not entered into bugzilla tend to get forgotten about or ignored. 519223 Recognize ioctl(UFFDIO_*) operations +519539 Darwin shm_open mode is optional and depends on oflag To see details of a given bug, visit https://bugs.kde.org/show_bug.cgi?id=XXXXXX diff --git a/coregrind/m_syswrap/syswrap-darwin.c b/coregrind/m_syswrap/syswrap-darwin.c index 38304712d..b9c7314ec 100644 --- a/coregrind/m_syswrap/syswrap-darwin.c +++ b/coregrind/m_syswrap/syswrap-darwin.c @@ -2988,14 +2988,20 @@ PRE(shmget) PRE(shm_open) { - PRINT("shm_open(%#lx(%s), %ld, %lu)", ARG1, (HChar *)ARG1, SARG2, ARG3); - PRE_REG_READ3(long, "shm_open", - const char *,"name", int,"flags", vki_mode_t,"mode"); + if (ARG2 & VKI_O_CREAT) { + PRINT("shm_open(%#lx(%s), %ld, %lu)", ARG1, (HChar *)ARG1, SARG2, ARG3); + PRE_REG_READ3(long, "shm_open", + const char *,"name", int,"flags", vki_mode_t,"mode"); + } else { + PRINT("shm_open(%#lx(%s), %ld)", ARG1, (HChar *)ARG1, SARG2); + PRE_REG_READ2(long, "shm_open", const char *,"name", int,"flags"); + } PRE_MEM_RASCIIZ( "shm_open(filename)", ARG1 ); *flags |= SfMayBlock; } + POST(shm_open) { vg_assert(SUCCESS);