|
From: <sv...@va...> - 2005-11-01 19:46:09
|
Author: tom
Date: 2005-11-01 19:46:07 +0000 (Tue, 01 Nov 2005)
New Revision: 4980
Log:
Make the request for space for the interpreter into a hint so that we
can still proceed if the preferred load address is not available.
Modified:
trunk/coregrind/m_ume.c
Modified: trunk/coregrind/m_ume.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
--- trunk/coregrind/m_ume.c 2005-11-01 17:52:34 UTC (rev 4979)
+++ trunk/coregrind/m_ume.c 2005-11-01 19:46:07 UTC (rev 4980)
@@ -438,6 +438,7 @@
=20
if (interp !=3D NULL) {
/* reserve a chunk of address space for interpreter */
+ MapRequest mreq;
Addr advised;
Bool ok;
=20
@@ -447,9 +448,10 @@
the specified address. This is a bit of hack, but it should
work because there should be no intervening transactions with
aspacem which could cause those fixed maps to fail. */
- advised =3D VG_(am_get_advisory_client_simple)(=20
- (Addr)interp_addr, interp_size, &ok=20
- );
+ mreq.rkind =3D MHint;
+ mreq.start =3D interp_addr;
+ mreq.len =3D interp_size;
+ advised =3D VG_(am_get_advisory)( &mreq, True/*client*/, &ok );
if (!ok) {
/* bomb out */
SysRes res =3D VG_(mk_SysRes_Error)(VKI_EINVAL);
|
|
From: Julian S. <js...@ac...> - 2005-11-02 18:26:28
|
Tom, can you outline the background to this? Presumably you found a
case where the interpreter-loading failed?
What's happened is, this change causes the interpreter to get loaded at
zero at least for SuSE10(x86) and whatever-Nick's-running(x86), because
the interpreter specifies a load address of zero for its text segment:
Program Headers:
Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
LOAD 0x000000 0x00000000 0x00000000 0x144f8 0x144f8 R E 0x1000
LOAD 0x014cc0 0x00015cc0 0x00015cc0 0x0079c 0x00854 RW 0x1000
and having any mapping at zero causes some of the regtests to fail
(badjump2 for one) and doesn't seem a good idea in general.
J
On Tuesday 01 November 2005 19:46, sv...@va... wrote:
> Author: tom
> Date: 2005-11-01 19:46:07 +0000 (Tue, 01 Nov 2005)
> New Revision: 4980
>
> Log:
> Make the request for space for the interpreter into a hint so that we
> can still proceed if the preferred load address is not available.
>
> Modified:
> trunk/coregrind/m_ume.c
>
>
> Modified: trunk/coregrind/m_ume.c
> ===================================================================
> --- trunk/coregrind/m_ume.c 2005-11-01 17:52:34 UTC (rev 4979)
> +++ trunk/coregrind/m_ume.c 2005-11-01 19:46:07 UTC (rev 4980)
> @@ -438,6 +438,7 @@
>
> if (interp != NULL) {
> /* reserve a chunk of address space for interpreter */
> + MapRequest mreq;
> Addr advised;
> Bool ok;
>
> @@ -447,9 +448,10 @@
> the specified address. This is a bit of hack, but it should
> work because there should be no intervening transactions with
> aspacem which could cause those fixed maps to fail. */
> - advised = VG_(am_get_advisory_client_simple)(
> - (Addr)interp_addr, interp_size, &ok
> - );
> + mreq.rkind = MHint;
> + mreq.start = interp_addr;
> + mreq.len = interp_size;
> + advised = VG_(am_get_advisory)( &mreq, True/*client*/, &ok );
> if (!ok) {
> /* bomb out */
> SysRes res = VG_(mk_SysRes_Error)(VKI_EINVAL);
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by:
> Tame your development challenges with Apache's Geronimo App Server.
> Download it for free - -and be entered to win a 42" plasma tv or your very
> own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
> _______________________________________________
> Valgrind-developers mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|
|
From: Tom H. <to...@co...> - 2005-11-02 19:09:11
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> Tom, can you outline the background to this? Presumably you found a
> case where the interpreter-loading failed?
I posted about it last night - it was causing random failures on
my FC4 x86 boxes when the syscall page happened to be placed where
the interpreter wanted to go.
> What's happened is, this change causes the interpreter to get loaded at
> zero at least for SuSE10(x86) and whatever-Nick's-running(x86), because
> the interpreter specifies a load address of zero for its text segment:
>
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> LOAD 0x000000 0x00000000 0x00000000 0x144f8 0x144f8 R E 0x1000
> LOAD 0x014cc0 0x00015cc0 0x00015cc0 0x0079c 0x00854 RW 0x1000
>
> and having any mapping at zero causes some of the regtests to fail
> (badjump2 for one) and doesn't seem a good idea in general.
Oh, just make it set MAny if interp_addr is zero. That's what the
routine it was calling before does. It's only when prelinking is on
that an address will be set.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2005-11-02 19:13:05
|
Tom,
How about the attached proposal, does that work for you? It should
still attempt to honour nonzero addresses for the interpreter but
ignore zero. This fixes the regtest failures here.
J
(m_ume.c:445):
/* Don't actually reserve the space. Just get an advisory
indicating where it would be allocated, and pass that to
mapelf(), which in turn asks aspacem to do some fixed maps at
the specified address. This is a bit of hack, but it should
work because there should be no intervening transactions with
aspacem which could cause those fixed maps to fail.
Placement policy is:
if the interpreter asks to be loaded at zero
ignore that and put it wherever we like (mappings at zero
are bad news)
else
try and put it where it asks for, but if that doesn't work,
just put it anywhere.
*/
if (interp_addr == 0) {
mreq.rkind = MAny;
mreq.start = 0;
mreq.len = interp_size;
} else {
mreq.rkind = MHint;
mreq.start = interp_addr;
mreq.len = interp_size;
}
advised = VG_(am_get_advisory)( &mreq, True/*client*/, &ok );
if (!ok) {
/* bomb out */
SysRes res = VG_(mk_SysRes_Error)(VKI_EINVAL);
if (0) VG_(printf)("reserve for interp: failed\n");
check_mmap(res, (Addr)interp_addr, interp_size);
/*NOTREACHED*/
}
On Wednesday 02 November 2005 18:29, I wrote:
> Tom, can you outline the background to this? Presumably you found a
> case where the interpreter-loading failed?
>
> What's happened is, this change causes the interpreter to get loaded at
> zero at least for SuSE10(x86) and whatever-Nick's-running(x86), because
> the interpreter specifies a load address of zero for its text segment:
>
> Program Headers:
> Type Offset VirtAddr PhysAddr FileSiz MemSiz Flg Align
> LOAD 0x000000 0x00000000 0x00000000 0x144f8 0x144f8 R E 0x1000
> LOAD 0x014cc0 0x00015cc0 0x00015cc0 0x0079c 0x00854 RW 0x1000
>
> and having any mapping at zero causes some of the regtests to fail
> (badjump2 for one) and doesn't seem a good idea in general.
>
> J
>
> On Tuesday 01 November 2005 19:46, sv...@va... wrote:
> > Author: tom
> > Date: 2005-11-01 19:46:07 +0000 (Tue, 01 Nov 2005)
> > New Revision: 4980
> >
> > Log:
> > Make the request for space for the interpreter into a hint so that we
> > can still proceed if the preferred load address is not available.
> >
> > Modified:
> > trunk/coregrind/m_ume.c
> >
> >
> > Modified: trunk/coregrind/m_ume.c
> > ===================================================================
> > --- trunk/coregrind/m_ume.c 2005-11-01 17:52:34 UTC (rev 4979)
> > +++ trunk/coregrind/m_ume.c 2005-11-01 19:46:07 UTC (rev 4980)
> > @@ -438,6 +438,7 @@
> >
> > if (interp != NULL) {
> > /* reserve a chunk of address space for interpreter */
> > + MapRequest mreq;
> > Addr advised;
> > Bool ok;
> >
> > @@ -447,9 +448,10 @@
> > the specified address. This is a bit of hack, but it should
> > work because there should be no intervening transactions with
> > aspacem which could cause those fixed maps to fail. */
> > - advised = VG_(am_get_advisory_client_simple)(
> > - (Addr)interp_addr, interp_size, &ok
> > - );
> > + mreq.rkind = MHint;
> > + mreq.start = interp_addr;
> > + mreq.len = interp_size;
> > + advised = VG_(am_get_advisory)( &mreq, True/*client*/, &ok );
> > if (!ok) {
> > /* bomb out */
> > SysRes res = VG_(mk_SysRes_Error)(VKI_EINVAL);
> >
> >
> >
> > -------------------------------------------------------
> > SF.Net email is sponsored by:
> > Tame your development challenges with Apache's Geronimo App Server.
> > Download it for free - -and be entered to win a 42" plasma tv or your
> > very own Sony(tm)PSP. Click here to play:
> > http://sourceforge.net/geronimo.php
> > _______________________________________________
> > Valgrind-developers mailing list
> > Val...@li...
> > https://lists.sourceforge.net/lists/listinfo/valgrind-developers
|