public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "chandrakm at hotmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
Date: Tue, 01 Jul 2014 08:23:00 -0000	[thread overview]
Message-ID: <bug-61637-4-tjQoIAkjuM@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-61637-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #16 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to David Edelsohn from comment #14)
> The AIX 7.1 system in the GCC Compile Farm has GCC 4.8.1 from Perzl
> installed. As I wrote before, I tried your example program (without the
> second "e" outside scope) using
> 
> g++ -O2
> g++ -O2 -maix64
> g++ -O2 -pthread
> g++ -O2 -maix64 -pthread
> g++ -O2 -fPIC
> g++ -O2 -maix64 -fPIC
> g++ -O2 -pthread -fPIC
> g++ -O2 -maix64 -pthread -fPIC
> 
> All of them produce executables that produce the result
> 
> "This is not caught 20".
> 
> The "-shared" and other options do not make sense unless one is building a
> shared library.
> 
> Have you tried a simple test?  Without all of your additional options? I
> don't understand why you choose the path of adding more options for AIX
> linker and GCC before you try a simple test to see if your earlier,
> complicated compile and link line are the cause of the problem.


Here is some more diagnostic information. I simplified the code:

1. My original intent was to use my code in a sharelib, where __attribute__
(constructor) Initfunction() is also defined, for some initialization.  Let us
call the cpp fil with the __attribute__  statement as Test.cpp

2. to simplify , created a main.cpp with main() and compile it as binary ,it
runs fine. 

3. When i again link this main.cpp with the Test.cpp which has __attribute__ ,
then the code executes fine until an exception is throw in the code  and inside
the catch statement , i see a core dump and the see this error "terminate
called after throwing an instance of '<Namespace>::<derived exception class
from std::exepction>'
terminate called recursively IOT/Abort trap (core dumped)"


When I remove the Test.cpp file from compiler/linker, main.cpp works fine. 
When   i put the file back, core dump happens. so inside the Initfunction()
with __attribute__ (constructor)  core dump is thrown, when I try to throw and
catch an exception .


  parent reply	other threads:[~2014-07-01  8:23 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-28 12:51 [Bug c++/61637] New: " chandrakm at hotmail dot com
2014-06-28 13:57 ` [Bug c++/61637] " paolo.carlini at oracle dot com
2014-06-28 14:04 ` paolo.carlini at oracle dot com
2014-06-28 14:21 ` daniel.kruegler at googlemail dot com
2014-06-28 15:22 ` chandrakm at hotmail dot com
2014-06-28 15:24 ` chandrakm at hotmail dot com
2014-06-28 15:29 ` chandrakm at hotmail dot com
2014-06-28 16:27 ` [Bug target/61637] " paolo.carlini at oracle dot com
2014-06-28 16:29 ` chandrakm at hotmail dot com
2014-06-28 16:31 ` paolo.carlini at oracle dot com
2014-06-28 17:34 ` chandrakm at hotmail dot com
2014-06-28 20:50 ` dje at gcc dot gnu.org
2014-06-30  1:13 ` dje at gcc dot gnu.org
2014-06-30  1:50 ` chandrakm at hotmail dot com
2014-06-30  9:00 ` chandrakm at hotmail dot com
2014-06-30 15:44 ` dje at gcc dot gnu.org
2014-06-30 17:15 ` chandrakm at hotmail dot com
2014-07-01  8:23 ` chandrakm at hotmail dot com [this message]
2014-07-01 13:54 ` dje at gcc dot gnu.org
2014-07-01 15:29 ` chandrakm at hotmail dot com
2014-07-01 17:15 ` chandrakm at hotmail dot com
2014-07-02 12:38 ` dje at gcc dot gnu.org
2014-07-02 13:09 ` chandrakm at hotmail dot com
2014-07-02 17:49 ` dje at gcc dot gnu.org
2015-02-16 23:10 ` dje at gcc dot gnu.org

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=bug-61637-4-tjQoIAkjuM@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).