public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Joao Luis Pinto <jpinto@inescporto.pt>
To: gcc-help@gcc.gnu.org
Subject: Exception thrown from multithreaded shared lib not caught in main
Date: Sat, 04 Dec 2004 06:46:00 -0000	[thread overview]
Message-ID: <41B15D13.6020800@inescporto.pt> (raw)

Dear all:

I'm building an executable that uses 2 shared libraries, compiled with 
-pthread. The executable is also compiled with -pthread. I'm using g++ 
version 3.3.4 (Debian testing x86).

One of the mentioned libraries function is throwing an exception (right 
at the start). This function call is surrounded by a try/catch block at 
main, that catches the particular thrown exception, all derived from 
std::exception and all unhandled (catch(...) ). The problem is that the 
exception does not reach this block, and abort is called. Here's a stack 
trace from gdb:

[Thread debugging using libthread_db enabled]
[New Thread 1077965824 (LWP 30731)]

Program received signal SIGABRT, Aborted.
[Switching to Thread 1077965824 (LWP 30731)]
0x43d4bed9 in raise () from /lib/tls/libc.so.6

(gdb) where
#0  0x43d4bed9 in raise () from /lib/tls/libc.so.6
#1  0x43d4d771 in abort () from /lib/tls/libc.so.6
#2  0x44c4c307 in __cxa_call_unexpected () from /usr/lib/libstdc++.so.5
#3  0x44c4c344 in std::terminate () from /usr/lib/libstdc++.so.5
#4  0x44c4c367 in std::terminate () from /usr/lib/libstdc++.so.5
#5  0x44c4c225 in __cxa_call_unexpected () from /usr/lib/libstdc++.so.5
#6  0x4000ec3e in Unitcommitment::read_conventional (connection=@0x0,
    longterm=true) at stl_alloc.h:242
#7  0x0804a782 in main (argc=1, argv=0x0) at main.cc:38

Any ideas on what's happening? I will be happy to provide further 
information if needed, like source code listings and g++ call transcript.

Thank you,

João Luis

             reply	other threads:[~2004-12-04  6:46 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-04  6:46 Joao Luis Pinto [this message]
2004-12-06  8:05 Joao Luis Pinto
2004-12-06 17:45 lrtaylor
2004-12-07 15:19 ` Joao Luis Pinto
2004-12-07 16:18 Martin York
2004-12-07 18:23 ` Joao Luis Pinto
2004-12-07 17:12 lrtaylor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41B15D13.6020800@inescporto.pt \
    --to=jpinto@inescporto.pt \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).