|
From: <sv...@va...> - 2009-05-24 23:06:40
|
Author: njn
Date: 2009-05-25 00:06:36 +0100 (Mon, 25 May 2009)
New Revision: 10135
Log:
Trunk sync: reinstate a check on Linux.
Modified:
branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
Modified: branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c
===================================================================
--- branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-05-24 23:02:55 UTC (rev 10134)
+++ branches/DARWIN/coregrind/m_aspacemgr/aspacemgr-linux.c 2009-05-24 23:06:36 UTC (rev 10135)
@@ -2395,6 +2395,16 @@
if (sr_isError(sres))
return sres;
+#if defined(VGO_linux)
+ if (sr_Res(sres) != advised) {
+ /* I don't think this can happen. It means the kernel made a
+ fixed map succeed but not at the requested location. Try to
+ repair the damage, then return saying the mapping failed. */
+ (void)ML_(am_do_munmap_NO_NOTIFY)( sr_Res(sres), length );
+ return VG_(mk_SysRes_Error)( VKI_EINVAL );
+ }
+#endif
+
/* Ok, the mapping succeeded. Now notify the interval map. */
init_nsegment( &seg );
seg.kind = SkAnonV;
|