This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
exceptions handling and memory leak in egcs1.1
- To: egcs-bugs at cygnus dot com
- Subject: exceptions handling and memory leak in egcs1.1
- From: Lars Hofhansl <lars_hofhansl at public dot uni-hamburg dot de>
- Date: Fri, 04 Sep 1998 09:23:40 +0200
- Organization: what... organized ?!
Hi,
I think I discovered a bug in the egcs 1.1 exeception
code.
Here's a little test program to exhibit this bug.
-------------------
#include <stdio.h>
void *mt (void *arg)
{
long i;
for( i=0; i<100000; i++ )
{
try {
throw( 5 );
} catch (int x)
{}
}
return (void*)i;
}
void main (int argc, char *argv[])
{
printf( "result: %d\n", (int)mt(0) );
}
---------------------------
Everything is fine, as long as no optimizations are used.
As soon as some optimizations are user (-O, -O2, -O3)
the process will leak memory until it segfaults.
Cheers,
Lars