public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/43099] rethrowing leaks memory like a sieve
       [not found] <bug-43099-4@http.gcc.gnu.org/bugzilla/>
@ 2014-11-08 17:23 ` fxcoudert at gcc dot gnu.org
  0 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu.org @ 2014-11-08 17:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43099

Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |fxcoudert at gcc dot gnu.org
         Resolution|---                         |INVALID

--- Comment #10 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
Either this was in the Apple unwinder, or this got fixed at some point. Current
trunk on darwin14 does not give memory leaks for the testcase, neither at -m32
nor at -m64.


^ 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

* [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
                   ` (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
                   ` (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
                   ` (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
  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
  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 ` 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

end of thread, other threads:[~2014-11-08 17:23 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-43099-4@http.gcc.gnu.org/bugzilla/>
2014-11-08 17:23 ` [Bug target/43099] rethrowing leaks memory like a sieve fxcoudert at gcc dot gnu.org
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
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
2010-02-16 23:44 ` dan dot colascione at gmail dot com
2010-02-16 23:56 ` pinskia at gcc dot gnu dot org

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).