public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* Re: c++/8047: [i386] Stack corruption with exceptions
@ 2002-11-21 17:52 Wolfgang Bangerth
0 siblings, 0 replies; 3+ messages in thread
From: Wolfgang Bangerth @ 2002-11-21 17:52 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8047; it has been noted by GNATS.
From: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
To: gcc-gnats@gcc.gnu.org, <gcc-bugs@gcc.gnu.org>
Cc:
Subject: Re: c++/8047: [i386] Stack corruption with exceptions
Date: Fri, 15 Nov 2002 18:31:44 -0600 (CST)
I just looked at this report. A reduced testcase is this:
-----------------------------------
struct auto_ptr {
auto_ptr(int) { }
};
int foo() { throw 5; }
int main()
{
label:
try {
auto_ptr x(foo());
}
catch (...)
{
}
goto label;
}
----------------------------------
On closer examination, I believe this to be actually a stack corruption
bug, because if I put a breakpoint into the loop, I can see how the stack
pointer is decreased by 8 bytes in each iteration, which eventually leads
to the program running out of space. Note that this behavior requires that
you use -march=386, using i686 does not trigger the problem.
Regards
Wolfgang
-------------------------------------------------------------------------
Wolfgang Bangerth email: bangerth@ticam.utexas.edu
www: http://www.ticam.utexas.edu/~bangerth
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8047: [i386] Stack corruption with exceptions
@ 2002-11-25 0:26 Danny Smith
0 siblings, 0 replies; 3+ messages in thread
From: Danny Smith @ 2002-11-25 0:26 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8047; it has been noted by GNATS.
From: Danny Smith <dannysmith@clear.net.nz>
To: gcc-gnats@gcc.gnu.org
Cc:
Subject: Re: c++/8047: [i386] Stack corruption with exceptions
Date: Mon, 18 Nov 2002 23:51:15 +0000
[The following observations are for mingw32 and cygwin builds with
Dwarf2 EH enabled. The patches to enable Dwarf2 are in the
cygwin-mingw-gcc-3_2-branch.]
I have just tried this with i386-mingw32 (GCC3.3) with same result: Okay
with
march=i686, stack exhaustion with i[345]86. However, if add
-maccumulate-ougoing-args, the stack is okay with default -march=i386
Ditto with cygwin
Coincidentally, in mingw and cygwin, functions that call a __stdcall
function
(callee pops stack) show stack corruption with Dwarf2 exceptions when
compiled with
-fomit-frame-pointer, but are okay with -fomit-frame-pointer
-maccumulate-outgoing-args.
Also, perhaps related is PR6764, which still fails on mingw
with --march=i386
but not with -march=i686 or -maccumulate-outgoing-args
Danny
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: c++/8047: [i386] Stack corruption with exceptions
@ 2003-02-04 20:56 Colin Burgess
0 siblings, 0 replies; 3+ messages in thread
From: Colin Burgess @ 2003-02-04 20:56 UTC (permalink / raw)
To: nobody; +Cc: gcc-prs
The following reply was made to PR c++/8047; it has been noted by GNATS.
From: Colin Burgess <cburgess@qnx.com>
To: wagner@rtna.daimlerchrysler.com, king@rtna.daimlerchrysler.com,
nobody@gcc.gnu.org, gcc-gnats@gcc.gnu.org, gcc-bugs@gcc.gnu.org,
schroedl@rtna.daimlerchrysler.com, gcc-prs@gcc.gnu.org,
kloeckner@rtna.daimlerchrysler.com
Cc:
Subject: Re: c++/8047: [i386] Stack corruption with exceptions
Date: Tue, 04 Feb 2003 15:58:45 -0500
Hey guys, I think I saw this already. See
http://gcc.gnu.org/ml/gcc-bugs/2001-12/msg00522.html
You can check it by seeing if -fno-defer-pop helps the problem. If so,
then here is a patch for 2.95.3
Index: except.c
===================================================================
RCS file: /product/tools/gcc/gcc/cp/except.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -c -r1.1 -r1.2
*** except.c 28 Feb 2001 18:54:56 -0000 1.1
--- except.c 12 Dec 2001 18:03:07 -0000 1.2
***************
*** 1135,1140 ****
--- 1135,1143 ----
expand_expr (exp, const0_rtx, VOIDmode, EXPAND_NORMAL);
}
+ /* make sure we have cleaned up the stack */
+ do_pending_stack_adjust();
+
expand_internal_throw ();
}
http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=8047
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-02-04 20:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-11-21 17:52 c++/8047: [i386] Stack corruption with exceptions Wolfgang Bangerth
2002-11-25 0:26 Danny Smith
2003-02-04 20:56 Colin Burgess
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).