public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60685] New: exception not caught by enclosing catch
@ 2014-03-27 14:49 jens.maurer at gmx dot net
  2014-03-27 15:03 ` [Bug c++/60685] " redi at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: jens.maurer at gmx dot net @ 2014-03-27 14:49 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60685
           Summary: exception not caught by enclosing catch
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jens.maurer at gmx dot net

Created attachment 32465
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=32465&action=edit
source code to reproduce the issue

When compiling and linking the attached two files, I get a core dump,
although I expect the catch(Ex&):

$ g++ -v -std=c++11 x.cc y.cc
...
GNU C++ (GCC) version 4.8.2 (x86_64-unknown-linux-gnu)
...

$ gdb ./a.out
(gdb) run
Starting program: /home/jmaurer/IDMS/svn/trunk/libs/tlfr/fundamental/./a.out 
terminate called after throwing an instance of 'Ex'

Program received signal SIGABRT, Aborted.

(gdb) bt
#0  0x00007ffff722bf77 in __GI_raise (sig=sig@entry=6)
    at ../nptl/sysdeps/unix/sysv/linux/raise.c:56
#1  0x00007ffff722f5e8 in __GI_abort () at abort.c:90
#2  0x00007ffff7b376e5 in __gnu_cxx::__verbose_terminate_handler() ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff7b35856 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7b34919 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff7b354ca in __gxx_personality_v0 ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff75cc7f3 in ?? () from /lib/x86_64-linux-gnu/libgcc_s.so.1
#7  0x00007ffff75ccb8b in _Unwind_RaiseException ()
   from /lib/x86_64-linux-gnu/libgcc_s.so.1
#8  0x00007ffff7b35aa1 in __cxa_throw ()
   from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#9  0x000000000040094e in B::B() ()
#10 0x0000000000400978 in A::f() ()
#11 0x0000000000400923 in S::S(A&) ()
#12 0x00000000004008ba in main ()


$ ld --version
GNU ld (GNU Binutils for Ubuntu) 2.23.52.20130913

This is also reproducible with

$ ld --version
GNU gold (GNU Binutils for Ubuntu 2.23.52.20130913) 1.11


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

* [Bug c++/60685] exception not caught by enclosing catch
  2014-03-27 14:49 [Bug c++/60685] New: exception not caught by enclosing catch jens.maurer at gmx dot net
@ 2014-03-27 15:03 ` redi at gcc dot gnu.org
  2015-03-05  9:16 ` jens.maurer at gmx dot net
  2015-08-08  7:24 ` jens.maurer at gmx dot net
  2 siblings, 0 replies; 4+ messages in thread
From: redi at gcc dot gnu.org @ 2014-03-27 15:03 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-03-27
     Ever confirmed|0                           |1

--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Reduced to a single file:

struct B {
  B() { throw 1; }
};

B f() { return B(); }

struct S {
  B b = f();
};

int main()
{
  try {
    S s;
  } catch(int) {
  }
}


In __cxa_throw we return from _Unwind_RaiseException and run:

82        // Some sort of unwinding error.  Note that terminate is a handler.
83        __cxa_begin_catch (&header->exc.unwindHeader);
84        std::terminate ();
85      }


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

* [Bug c++/60685] exception not caught by enclosing catch
  2014-03-27 14:49 [Bug c++/60685] New: exception not caught by enclosing catch jens.maurer at gmx dot net
  2014-03-27 15:03 ` [Bug c++/60685] " redi at gcc dot gnu.org
@ 2015-03-05  9:16 ` jens.maurer at gmx dot net
  2015-08-08  7:24 ` jens.maurer at gmx dot net
  2 siblings, 0 replies; 4+ messages in thread
From: jens.maurer at gmx dot net @ 2015-03-05  9:16 UTC (permalink / raw)
  To: gcc-bugs

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

Jens Maurer <jens.maurer at gmx dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Version|4.8.2                       |4.9.2

--- Comment #3 from Jens Maurer <jens.maurer at gmx dot net> ---
Jonathan's reduced testcase reproducibly crashes when compiled with gcc 4.9.2,
too.


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

* [Bug c++/60685] exception not caught by enclosing catch
  2014-03-27 14:49 [Bug c++/60685] New: exception not caught by enclosing catch jens.maurer at gmx dot net
  2014-03-27 15:03 ` [Bug c++/60685] " redi at gcc dot gnu.org
  2015-03-05  9:16 ` jens.maurer at gmx dot net
@ 2015-08-08  7:24 ` jens.maurer at gmx dot net
  2 siblings, 0 replies; 4+ messages in thread
From: jens.maurer at gmx dot net @ 2015-08-08  7:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jens Maurer <jens.maurer at gmx dot net> ---
Works with 5.1.0 and 5.2.0, so this seems to be resolved.


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

end of thread, other threads:[~2015-08-08  7:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-27 14:49 [Bug c++/60685] New: exception not caught by enclosing catch jens.maurer at gmx dot net
2014-03-27 15:03 ` [Bug c++/60685] " redi at gcc dot gnu.org
2015-03-05  9:16 ` jens.maurer at gmx dot net
2015-08-08  7:24 ` jens.maurer at gmx dot net

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