This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Thread-safe Exceptions are leaking
- To: egcs-patches at cygnus dot com
- Subject: Thread-safe Exceptions are leaking
- From: Andreas Wolf <ahw at mps dot OHIO-STATE dot EDU>
- Date: Sun, 4 Oct 1998 11:31:58 -0400
- Cc: ahw at clalf1 dot mps dot ohio-state dot edu
Hi,
I was waiting a long time for C++ exception handling to
become thread-safe... We need this for our applications!
Unfortunately, our programs are supposed to run for
months at a time which makes memory leaks intolerable.
(what a pain with C++ ;-) But switching on optimization
when compiling code with exceptions, egcs creates leaks!!
I traced the problem down to the DEFER_POP optimization
step, that eliminates catch/cleanup code. Now we only have
to teach egcs not to touch this part of the code.
Here is a patch to gcc/cp/except.c that seems to do that,
setting an attribute in the tree leaf of the 'CatchMatch'
function.
gcc/cp/except.c
223a224,226
> /*ahw: Try to switch on NO_DEFER_POP to close memory leak*/
> TREE_READONLY (CatchMatch) = 1;
>
Can some expert 'validate' this patch or find a better
one? If you need to test it, I can give you some
pseudo code / code snipplets that demonstrate the leak.
Please, email me directly, since I'm not reading this list
regularly.
Thanks a bunch!!
Andreas =:-)
--
----------------------------------------------------------------------
** Andreas H. Wolf ****** ******* * *
** The Ohio State University * * * * *
** Smith Lab * * * * *
** 174 West, 18th Ave * * ****** * *
** Columbus, OH 43210-1106 * * * * *
** Phn: (614) 292-6799 * * * * * Go Bucks!
** FAX: (614) 292-8261 ****** ******* ******
** E-Mail: ahw@mps.ohio-state.edu
** WWW: http://www.physics.ohio-state.edu/~ahw/
**
** 'Help Gromit! The techno trousers are going haywire!!' - Wallace
----------------------------------------------------------------------