From: Florian Krohm Date: Thu, 21 May 2015 22:41:39 +0000 (+0000) Subject: Remove an incorrect assertion. Need to consider SkShmC segments as well. X-Git-Tag: svn/VALGRIND_3_11_0~358 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=31536d92a1e5a28b3045231217e5fd3e8433e6b6;p=thirdparty%2Fvalgrind.git Remove an incorrect assertion. Need to consider SkShmC segments as well. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@15269 --- diff --git a/coregrind/m_aspacemgr/aspacemgr-linux.c b/coregrind/m_aspacemgr/aspacemgr-linux.c index 4be99fa122..0f27506713 100644 --- a/coregrind/m_aspacemgr/aspacemgr-linux.c +++ b/coregrind/m_aspacemgr/aspacemgr-linux.c @@ -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; diff --git a/none/tests/linux/Makefile.am b/none/tests/linux/Makefile.am index 125d1203a2..44b5ace94c 100644 --- a/none/tests/linux/Makefile.am +++ b/none/tests/linux/Makefile.am @@ -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 index 0000000000..bcebaf59a2 --- /dev/null +++ b/none/tests/linux/mremap6.c @@ -0,0 +1,31 @@ +#define _GNU_SOURCE +#include +#include +#include +#include +#include +#include +#include + +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 0000000000..e69de29bb2 diff --git a/none/tests/linux/mremap6.vgtest b/none/tests/linux/mremap6.vgtest new file mode 100644 index 0000000000..af29cfe047 --- /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 -- ..... +stderr_filter: ../../../tests/filter_addresses