[GD-Windows] Re : Re : Strange prolog function issue
Brought to you by:
vexxed72
|
From: Emmanuel A. <e_a...@ya...> - 2006-07-27 16:34:24
|
Hi,
=20
590 is not he size of the alloca.
This size is not known at compile time ( if it were, a mere array would be =
better ).
And actually, the alloca is not even called.
=20
As for the _resetstkoflw, we did it, but it only must be used when dealing =
with stack overflow issues, and we don't have any...
=20
But thanks for your answer anyway...
=20
=20
Emmanuel
----- Message d'origine ----
De : deldav <del...@fr...>
=C3=80 : Emmanuel Astier <e_a...@ya...>; Game Development for MS Windo=
ws <gam...@li...>
Envoy=C3=A9 le : Jeudi, 27 Juillet 2006, 3h10mn 08s
Objet : Re: [GD-Windows] Re : Strange prolog function issue
alloca allocates its memory from the stack and that space is automatically =
freed when the function returns.
That's why the compiler mess with esp and ebp ... 590h should be the size o=
f your alloca (perhaps rounded to keep stack alignement)
Beware (from msdn):
In Windows XP, if _alloca is called inside a try/catch block, you must =
call _resetstkoflw in the catch block=20
Hope that helps.
-----Message d'origine-----
De : gam...@li... [mailto:gamedevlist=
s-w...@li...] De la part de
Emmanuel Astier
Envoy=C3=A9 : mercredi 26 juillet 2006 01:13
=C3=80 : Game Development for MS Windows
Objet : [GD-Windows] Re : Strange prolog function issue
Hi,=20
It only happens in release build. And as you said, I suspect a compiler bug=
.
Actually, I don't understand when the compiler decide to switch to a differ=
ent prolog for the function, where ebp doesn't have the
same meaning.
It is all fine as the function code knows the different ebp meaning, and ha=
s no trouble accessing local vars, but the exception
handler seems not to be aware of the change in the ebp meaning.
Thanks for your help,
we send a mail to microsoft, we will wait for their anwser...
Emmanuel
Ps : Kent, replying to your mails only replies to you, not to the list...=
=20
----- Message d'origine ----
De : Kent Quirk <ken...@co...> =C3=80 : Emmanuel Astier <e_astie=
r...@ya...>; Game Development for MS Windows
<gam...@li...>
Envoy=C3=A9 le : Mardi, 25 Juillet 2006, 6h09mn 40s Objet : Re: [GD-Windows=
] Strange prolog function issue
Emmanuel Astier wrote:
> Hi all,
> =20
> =20
> I have here a very strange issue.
> =20
> We have a function using a local std::string, exceptions, and a alloca.
> =20
> When the exception is thrown, the unwind mecanism tries to delete the std=
::string, but it deletes it at a wrong address( there is
a 0x590 offset ).
> =20
> <snip>
> =20
> I could not reproduce this ebp offset that makes the exception handler fa=
il in a small sample.=20
> So do you know in which case the compiler does not put esp in ebp, but pu=
t an offset in it ?
> And do you know how to fix it ( other than what we're doing : stopping us=
ing alloca with exceptions ), if it is a kind a known
issue ?=20
> =20
Does the bug occur in both debug and release builds? Have you tried setting=
the optimization manually for that file? In any large
project, I usually find a couple of files that drive some form of compiler =
bug under full optimization, and I have to manually turn
down the optimization on that particular file or do some sort of special (h=
eavily
commented!) adaptation, such as moving a function's location in the source =
file, or in the header file. You might also try playing
with a couple of exception-related compiler switches. Compilers are complic=
ated beasts, and any project of a significant size is
likely to drive a bug or two.
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's =
Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Gamedevlists-windows mailing list
Gam...@li...
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=3D555
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share you=
r
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=3Djoin.php&p=3Dsourceforge&CID=3DDE=
VDEV
_______________________________________________
Gamedevlists-windows mailing list
Gam...@li...
https://lists.sourceforge.net/lists/listinfo/gamedevlists-windows
Archives:
http://sourceforge.net/mailarchive/forum.php?forum_id=3D555
|