Remove an incorrect assertion. Need to consider SkShmC segments as well.


git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15269 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c
index 4be99fa..0f27506 100644
--- a/coregrind/m_aspacemgr/aspacemgr-linux.c
+++ b/coregrind/m_aspacemgr/aspacemgr-linux.c
@@ -3001,9 +3001,6 @@
    /* 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;
diff --git a/none/tests/linux/Makefile.am b/none/tests/linux/Makefile.am
index 125d120..44b5ace 100644
--- a/none/tests/linux/Makefile.am
+++ b/none/tests/linux/Makefile.am
@@ -13,6 +13,7 @@
 	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 @@
 	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
index 0000000..bcebaf5
--- /dev/null
+++ b/none/tests/linux/mremap6.c
@@ -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
index 0000000..e69de29
--- /dev/null
+++ b/none/tests/linux/mremap6.stderr.exp
diff --git a/none/tests/linux/mremap6.vgtest b/none/tests/linux/mremap6.vgtest
new file mode 100644
index 0000000..af29cfe
--- /dev/null
+++ b/none/tests/linux/mremap6.vgtest
@@ -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