/none/tests/freebsd/auxv
/none/tests/freebsd/bug452274
/none/tests/freebsd/bug498317
+none/tests/freebsd/bug499212
/none/tests/freebsd/osrel
/none/tests/freebsd/swapcontext
/none/tests/freebsd/fexecve
even though it's generated by --gen-suppressions=yes
498143 False positive on EVIOCGRAB ioctl
498492 none/tests/amd64/lzcnt64 crashes on FreeBSD compiled with clang
+499212 mmap() with MAP_ALIGNED() returns unaligned pointer
To see details of a given bug, visit
https://bugs.kde.org/show_bug.cgi?id=XXXXXX
if (arg4 & VKI_MAP_FIXED) {
mreq.rkind = MFixed;
} else
-#if defined(VKI_MAP_ALIGN) /* Solaris specific */
+#if defined(VGO_solaris) && defined(VKI_MAP_ALIGN)
if (arg4 & VKI_MAP_ALIGN) {
mreq.rkind = MAlign;
if (mreq.start == 0) {
/* VKI_MAP_FIXED and VKI_MAP_ALIGN don't like each other. */
arg4 &= ~VKI_MAP_ALIGN;
} else
+#endif
+#if defined(VGO_freebsd)
+ if (arg4 & VKI_MAP_ALIGNMENT_MASK) {
+ mreq.rkind = MAlign;
+ if (mreq.start == 0U) {
+ mreq.start = 1U << (arg4 >> VKI_MAP_ALIGNMENT_SHIFT);
+ }
+ arg4 &= ~VKI_MAP_ALIGNMENT_MASK;
+ } else
#endif
if (arg1 != 0) {
mreq.rkind = MHint;
#define VKI_MAP_PRIVATE 0x02 /* Changes are private */
#define VKI_MAP_FIXED 0x10 /* Interpret addr exactly */
#define VKI_MAP_NORESERVE 0x0040 /* don't check for reservations */
-#define VKI_MAP_STACK 0x400
+#define VKI_MAP_STACK 0x400
#define VKI_MAP_ANON 0x1000 /* don't use a file */
-#define VKI_MAP_ANONYMOUS VKI_MAP_ANON
+#define VKI_MAP_ANONYMOUS VKI_MAP_ANON
+
+#define VKI_MAP_ALIGNED(n) ((n) << VKI_MAP_ALIGNMENT_SHIFT)
+#define VKI_MAP_ALIGNMENT_SHIFT 24
+#define VKI_MAP_ALIGNMENT_MASK VKI_MAP_ALIGNED(0xff)
+#define VKI_MAP_ALIGNED_SUPER VKI_MAP_ALIGNED(1) /* align on a superpage */
+
+
//----------------------------------------------------------------------
// From sys/stat.h
bug452274.stderr.exp \
bug498317.vgtest bug498317.stderr.exp \
bug498317.supp \
+ bug499212.vgtest \
+ bug499212.stderr.exp \
+ bug499212.stdout.exp \
cp.vgtest \
cp.stderr.exp \
osrel.vgtest \
usrstack.stdout.exp
check_PROGRAMS = \
- auxv bug498317 osrel swapcontext hello_world fexecve bug452274 \
- usrstack proc_pid_file sanity_level_thread umtx_shm_creat
+ auxv bug452274 bug498317 bug499212 fexecve hello_world osrel \
+ proc_pid_file sanity_level_thread swapcontext umtx_shm_creat usrstack
AM_CFLAGS += $(AM_FLAG_M3264_PRI)
AM_CXXFLAGS += $(AM_FLAG_M3264_PRI)
--- /dev/null
+#include <assert.h>
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <sys/mman.h>
+
+int main(int argc, char **argv)
+{
+ void *buf =
+ mmap(NULL, 1 << 20, PROT_WRITE | PROT_READ, MAP_PRIVATE | MAP_NOSYNC | MAP_ALIGNED(20) | MAP_ANON, -1, 0);
+ if (buf != MAP_FAILED)
+ {
+ assert(((uintptr_t)buf & 0xFFFFF) == 0);
+ if (((uintptr_t)buf & 0xFFFFF) != 0)
+ {
+ puts("Failure");
+ return EXIT_FAILURE;
+ }
+ }
+ puts("Success");
+ return EXIT_SUCCESS;
+}
--- /dev/null
+prog: bug499212
+vgopts: -q