|
From: <sv...@va...> - 2012-02-02 21:38:32
|
Author: philippe
Date: 2012-02-02 21:33:55 +0000 (Thu, 02 Feb 2012)
New Revision: 12366
Log:
fix 290974 vgdb must align pages to VKI_SHMLBA (16KB) on ARM
In VG_(am_mmap_file_float_valgrind_flags),
when VKI_MAP_SHARED & flags, ensure the request length is big enough
to allow to roundup the returned advised to VKI_SHMLBA if needed.
Committed after regtest on f12/x86 and some limited validation on android arm
emulator.
Modified:
trunk/NEWS
trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS 2012-02-02 10:58:01 UTC (rev 12365)
+++ trunk/NEWS 2012-02-02 21:33:55 UTC (rev 12366)
@@ -50,6 +50,7 @@
287858 VG_(strerror): unknown error
289699 vgdb connection in relay mode erroneously closed due to buffer overrun
289939 wish: complete monitor cmd 'leak_check' with details about leaked or reachable blocks
+290974 vgdb must align pages to VKI_SHMLBA (16KB) on ARM
Release 3.7.0 (5 November 2011)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modified: trunk/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2012-02-02 10:58:01 UTC (rev 12365)
+++ trunk/coregrind/m_aspacemgr/aspacemgr-linux.c 2012-02-02 21:33:55 UTC (rev 12366)
@@ -2532,10 +2532,22 @@
/* Ask for an advisory. If it's negative, fail immediately. */
req.rkind = MAny;
req.start = 0;
- req.len = length;
+ #if defined(VGA_arm)
+ aspacem_assert(VKI_SHMLBA >= VKI_PAGE_SIZE);
+ #else
+ aspacem_assert(VKI_SHMLBA == VKI_PAGE_SIZE);
+ #endif
+ if ((VKI_SHMLBA > VKI_PAGE_SIZE) && (VKI_MAP_SHARED & flags)) {
+ /* arm-linux only. See ML_(generic_PRE_sys_shmat) and bug 290974 */
+ req.len = length + VKI_SHMLBA - VKI_PAGE_SIZE;
+ } else {
+ req.len = length;
+ }
advised = VG_(am_get_advisory)( &req, False/*forClient*/, &ok );
if (!ok)
return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ if ((VKI_SHMLBA > VKI_PAGE_SIZE) && (VKI_MAP_SHARED & flags))
+ advised = VG_ROUNDUP(advised, VKI_SHMLBA);
/* We have been advised that the mapping is allowable at the
specified address. So hand it off to the kernel, and propagate
|