* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
@ 2010-02-16 22:40 ` dan dot colascione at gmail dot com
2010-02-16 22:41 ` dan dot colascione at gmail dot com
` (7 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 22:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from dan dot colascione at gmail dot com 2010-02-16 22:40 -------
Created an attachment (id=19892)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19892&action=view)
testcase
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
2010-02-16 22:40 ` [Bug target/43099] " dan dot colascione at gmail dot com
@ 2010-02-16 22:41 ` dan dot colascione at gmail dot com
2010-02-16 22:43 ` dan dot colascione at gmail dot com
` (6 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 22:41 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from dan dot colascione at gmail dot com 2010-02-16 22:41 -------
Also, compilation was done with just g++-mp-4.5 -m32 foo.cpp. The leak occurs
at all optimization levels.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
2010-02-16 22:40 ` [Bug target/43099] " dan dot colascione at gmail dot com
2010-02-16 22:41 ` dan dot colascione at gmail dot com
@ 2010-02-16 22:43 ` dan dot colascione at gmail dot com
2010-02-16 22:46 ` pinskia at gcc dot gnu dot org
` (5 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 22:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from dan dot colascione at gmail dot com 2010-02-16 22:43 -------
Created an attachment (id=19893)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19893&action=view)
valgrind output showing the leak
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (2 preceding siblings ...)
2010-02-16 22:43 ` dan dot colascione at gmail dot com
@ 2010-02-16 22:46 ` pinskia at gcc dot gnu dot org
2010-02-16 22:47 ` pinskia at gcc dot gnu dot org
` (4 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-16 22:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from pinskia at gcc dot gnu dot org 2010-02-16 22:46 -------
This looks like a bug in Apple's unwinder and not a bug in GCC at all. So I
think you should report this to Apple.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (3 preceding siblings ...)
2010-02-16 22:46 ` pinskia at gcc dot gnu dot org
@ 2010-02-16 22:47 ` pinskia at gcc dot gnu dot org
2010-02-16 22:47 ` dan dot colascione at gmail dot com
` (3 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-16 22:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from pinskia at gcc dot gnu dot org 2010-02-16 22:47 -------
Oh and on x86_64-linux-gnu with and without -m32, the program does not leak.
--
pinskia at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|major |normal
GCC host triplet|i386-apple-darwin10.2.0 |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (4 preceding siblings ...)
2010-02-16 22:47 ` pinskia at gcc dot gnu dot org
@ 2010-02-16 22:47 ` dan dot colascione at gmail dot com
2010-02-16 23:07 ` dan dot colascione at gmail dot com
` (2 subsequent siblings)
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 22:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from dan dot colascione at gmail dot com 2010-02-16 22:47 -------
But the bug does not appear when compiling with gcc 4.4, which uses the same
unwinder.
--
dan dot colascione at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Severity|normal |major
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (5 preceding siblings ...)
2010-02-16 22:47 ` dan dot colascione at gmail dot com
@ 2010-02-16 23:07 ` dan dot colascione at gmail dot com
2010-02-16 23:44 ` dan dot colascione at gmail dot com
2010-02-16 23:56 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 23:07 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from dan dot colascione at gmail dot com 2010-02-16 23:07 -------
Created an attachment (id=19894)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19894&action=view)
Minimal testcase
The leak triggered by the return in the 'catch' statement in current_ex(). I've
bracketed the problematic code with an ifdef. Both catch clauses are necessary
to trigger the bug.
--
dan dot colascione at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #19892|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (6 preceding siblings ...)
2010-02-16 23:07 ` dan dot colascione at gmail dot com
@ 2010-02-16 23:44 ` dan dot colascione at gmail dot com
2010-02-16 23:56 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: dan dot colascione at gmail dot com @ 2010-02-16 23:44 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from dan dot colascione at gmail dot com 2010-02-16 23:43 -------
Created an attachment (id=19895)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=19895&action=view)
bad code
The code generated seems to violate the ABI exception handling specification
here: http://www.codesourcery.com/public/cxx-abi/abi-eh.html
That document states that the caller of void __cxa_rethrow () must call
__cxa_end_catch(), but the code for current_ex() generated by gcc 4.5 just
returns immediately.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread
* [Bug target/43099] rethrowing leaks memory like a sieve
2010-02-16 22:40 [Bug c++/43099] New: " dan dot colascione at gmail dot com
` (7 preceding siblings ...)
2010-02-16 23:44 ` dan dot colascione at gmail dot com
@ 2010-02-16 23:56 ` pinskia at gcc dot gnu dot org
8 siblings, 0 replies; 10+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2010-02-16 23:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from pinskia at gcc dot gnu dot org 2010-02-16 23:56 -------
No it does not return immediately. You are reading the code so incorrectly
because you forgot to include the exception handling table.
The code difference for the source you provided is the same between 4.4 and the
trunk except different ordering of basic blocks. At the tree level things are
more explicit though but otherwise it is the same code generation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099
^ permalink raw reply [flat|nested] 10+ messages in thread