|
From: <sv...@va...> - 2010-12-08 02:51:52
|
Author: njn
Date: 2010-12-08 02:51:43 +0000 (Wed, 08 Dec 2010)
New Revision: 11485
Log:
When a shmat() size is passed to the tool, round it up to a page size. This
is how mmap() sizes are treated. It fixes an assertion failure in Massif
with --pages-as-heap=yes.
Modified:
trunk/coregrind/m_syswrap/syswrap-generic.c
Modified: trunk/coregrind/m_syswrap/syswrap-generic.c
===================================================================
--- trunk/coregrind/m_syswrap/syswrap-generic.c 2010-12-08 02:42:38 UTC (rev 11484)
+++ trunk/coregrind/m_syswrap/syswrap-generic.c 2010-12-08 02:51:43 UTC (rev 11485)
@@ -1772,7 +1772,7 @@
UWord res,
UWord arg0, UWord arg1, UWord arg2 )
{
- UInt segmentSize = get_shm_size ( arg0 );
+ UInt segmentSize = VG_PGROUNDUP(get_shm_size(arg0));
if ( segmentSize > 0 ) {
UInt prot = VKI_PROT_READ|VKI_PROT_WRITE;
Bool d;
@@ -1789,7 +1789,7 @@
cope with the discrepancy, aspacem's sync checker omits the
dev/ino correspondence check in cases where V does not know
the dev/ino. */
- d = VG_(am_notify_client_shmat)( res, VG_PGROUNDUP(segmentSize), prot );
+ d = VG_(am_notify_client_shmat)( res, segmentSize, prot );
/* we don't distinguish whether it's read-only or
* read-write -- it doesn't matter really. */
|