public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61637] New: C++ program  does not catch exceptions on AIX 7.1
@ 2014-06-28 12:51 chandrakm at hotmail dot com
  2014-06-28 13:57 ` [Bug c++/61637] " paolo.carlini at oracle dot com
                   ` (23 more replies)
  0 siblings, 24 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 12:51 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61637
           Summary: C++ program  does not catch exceptions on AIX 7.1
           Product: gcc
           Version: 4.8.1
            Status: UNCONFIRMED
          Severity: blocker
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: chandrakm at hotmail dot com

I have a C++ program compiled on AIX 7.1 using gcc 4.8.1 . This uses some
shared libs compiled on C language. 

None of the throws statements are caught. 

Is this a known defect or has anything to do with any gcc compiler options that
i am using.


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
@ 2014-06-28 13:57 ` paolo.carlini at oracle dot com
  2014-06-28 14:04 ` paolo.carlini at oracle dot com
                   ` (22 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-28 13:57 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2014-06-28
     Ever confirmed|0                           |1

--- Comment #1 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Please provide a self-contained preprocessed reproducer per the bug reporting
instructions.


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 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
                   ` (21 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-28 14:04 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|blocker                     |normal


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 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
                   ` (20 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2014-06-28 14:21 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
As usual you need to provide a code example and the used compiler flags.
>From gcc-bugs-return-455211-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sat Jun 28 14:35:18 2014
Return-Path: <gcc-bugs-return-455211-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 24781 invoked by alias); 28 Jun 2014 14:35:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 24757 invoked by uid 48); 28 Jun 2014 14:35:14 -0000
From: "zackw at panix dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug preprocessor/61638] New: "warning: multi-line comment" unclear and has false positives
Date: Sat, 28 Jun 2014 14:35:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: preprocessor
X-Bugzilla-Version: unknown
X-Bugzilla-Keywords: diagnostic
X-Bugzilla-Severity: enhancement
X-Bugzilla-Who: zackw at panix dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter
Message-ID: <bug-61638-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2014-06/txt/msg02293.txt.bz2
Content-length: 2353

https://gcc.gnu.org/bugzilla/show_bug.cgi?ida638

            Bug ID: 61638
           Summary: "warning: multi-line comment" unclear and has false
                    positives
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: diagnostic
          Severity: enhancement
          Priority: P3
         Component: preprocessor
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zackw at panix dot com

The warning for a // comment continued on the next line by a backslash is
"warning: multi-line comment", which doesn't make a whole lot of sense if you
don't already know that this is a possibility.  (Caret diagnostics help, but
the caret is in the wrong place: it points at the //, not the \.)

It also warns when the construct is harmless, e.g. because the next line has
another // comment on it: this naturally happens when someone feels like
drawing a tree

  //    A
  //   / \
  //  B   C

This peeves people enough to write snarky comments like this (from
https://code.monotone.ca/p/monotone/source/tree/h:net.venge.monotone/test/unit/tests/graph.cc#L260
):

  // This tests the nasty case described in the giant comment above
  // get_uncommon_ancestors:
  //
  //              9
  //              |\                  . Extraneous dots brought to you by the
  //              8 \                 . Committee to Shut Up the C Preprocessor
  //             /|  \                . (CSUCPP), and viewers like you and me.
  //            / |   |
  // (... ASCII art continues ...)

So I would like to suggest the following four improvements:

1) The warning message should be changed to "warning: backslash-newline
continues // comment onto the next line".
2) The caret should be corrected to point to the backslash, not the //.
3) The warning should be suppressed if the next line is blank or contains only
another // comment.  (It should *not* be suppressed if the next line is blank
up to a /*, because that genuinely does change the meaning of the code.
4) "warning: backslash and newline separated by space" should not be suppressed
in // comments, because see bug 8270 for a whole bunch of people being very
confused why putting a space after the backslash in their ASCII art doesn't
make it not a backslash-newline.  (It should still be suppressed in /*
comments.)


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (2 preceding siblings ...)
  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
                   ` (19 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 15:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
Compiler options tried:
-----------------------

CC= gcc
CXX=g++

Compilation flags
SYSCXXFLAGS= -Dlinux -Dlinux_x86_64 -DLINUX_AMD64 -O1 -maix64 -fpermissive
-Wextra -Wuninitialized -Winit-self -Wwrite-strings -Wall -Wno-switch
-Wno-missing-braces
CFLAGS= $(SYSCXXFLAGS) -fPIC -c  $(HEADER_PATH) $(LIBRARY_PATH)
Also tried with the different path for std library
STD_LIBRARY_PATH=-L/opt/freeware/lib64 -L/usr/lib
-L/opt/freeware/lib/gcc/powerpc-ibm-aix7.1.0.0/4.8.1/ppc64

Linker flags
$(CXX) -shared -fPIC -maix64 $(CPPOBJECTS) $(COBJECTS) -o $@ -ldl -lpthread
-lbsd $(LIBRARY_PATH) $(CATALYST_LIBS)
$(CC) -shared -fPIC -maix64 $(CPPOBJECTS) $(COBJECTS) -o $@ -ldl -lpthread
-lbsd $(LIBRARY_PATH) $(CATALYST_LIBS)

Also tried with  -Wl,-brtl  , -fexeptions, -Xlinker -bM:SRE -Xlinker -bnoentry
$
Tried with the static libgcc -static-libgcc


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (3 preceding siblings ...)
  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
                   ` (18 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 15:24 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
The symptoms are as follows: 

1. Any exception thrown ( whether a empty throw or a number or a class object )
never reaches the catch

this is happening across the code base, always, i.e. none of the catch
statements are catching anything thrown.

- Krishna


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

* [Bug c++/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (4 preceding siblings ...)
  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
                   ` (17 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
// Throw and catch not working

#include <iostream>
using namespace std;

int main () {
  try
  {
    throw 20;
  }
  catch (int e)
  {
    cout << "This is not caught " << e << '\n';
  }
catch (...)
{
cout << "This is not caught " << e << '\n';
}

  return 0;
}

I hope this information is sufficient enough.
-Krishna


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (5 preceding siblings ...)
  2014-06-28 15:29 ` chandrakm at hotmail dot com
@ 2014-06-28 16:27 ` paolo.carlini at oracle dot com
  2014-06-28 16:29 ` chandrakm at hotmail dot com
                   ` (16 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-28 16:27 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |UNCONFIRMED
                 CC|                            |dje at gcc dot gnu.org
          Component|c++                         |target
     Ever confirmed|1                           |0

--- Comment #6 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Certainly exceptions generally work on other targets.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (6 preceding siblings ...)
  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
                   ` (15 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 16:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
Hi Paolo - S0orry , not in this case. The last few days were spent in playing
with the compiler options, but none seem to work. None of the throws are being
caught. 

When you say certain exceptions work on other targets, could you please
elaborate?


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (7 preceding siblings ...)
  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
                   ` (14 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-06-28 16:31 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Something else besides AIX 7.1. Fore sure all the Linux targets are fine, for
example. This isn't a generic C++ front-end issue.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (8 preceding siblings ...)
  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
                   ` (13 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-28 17:34 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to Paolo Carlini from comment #8)
> Something else besides AIX 7.1. Fore sure all the Linux targets are fine,
> for example. This isn't a generic C++ front-end issue.

The program works fine on all other OS's ( HP UX, Linux and WIndows ) except
AIX 7.1 . Do you think using a lower gcc compiler version might help.

thanks and regards,
Krishna


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (9 preceding siblings ...)
  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
                   ` (12 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-06-28 20:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from David Edelsohn <dje at gcc dot gnu.org> ---
Exceptions had been working. There is no wholesale failure of exceptions in the
G++ testsuite.  I also don't know why you are defining macros for Linux and
AMD, or why you think that randomly adding linker options will help. I also
think library search order seems strange -- you should not need to change the
library search path and you should be linking with G++.

The more that you override defaults and add options, the less this is
considered a real bug. Fixing it by adding more options does not help.  And the
testcase is invalid.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (10 preceding siblings ...)
  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
                   ` (11 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-06-30  1:13 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from David Edelsohn <dje at gcc dot gnu.org> ---
I tested a corrected version of your example with both G++ 4.8.1 from Perzl.org
/ oss4aix.org and GCC trunk from a few days ago. I compiled both 32 bit
(default) and 64 bit (-maix64) and -pthread. All print

"This is not caught 20"

You seem to be invoking GCC incorrectly on AIX.  Why are you adding defining
Linux x86 and AMD definitions on POWER AIX? Why are you changing the library
search path order?  Why are you linking with -lpthread instead of using
-pthread GCC/G++ command line option?

>From when did you install GCC 4.8.1 on your system?  Hopefully not IBM AIX
Toolkit.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (11 preceding siblings ...)
  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
                   ` (10 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-30  1:50 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to David Edelsohn from comment #11)
> I tested a corrected version of your example with both G++ 4.8.1 from
> Perzl.org / oss4aix.org and GCC trunk from a few days ago. I compiled both
> 32 bit (default) and 64 bit (-maix64) and -pthread. All print
> 
> "This is not caught 20"
> 
> You seem to be invoking GCC incorrectly on AIX.  Why are you adding defining
> Linux x86 and AMD definitions on POWER AIX? Why are you changing the library
> search path order?  Why are you linking with -lpthread instead of using
> -pthread GCC/G++ command line option?
> 
> From when did you install GCC 4.8.1 on your system?  Hopefully not IBM AIX
> Toolkit.

Thanks for validating. I get this error:

"terminate called after throwing an instance of '<Namespace>::<derived
exception class from std::exepction>'
terminate called recursively
IOT/Abort trap (core dumped)"

I am re-verifying the order of lib loading.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (12 preceding siblings ...)
  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
                   ` (9 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-30  9:00 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to Krishnamoorthy C from comment #12)
> (In reply to David Edelsohn from comment #11)
> > I tested a corrected version of your example with both G++ 4.8.1 from
> > Perzl.org / oss4aix.org and GCC trunk from a few days ago. I compiled both
> > 32 bit (default) and 64 bit (-maix64) and -pthread. All print
> > 
> > "This is not caught 20"
> > 
> > You seem to be invoking GCC incorrectly on AIX.  Why are you adding defining
> > Linux x86 and AMD definitions on POWER AIX? Why are you changing the library
> > search path order?  Why are you linking with -lpthread instead of using
> > -pthread GCC/G++ command line option?
> > 
> > From when did you install GCC 4.8.1 on your system?  Hopefully not IBM AIX
> > Toolkit.
> 
> Thanks for validating. I get this error:
> 
> "terminate called after throwing an instance of '<Namespace>::<derived
> exception class from std::exepction>'
> terminate called recursively
> IOT/Abort trap (core dumped)"
> 
> I am re-verifying the order of lib loading.


The gcc 4.8.1 compiler was used from here:
http://www.perzl.org/aix/index.php?n=Main.Gcc

is this the correct version?


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (13 preceding siblings ...)
  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
                   ` (8 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-06-30 15:44 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|2014-06-28 00:00:00         |2014-06-30
     Ever confirmed|0                           |1

--- Comment #14 from David Edelsohn <dje at gcc dot gnu.org> ---
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.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (14 preceding siblings ...)
  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
                   ` (7 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-06-30 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
Thanks for the info.

Sorry, the original intent was to generate a shared lib hence the shared
options,  but i have moved the code to generate executable program, but the
exceptions not being caught is still there. 

I am still trying  what you suggested, stripped many of the compiler options to
see if if these are the cause.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (15 preceding siblings ...)
  2014-06-30 17:15 ` chandrakm at hotmail dot com
@ 2014-07-01  8:23 ` chandrakm at hotmail dot com
  2014-07-01 13:54 ` dje at gcc dot gnu.org
                   ` (6 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-07-01  8:23 UTC (permalink / raw)
  To: gcc-bugs

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 .


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (16 preceding siblings ...)
  2014-07-01  8:23 ` chandrakm at hotmail dot com
@ 2014-07-01 13:54 ` dje at gcc dot gnu.org
  2014-07-01 15:29 ` chandrakm at hotmail dot com
                   ` (5 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-07-01 13:54 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #17 from David Edelsohn <dje at gcc dot gnu.org> ---
Is the exception throw inside the constructor?

Are saying that the linking a file with a function defined with __attribute__
(constructor) causes the failure solely because the file is linked or are you
saying that throwing an exception inside the function defined with
__attribute__ (constructor) fails?

Throwing exceptions inside constructors is a known issue.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (17 preceding siblings ...)
  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
                   ` (4 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-07-01 15:29 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #18 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
Not just linking a file with __attribute__, but throwing exceptions inside the
constructor ( shared lib constructor ) is causing a core dump. This same code
had been run successfully on Red Hat Linux, HP UX and SUSE and Oracle Linux,
but on AIX this does not run.

Are you saying this is a known problem specific to AIX or all platforms ?

Thanks for all the help,
Krishnamoorthy


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (18 preceding siblings ...)
  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
                   ` (3 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-07-01 17:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #19 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to David Edelsohn from comment #17)
> Is the exception throw inside the constructor?
> 
> Are saying that the linking a file with a function defined with
> __attribute__ (constructor) causes the failure solely because the file is
> linked or are you saying that throwing an exception inside the function
> defined with __attribute__ (constructor) fails?
> 
> Throwing exceptions inside constructors is a known issue.

Hi Dave - 

Not solely by just linking a cpp file with __attribute__, but throwing
exceptions inside the constructor ( shared lib constructor ) is causing a core
dump. This same code had been run successfully on Red Hat Linux, HP UX and SUSE
and Oracle Linux, but on AIX this does not run.

Are you saying this is a known problem specific to AIX or all platforms ?

Thanks for all the help in advance,
Krishnamoorthy


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (19 preceding siblings ...)
  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
                   ` (2 subsequent siblings)
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-07-02 12:38 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |EH
             Target|                            |powerpc-ibm-aix
         Depends on|                            |28586

--- Comment #20 from David Edelsohn <dje at gcc dot gnu.org> ---
This probably is related to PR 28586. The detail that the failure occurs when
exceptions are thrown within constructors was important.

MD_FALLBACK_FRAME_STATE_FOR has been implemented to 32 bit AIX but not 64 bit
AIX. That probably explains why this works in 32 bit mode but not 64 bit mode.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (20 preceding siblings ...)
  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
  23 siblings, 0 replies; 25+ messages in thread
From: chandrakm at hotmail dot com @ 2014-07-02 13:09 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #21 from Krishnamoorthy C <chandrakm at hotmail dot com> ---
(In reply to David Edelsohn from comment #20)
> This probably is related to PR 28586. The detail that the failure occurs
> when exceptions are thrown within constructors was important.
> 
> MD_FALLBACK_FRAME_STATE_FOR has been implemented to 32 bit AIX but not 64
> bit AIX. That probably explains why this works in 32 bit mode but not 64 bit
> mode.

Hi Dave - Is the problem with , throwing exceptions from constructors, an
officially known issue   or just a hunch.

yes my problems appears to be similar to what was in PR 28586.

Is there any workaround at all for this.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (21 preceding siblings ...)
  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
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2014-07-02 17:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #22 from David Edelsohn <dje at gcc dot gnu.org> ---
It is specific functionality that has not yet been implemented for 64 bit AIX.
It works for 32 bit AIX.


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

* [Bug target/61637] C++ program  does not catch exceptions on AIX 7.1
  2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 chandrakm at hotmail dot com
                   ` (22 preceding siblings ...)
  2014-07-02 17:49 ` dje at gcc dot gnu.org
@ 2015-02-16 23:10 ` dje at gcc dot gnu.org
  23 siblings, 0 replies; 25+ messages in thread
From: dje at gcc dot gnu.org @ 2015-02-16 23:10 UTC (permalink / raw)
  To: gcc-bugs

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

David Edelsohn <dje at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|---                         |DUPLICATE

--- Comment #23 from David Edelsohn <dje at gcc dot gnu.org> ---


*** This bug has been marked as a duplicate of bug 28586 ***


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

end of thread, other threads:[~2015-02-16 23:10 UTC | newest]

Thread overview: 25+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-28 12:51 [Bug c++/61637] New: C++ program does not catch exceptions on AIX 7.1 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
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

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