public inbox for gnu-gabi@sourceware.org
 help / color / mirror / Atom feed
From: Nathan Sidwell <nathan@acm.org>
To: Florian Weimer <fweimer@redhat.com>, GCC <gcc@gcc.gnu.org>,
	GNU C Library <libc-alpha@sourceware.org>,
	Binutils <binutils@sourceware.org>,
	gnu-gabi@sourceware.org
Subject: Re: Invalid program counters and unwinding
Date: Mon, 01 Jan 2018 00:00:00 -0000	[thread overview]
Message-ID: <f0e5d83d-7de4-5e24-cbce-9bc4db44dea3@acm.org> (raw)
In-Reply-To: <8a147f05-509f-16a0-f108-9e76bcae4ea9@redhat.com>

On 06/26/2018 07:21 AM, Florian Weimer wrote:

> GCC doesn't do this AFAIK, but it's theoretically possible not to 
> preserve the return address for a noreturn function.  But that would be 
> very bad for exception handling, so let's hope compilers don't do this.

I'd forgotten about noreturn.  Such functions may terminate by throwing 
an exception (and for our purposes I think pthread_cancel implementatio 
is sufficiently exception-like):

from C++ std:  [dcl.attr.noreturn]/2 [ Note: The function may terminate 
by throwing an exception. — end note ]

and from doc/extend.texi:

The @code{noreturn} keyword does not affect the exceptional path
when that applies: a @code{noreturn}-marked function may still
return to the caller by throwing an exception or calling
@code{longjmp}.

IIRC, in gcc-land you have to give both noreturn and nothrow attributes 
to make it non-unwindable.

nathan
-- 
Nathan Sidwell

  reply	other threads:[~2018-06-26 11:35 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-01  0:00 Florian Weimer
2018-01-01  0:00 ` Jeff Law
2018-01-01  0:00   ` Florian Weimer
2018-01-01  0:00     ` Jeff Law
2018-01-01  0:00       ` Michael Matz
2018-01-01  0:00         ` Jakub Jelinek
2018-01-01  0:00           ` Michael Matz
2018-01-01  0:00             ` Florian Weimer
2018-01-01  0:00       ` Florian Weimer
2018-01-01  0:00 ` Nathan Sidwell
2018-01-01  0:00   ` Florian Weimer
2018-01-01  0:00     ` Nathan Sidwell
2018-01-01  0:00       ` Florian Weimer
2018-01-01  0:00         ` Nathan Sidwell [this message]
2018-01-01  0:00           ` Florian Weimer
2018-01-01  0:00             ` Nathan Sidwell
2018-01-01  0:00             ` Jakub Jelinek
2018-01-01  0:00     ` Jakub Jelinek
2018-01-01  0:00       ` Florian Weimer

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=f0e5d83d-7de4-5e24-cbce-9bc4db44dea3@acm.org \
    --to=nathan@acm.org \
    --cc=binutils@sourceware.org \
    --cc=fweimer@redhat.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gnu-gabi@sourceware.org \
    --cc=libc-alpha@sourceware.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).