|
From: <sv...@va...> - 2005-09-23 00:54:10
|
Author: sewardj
Date: 2005-09-23 01:54:05 +0100 (Fri, 23 Sep 2005)
New Revision: 4726
Log:
sync_check_mapping_callback: if V doesn't know the dev/ino for a
mapping, don't compare against the kernel's offering.
This is needed to cope with inconsistencies that arise from the
sys_shmat wrapper.
Modified:
branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
Modified: branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 00:25:1=
0 UTC (rev 4725)
+++ branches/ASPACEM/coregrind/m_aspacemgr/aspacemgr.c 2005-09-23 00:54:0=
5 UTC (rev 4726)
@@ -862,7 +862,7 @@
data. */
for (i =3D iLo; i <=3D iHi; i++) {
=20
- Bool same, cmp_offsets;
+ Bool same, cmp_offsets, cmp_devino;
=20
/* compare the kernel's offering against ours. */
same =3D nsegments[i].kind =3D=3D SkAnonC
@@ -872,10 +872,13 @@
=20
cmp_offsets
=3D nsegments[i].kind =3D=3D SkFileC || nsegments[i].kind =3D=3D=
SkFileV;
+ cmp_devino
+ =3D nsegments[i].dev !=3D 0 || nsegments[i].ino !=3D 0;
=20
same =3D same
- && nsegments[i].dev =3D=3D dev
- && nsegments[i].ino =3D=3D ino
+ && (cmp_devino
+ ? (nsegments[i].dev =3D=3D dev && nsegments[i].ino =3D=
=3D ino)
+ : True)
&& (cmp_offsets=20
? nsegments[i].start-nsegments[i].offset =3D=3D addr-=
offset
: True);
Modified: branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-23 00:=
25:10 UTC (rev 4725)
+++ branches/ASPACEM/coregrind/m_syswrap/syswrap-generic.c 2005-09-23 00:=
54:05 UTC (rev 4726)
@@ -1627,6 +1627,16 @@
=20
if (!(arg2 & 010000)) /* =3D SHM_RDONLY */
prot &=3D ~VKI_PROT_WRITE;
+ /* It isn't exactly correct to pass 0 for the fd and offset
+ here. The kernel seems to think the corresponding section
+ does have dev/ino numbers:
+ =20
+ 04e52000-04ec8000 rw-s 00000000 00:06 1966090 /SYSV00000000 (d=
eleted)
+
+ However there is no obvious way to find them. In order to
+ cope with the discrepancy, aspacem's sync checker omits the
+ dev/ino correspondence check in cases where V does not know
+ the dev/ino. */
VG_(am_notify_client_mmap)( res, VG_PGROUNDUP(segmentSize),=20
prot, VKI_MAP_ANONYMOUS, 0,0);
}
|