public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: vijay nag <vijunag@gmail.com>
To: Jonathan Wakely <jwakely.gcc@gmail.com>
Cc: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Re: C++ exceptions
Date: Thu, 21 Nov 2013 10:23:00 -0000	[thread overview]
Message-ID: <CAKhyrx9Px6hn6UYcuoaBf6ZkDK+2axiJiMXWMLz3SGZaTSbT+Q@mail.gmail.com> (raw)
In-Reply-To: <CAH6eHdT-xqEGfQRinbf+thpx0epV1aNggQqbhyzsXHQts8FXJQ@mail.gmail.com>

On Wed, Nov 20, 2013 at 11:28 PM, Jonathan Wakely <jwakely.gcc@gmail.com> wrote:
> On 20 November 2013 17:43, vijay nag wrote:
>>
>> Nope Im running a variant of debian linux i686 kernel. Does GCC pick
>> libgcc from GCC_EXEC_PREFIX ?  I am running the program in complete
>> chroot encironment so that libraries donot collide with host machine.
>> Are you telling me that Issue is because of wrong version of libgcc ?
>
> It's not possible to say, because you've still provided almost no
> information.  How are you building the libraries? What flags are you
> using to compile and link?
>
> Is the exception thrown from one of the libraries? Is the catch in a
> library or the main program?
>
> Have you tried a simple example that just has a single function in a
> single shared library that throws an exception?  If not, why not?
>
> Without most of this information we're just guessing randomly what the
> problem might be.

I tried creating a small binary to demonstrate the problem that I had
been facing with my gcc-4.7.2 tool chain and glibc-2.17. The library
and binaries were created using exact CFLAGS, CXXFLAGS et al.
Strangely, the problem doesn't manifest in my example program :(.  On
further hacking and debugging libgcc, I found that
_Unwind_RaiseException() was always "returning" in failure case with
return code _URC_END_OF_STACK.  Does it mean that FDE is missing for
the function which is suppose to catch the exception ? How do I check
if an FDE exists for a particular function or not ?

"Wait, are you throwing from a destructor? Those are noexcept by
default nowadays, which would cause a call to std::terminate. Specify
noexcept(false) on it if you insist."

>>> I don't think Im throwing exception from a destructor and by the way Try/Catch is not working even for POD types.

  reply	other threads:[~2013-11-21  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-20 12:49 vijay nag
2013-11-20 14:53 ` Marc Glisse
2013-11-20 17:58   ` vijay nag
2013-11-20 17:59     ` Marc Glisse
2013-11-20 18:14     ` Jonathan Wakely
2013-11-21 10:23       ` vijay nag [this message]
2013-11-22 19:47         ` Ian Lance Taylor
2013-11-23 16:40           ` vijay nag
2013-11-23 16:42             ` Jonathan Wakely
2013-11-23 16:54               ` Jonathan Wakely

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=CAKhyrx9Px6hn6UYcuoaBf6ZkDK+2axiJiMXWMLz3SGZaTSbT+Q@mail.gmail.com \
    --to=vijunag@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    --cc=jwakely.gcc@gmail.com \
    /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).