public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/34461]  New: program crashes when using a try-catch-block around a constructor
@ 2007-12-14  9:51 c dot matuszewski at gmx dot de
  2007-12-14  9:52 ` [Bug c++/34461] " c dot matuszewski at gmx dot de
  2007-12-14 13:16 ` rguenth at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: c dot matuszewski at gmx dot de @ 2007-12-14  9:51 UTC (permalink / raw)
  To: gcc-bugs

The test case contains a constructor which is surrounded by a try-catch-block.
Inside the constructor some memory is allocated and an exception is thrown. In
the catch-block the previously allocated memory is freed which leads to an
unexpected segmentation fault. Changing the constant 16 in the test case to 15
or lower lets the program run as expected.

Output of gcc -v:
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: ../gcc-4.2.2/configure --prefix=/home/matuszewski/gcc-4.2.2
--program-suffix=-4.2.2
Thread model: posix
gcc version 4.2.2

The bug also occurs with gcc version 3.4.6

The bug is triggerd with calling "./PlayGround".


-- 
           Summary: program crashes when using a try-catch-block around a
                    constructor
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: c dot matuszewski at gmx dot de
  GCC host triplet: i386-redhat-linux
GCC target triplet: i686-pc-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34461


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/34461] program crashes when using a try-catch-block around a constructor
  2007-12-14  9:51 [Bug c++/34461] New: program crashes when using a try-catch-block around a constructor c dot matuszewski at gmx dot de
@ 2007-12-14  9:52 ` c dot matuszewski at gmx dot de
  2007-12-14 13:16 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: c dot matuszewski at gmx dot de @ 2007-12-14  9:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from c dot matuszewski at gmx dot de  2007-12-14 09:52 -------
Created an attachment (id=14752)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14752&action=view)
test case to reproduce the bug


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34461


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/34461] program crashes when using a try-catch-block around a constructor
  2007-12-14  9:51 [Bug c++/34461] New: program crashes when using a try-catch-block around a constructor c dot matuszewski at gmx dot de
  2007-12-14  9:52 ` [Bug c++/34461] " c dot matuszewski at gmx dot de
@ 2007-12-14 13:16 ` rguenth at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2007-12-14 13:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2007-12-14 13:16 -------
15.3/10  Referring to any non-static member or base class of an object in the
handler for a function-try-block of a constructor or destructor for that object
results in undefined behavior.


-- 

rguenth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34461


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-12-14 13:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-12-14  9:51 [Bug c++/34461] New: program crashes when using a try-catch-block around a constructor c dot matuszewski at gmx dot de
2007-12-14  9:52 ` [Bug c++/34461] " c dot matuszewski at gmx dot de
2007-12-14 13:16 ` rguenth 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).