public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jan Hubicka <hubicka@ucw.cz>
To: gcc@gcc.gnu.org, java@gcc.gnu.org
Subject: GCC EH unwinding bug and libjava calling std::terminate ()
Date: Fri, 27 Mar 2009 12:38:00 -0000	[thread overview]
Message-ID: <20090327123754.GA24355@kam.mff.cuni.cz> (raw)

Hi,
current mainline is buggy in EH unwinding effectivly ignoring
MUST_NOT_THROW regions when reached via RESX from local handlers.
See http://gcc.gnu.org/ml/gcc-patches/2009-03/msg01285.html for details.

Unfortunately this patch causes bootstrap failure when building libjava,
because std::terminate() is now called.  The call comes from
run_proxy in natVMProxy.cc where we have cleanup code calling
destructor of:

_Jv_InterpFrame frame_desc (self->self, thread, proxyClass,
                              NULL, frame_proxy);

Now the desctuctor is pretty simple but because of:
'if a destructor called during stack unwinding exits with an exception,
std::terminate is called'

and because we use -fnon-call-excpetion and destructor is accessing
memory, we keep MUST_NOT_THROW terminate () call accessible
because after inlining the destructor, cleanup might unwind up
to that MUST_NOT_THROW.

Questio is how to fix this situation? Shall we link with C++ runtime,
or use -fno-non-call-exceptions to build this file or somehow restruture
code to avoid this case?

Honza

             reply	other threads:[~2009-03-27 12:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-27 12:38 Jan Hubicka [this message]
2009-03-27 13:11 ` Andrew Haley
2009-03-27 18:14   ` Jan Hubicka
2009-03-27 18:21     ` Andrew Haley
2009-03-27 18:25       ` Jan Hubicka

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=20090327123754.GA24355@kam.mff.cuni.cz \
    --to=hubicka@ucw.cz \
    --cc=gcc@gcc.gnu.org \
    --cc=java@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).