mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Joseph S. Myers" <joseph@codesourcery.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: <linux-kernel@vger.kernel.org>, <gcc@gcc.gnu.org>
Subject: Re: [RFC / musing] Scoped exception handling in Linux userspace?
Date: Fri, 19 Jul 2013 16:29:24 +0000	[thread overview]
Message-ID: <Pine.LNX.4.64.1307191603480.9428@digraph.polyomino.org.uk> (raw)
In-Reply-To: <CALCETrVioVM=pdCU3WhU6qDtGQyqML=btBRZ5+aV6bASj9GkOQ@mail.gmail.com>

On Thu, 18 Jul 2013, Andy Lutomirski wrote:

> 2. It's localized.  So you can mmap something, read from it *and
> handle SIGBUS*, and unmap.

There is of course no guarantee that possibly faulting memory accesses are 
preserved (GCC should never introduce such an access where it wouldn't 
occur in the abstract machine, but may well *remove* accesses that aren't 
required).  Hopefully you don't want to rely on a guarantee that faults 
will happen....

> It's worth noting that SIGBUS isn't the only interesting signal here.
> SIGFPE could work, too.  I'm not sure whether SIGPIPE would make

The SIGFPE case could potentially be relevant for C bindings to IEEE 
754-2008 (clause 8) alternate exception handling, where the expectation is 
that various forms of exception handling attribute can be associated with 
a block.  Though what such bindings will end up looking like, and to what 
extent the various cases involved will correspond to things that could be 
implemented using SIGFPE, remains to be seen - checking floating-point 
exception flags after each operation could turn out to be a better 
implementation approach in some cases.  The C floating-point group hasn't 
got as far as designing such bindings yet (currently working on parts 1-3 
of draft TS 18661, and optional attributes are to go in part 5).

(Note: although I'm interested in these floating-point issues and am 
reviewing all the parts of the draft C bindings as they become available, 
I don't have current plans for implementing them - or the remaining bits 
of C99/C11 Annex F and Annex G not yet implemented in GCC.  There's 
certainly a lot of work to be done there in both GCC and glibc, with the 
exception handling attributes from part 5, and rounding mode attributes 
from part 1, probably among the larger pieces.)

-- 
Joseph S. Myers
joseph@codesourcery.com

      parent reply	other threads:[~2013-07-19 16:29 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-19  0:26 Andy Lutomirski
2013-07-19  0:40 ` David Daney
2013-07-19  0:50   ` Andy Lutomirski
2013-07-19  1:17     ` David Daney
2013-07-19  3:29       ` Andy Lutomirski
2013-07-19 16:22         ` David Daney
2013-07-19 19:07           ` Andy Lutomirski
2013-07-19  5:43 ` Tristan Gingold
2013-07-19 16:29 ` Joseph S. Myers [this message]

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=Pine.LNX.4.64.1307191603480.9428@digraph.polyomino.org.uk \
    --to=joseph@codesourcery.com \
    --cc=gcc@gcc.gnu.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@amacapital.net \
    /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

all inboxes | Powered by JetHome®