public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
From: rschiele@uni-mannheim.de
To: gcc-gnats@gcc.gnu.org
Cc: cc@pi3.informatik.uni-mannheim.de
Subject: c++/9265: exception handling faulty wenn linking PIC objects to non PIC ones
Date: Fri, 10 Jan 2003 18:56:00 -0000	[thread overview]
Message-ID: <20030110184826.13858.qmail@sources.redhat.com> (raw)


>Number:         9265
>Category:       c++
>Synopsis:       exception handling faulty wenn linking PIC objects to non PIC ones
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    unassigned
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Jan 10 10:56:02 PST 2003
>Closed-Date:
>Last-Modified:
>Originator:     Robert Schiele
>Release:        3.2.1, 3.2.2 20030109 (prerelease), 3.3 20030109 (prerelease) and 3.4 20030109 (experimental)
>Organization:
>Environment:
System: Linux scavenger 2.4.19-4GB #1 Mon Oct 14 22:11:39 UTC 2002 i686 unknown
Architecture: i686
host: i486-suse-linux-gnu
build: i486-suse-linux-gnu
target: i486-suse-linux-gnu
configured with: /home/schiele/gcccvs/gcc-3.2.1/configure --enable-threads=posix --prefix=/opt/Pkg/Linux/i686/gcc321 --enable-languages=c,c++,f77,objc --disable-libgcj --with-gxx-include-dir=/opt/Pkg/Linux/i686/gcc321/include/g++ --with-system-zlib --enable-shared --enable-__cxa_atexit i486-suse-linux
>Description:
When linking a PIC object to a non PIC one that calls a function by a function pointer, exception handling is no longer working in the PIC object.

I could reproduce this on ia32 arch.  On sparc it did not happen for me.

Note, I am not abolutely sure whether this is a bug, as I do not now what the specs say about linking PIC to non PIC objects in C++.  But as I do not sea a reason, why this should not be allowed, I assume this is a bug.

The attached lines of code should output nothing, as the thrown exception is expected to be called immediately, but they print out an "Aborted".
>How-To-Repeat:
echo 'int main() { try { throw 0; } catch (...) {}}' | \
  g++ -fpic -c -x c++ -o pic.o -
echo 'void (*b)(); void a() { (*b)(); }' | g++ pic.o -x c++ -
a.out
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:


             reply	other threads:[~2003-01-10 18:56 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10 18:56 rschiele [this message]
2003-01-13  0:14 bangerth
2003-01-13 23:36 Robert Schiele
2003-01-13 23:46 Wolfgang Bangerth
2003-01-14  7:06 Robert Schiele
2003-01-14  9:06 Robert Schiele
2003-01-14 22:46 Robert Schiele
2003-02-04 19:46 Robert Schiele
2003-02-04 20:26 Jakub Jelinek
2003-02-04 22:36 Robert Schiele
2003-02-04 22:40 bangerth
2003-02-06  9:46 Robert Schiele

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=20030110184826.13858.qmail@sources.redhat.com \
    --to=rschiele@uni-mannheim.de \
    --cc=cc@pi3.informatik.uni-mannheim.de \
    --cc=gcc-gnats@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).