public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug gdb/11328] New: std::terminate isn't caught if one manually calls an inferior function that calls dlopen
@ 2010-02-26  1:38 pedro at codesourcery dot com
  2010-02-26  1:39 ` [Bug gdb/11328] " pedro at codesourcery dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pedro at codesourcery dot com @ 2010-02-26  1:38 UTC (permalink / raw)
  To: gdb-prs

Below are a couple of contrived examples to show the problem.

Example 1, with dlopen call:

1:

 void function (void)
 {
   dlopen (SHLIB_NAME, RTLD_LAZY);
   std::terminate ();
 }

 int main()
 {
 }

(gdb) start
(gdb) call function ()
terminate called without an active exception

Program received signal SIGABRT, Aborted.
0x00007ffff70f44b5 in raise () from /lib/libc.so.6
The program being debugged was signaled while in a function called from GDB.
GDB remains in the frame where the signal was received.
To change this behavior use "set unwindonsignal on".
Evaluation of the expression containing the function
(function()) will be abandoned.
When the function is done executing, GDB will silently stop.
(gdb)


But if one removes the call to dlopen, the problem is gone.  Example 2
below shows that.

2:

 void function (void)
 {
   std::terminate ();
 }

 int main()
 {
 }

(gdb) start
(gdb) call function ()

Breakpoint 0, 0x00007ffff7992110 in std::terminate() () from /usr/lib/libstdc++.so.6
The program being debugged entered a std::terminate call, most likely
caused by an unhandled C++ exception.  GDB blocked this call in order
to prevent the program from being terminated, and has restored the
context to its original state before the call.
To change this behaviour use "set unwind-on-terminating-exception off".
Evaluation of the expression containing the function (function())
will be abandoned.
(gdb)

-- 
           Summary: std::terminate isn't caught if one manually calls an
                    inferior function that calls dlopen
           Product: gdb
           Version: 7.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
        AssignedTo: unassigned at sourceware dot org
        ReportedBy: pedro at codesourcery dot com
                CC: gdb-prs at sourceware dot org


http://sourceware.org/bugzilla/show_bug.cgi?id=11328

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2010-03-25 20:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-02-26  1:38 [Bug gdb/11328] New: std::terminate isn't caught if one manually calls an inferior function that calls dlopen pedro at codesourcery dot com
2010-02-26  1:39 ` [Bug gdb/11328] " pedro at codesourcery dot com
2010-02-26  1:44 ` pedro at codesourcery dot com
2010-03-16 20:38 ` tromey at redhat dot com
2010-03-25 20:53 ` tromey at redhat dot com

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