than mailing the developers (or mailing lists) directly -- bugs that
are not entered into bugzilla tend to get forgotten about or ignored.
-506076 unimplemented fcntl command: 1028 (F_CREATED_QUERY)
338803 Handling of dwz debug alt files or cross-CU is broken
+418756 MAP_FIXED_NOREPLACE mmap flag unsupported
493434 Add --track-fds=bad mode (no "leak" tracking)
503098 Incorrect NAN-boxing for float registers in RISC-V
503641 close_range syscalls started failing with 3.25.0
AMD64_GET_TLSBASE
505228 Wrap linux specific mseal syscall
502968 Wrap linux specific syscalls 457 (listmount) and 458 (statmount)
+506076 unimplemented fcntl command: 1028 (F_CREATED_QUERY)
506499 Unhandled syscall 592 (exterrctl - FreeBSD
506795 Better report which clone flags are problematic
506930 valgrind allows SIGKILL being reset to SIG_DFL
(fixed/hint/any), and ask aspacem what we should do. */
mreq.start = arg1;
mreq.len = arg2;
- if (arg4 & VKI_MAP_FIXED) {
+ if ((arg4 & VKI_MAP_FIXED)
+#if defined(VKI_MAP_FIXED_NOREPLACE)
+ || (arg4 & VKI_MAP_FIXED_NOREPLACE)
+#endif
+ )
+ {
mreq.rkind = MFixed;
} else
#if defined(VGO_solaris) && defined(VKI_MAP_ALIGN)
advised = VG_(am_get_advisory)( &mreq, True/*client*/, &mreq_ok );
if (!mreq_ok) {
/* Our request was bounced, so we'd better fail. */
+#if defined(VKI_MAP_FIXED_NOREPLACE)
+ if (arg4 & VKI_MAP_FIXED_NOREPLACE) {
+ return VG_(mk_SysRes_Error)( VKI_EEXIST );
+ }
+#endif
return VG_(mk_SysRes_Error)( VKI_EINVAL );
}
}
# endif
+# if defined(VKI_MAP_FIXED_NOREPLACE)
+ /* FIXED_NOREPLACE is fatal, no retries. */
+ if ((arg4 & VKI_MAP_FIXED_NOREPLACE) && sr_isError(sres)) {
+ return VG_(mk_SysRes_Error)( VKI_EEXIST );
+ }
+# endif
+
/* A refinement: it may be that the kernel refused aspacem's choice
of address. If we were originally asked for a hinted mapping,
there is still a last chance: try again at any address.
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
#define VKI_MAP_32BIT 0x40 /* only give out 32bit addresses */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-2.6.9/include/asm-x86_64/fcntl.h
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/asm-i386/fcntl.h
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-3.10.5/uapi/include/asm-generic/fcntl.h
#define VKI_MAP_LOCKED 0x8000 /* pages are locked */
#define VKI_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
#define VKI_MAP_NONBLOCK 0x20000 /* do not block on IO */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
#define VKI_MAP_LOCKED 0x8000 /* pages are locked */
#define VKI_MAP_POPULATE 0x10000 /* populate (prefault) pagetables */
#define VKI_MAP_NONBLOCK 0x20000 /* do not block on IO */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-2.6.35.9/include/asm-mips/fcntl.h
//----------------------------------------------------------------------
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-6.0/include/uapi/linux/mman.h
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_ANONYMOUS 0x20 /* don't use a file */
#define VKI_MAP_NORESERVE 0x4000 /* don't check for reservations */
+#define VKI_MAP_FIXED_NOREPLACE 0x100000 /* fail EEXIST if fixed map fails */
//----------------------------------------------------------------------
// From linux-2.6.8.1/include/asm-i386/fcntl.h