This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: c++/9588: memory fault when user throws exception from terminate()
- From: fwang at ca dot ibm dot com
- To: nathan at gcc dot gnu dot org, "Frank Wang" <fwang at ca dot ibm dot com>, gcc-bugs at gcc dot gnu dot org, gcc-prs at gcc dot gnu dot org, nobody at gcc dot gnu dot org, gcc-gnats at gcc dot gnu dot org
- Date: Wed, 5 Feb 2003 16:52:25 -0500
- Subject: Re: c++/9588: memory fault when user throws exception from terminate()
Hi,
I think the real problem in calling terminate() function. according to
Spec.15.1.8 and Spec.15.5
If no exception is presently being handled, executing a throw-expression
with no operand calls terminate() (15.5.1).
If you try to compile and run following codes, you can get different result
in 32bit gcc and 64bit gcc.
//tmp.cpp
#include <exception>
struct S {
int i;
S() {i=1;}
};
int main(void)
{
try {
throw 'a';
}
catch (S) {
}
return 0;
}
For 32bit gcc: actual output: Abort
For 64ibt gcc: acutal output: Memory fault
Regards,
Frank Wang
VisualAge C/C++ Compiler Test
IBM Toronto Lab
Phone:(905) 413 - 2337 TieLine: 969 - 2337
Email: fwang@ca.ibm.com