]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove an incorrect assertion. Need to consider SkShmC segments as well.
authorFlorian Krohm <florian@eich-krohm.de>
Thu, 21 May 2015 22:41:39 +0000 (22:41 +0000)
committerFlorian Krohm <florian@eich-krohm.de>
Thu, 21 May 2015 22:41:39 +0000 (22:41 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15269

coregrind/m_aspacemgr/aspacemgr-linux.c
none/tests/linux/Makefile.am
none/tests/linux/mremap6.c [new file with mode: 0644]
none/tests/linux/mremap6.stderr.exp [new file with mode: 0644]
none/tests/linux/mremap6.vgtest [new file with mode: 0644]

index 4be99fa122dc75512b3fe5a2488d8e4530cb8f86..0f27506713e7806c3e6604e7c56ecc030d3f1985 100644 (file)
@@ -3001,9 +3001,6 @@ Bool VG_(am_relocate_nooverlap_client)( /*OUT*/Bool* need_discard,
    /* Mark the new area based on the old seg. */
    if (seg.kind == SkFileC) {
       seg.offset += ((ULong)old_addr) - ((ULong)seg.start);
-   } else {
-      aspacem_assert(seg.kind == SkAnonC);
-      aspacem_assert(seg.offset == 0);
    }
    seg.start = new_addr;
    seg.end   = new_addr + new_len - 1;
index 125d1203a2c362186eff0037b62fbff1a198a2c6..44b5ace94c0dcf54c76f00c354d4188599736701 100644 (file)
@@ -13,6 +13,7 @@ EXTRA_DIST = \
        mremap3.stderr.exp mremap3.stdout.exp mremap3.vgtest \
        mremap4.stderr.exp mremap4.vgtest \
        mremap5.stderr.exp mremap5.vgtest \
+       mremap6.stderr.exp mremap6.vgtest \
        pthread-stack.stderr.exp pthread-stack.vgtest \
        stack-overflow.stderr.exp stack-overflow.vgtest
 
@@ -25,6 +26,7 @@ check_PROGRAMS = \
        mremap3 \
        mremap4 \
        mremap5 \
+       mremap6 \
        pthread-stack \
        stack-overflow
 
diff --git a/none/tests/linux/mremap6.c b/none/tests/linux/mremap6.c
new file mode 100644 (file)
index 0000000..bcebaf5
--- /dev/null
@@ -0,0 +1,31 @@
+#define _GNU_SOURCE
+#include <stdio.h>
+#include <stdlib.h>
+#include <assert.h>
+#include <sys/ipc.h>
+#include <sys/shm.h>
+#include <sys/stat.h>
+#include <sys/mman.h>
+
+static void *mkmap(unsigned sz)
+{
+  int shmid = shmget(IPC_PRIVATE, sz, 
+                     IPC_CREAT | IPC_EXCL | S_IRUSR | S_IWUSR);
+  assert(shmid != -1);
+
+  void *addr = shmat(shmid, NULL, 0);
+  assert(addr != (void *)-1);
+
+  return addr;
+}
+
+int main()
+{
+  void *np, *p;
+       
+  p  = mkmap(1024*1024);
+  np = mremap(p, 1024*1024, 2048*1024, MREMAP_MAYMOVE); /* grow, maymove */
+  assert(np != (void *)-1);
+
+  return 0;
+}
diff --git a/none/tests/linux/mremap6.stderr.exp b/none/tests/linux/mremap6.stderr.exp
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/none/tests/linux/mremap6.vgtest b/none/tests/linux/mremap6.vgtest
new file mode 100644 (file)
index 0000000..af29cfe
--- /dev/null
@@ -0,0 +1,5 @@
+prog: mremap6
+vgopts: -q
+# This testcase used to run into an assertion. Therefore cannot use
+# the default filter because need to see lines beginning with --<pid> .....
+stderr_filter: ../../../tests/filter_addresses