Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.arch > #32056

Re: Intel MPX

From anton@mips.complang.tuwien.ac.at (Anton Ertl)
Newsgroups comp.arch
Subject Re: Intel MPX
Date 2015-12-21 17:04 +0000
Organization Institut fuer Computersprachen, Technische Universitaet Wien
Message-ID <2015Dec21.180442@mips.complang.tuwien.ac.at> (permalink)
References <n4a2kt$7gq$1@dont-email.me> <1387750795.472001138.937239.yaldnif.w-blueyonder.co.uk@news.individual.net> <c62c51ab-52cb-445a-9076-5370392cc9e3@googlegroups.com> <2015Dec18.142937@mips.complang.tuwien.ac.at> <n515vq$sed$1@dont-email.me>

Show all headers | View raw


nmm@wheeler.UUCP (Nick Maclaren) writes:
>In article <2015Dec18.142937@mips.complang.tuwien.ac.at>,
>Anton Ertl <anton@mips.complang.tuwien.ac.at> wrote:
>>William Edwards <willvarfar@gmail.com> writes:
>>>Its a shame that C didn't make it easy to do bounds checking. ...
>
>One of the many things that the UK tried and failed to get properly
>specified was what bounds checking was allowed and what was not.
>
>>There were a number of works around 2000 about such C implementations.
>>A few years later I heard an interesting talk by George Necula where
>>he explained why these implementations had not caught on: IIRC the
>>reason was that these implementations did not follow the ABI of the
>>platform, and therefore would need all the libraries compiled for
>>their ABI (and that would mean that all the libraries would have to
>>satisfy the bounds-checking constraints).
>
>Well, that's the official line, but there is another one.  C is very
>badly inconsistent here, and any such implementation would break at
>least some conforming code.

Well, given that "conforming programs" is the set of programs accepted
by any C compiler ("comforming implementation"), that's not saying
much.  Indeed, some C compiler maintainers consider most conforming
programs "buggy" and "not according to the documentation" and are
proud of breaking them.

>In particular, it introduces the issue
>that two pointers can be legally derived from two separate base
>objects, compare equal, and one subscription would fail but another
>work.

I thought about how that could happen.  I guess it can happen when two
objects happen to be adjacent to each other, and one pointer points to
the address beyond one object and the other points to the start of the
next object.

But I doubt that there is a guarantee that you can get pointers from
two base objects that compare equal.  So such a fat-pointer
implementation could either add padding to avoid that or also include
the base pointer in the comparison to avoid that, and then the problem
you describe cannot happen.

>EVERYBODY who has claimed that they can do any real C checking has
>defined their own C variant (and it's not just a matter of using a
>subset).  The sane ones admit it and accept that they will reject
>some valid (if revolting) C code, and the C fanbois deny it, often
>abusively.

I don't think that there is much code that relies on the particular
issue you mention above.  But there is a lot of low-level code around,
in particular in various libraries, that does things that you may
consider revolting, and that Mike Stump and the GCC and LLVM
maintainers probably considers "buggy" or whatever wordings they use,
and that would not work on the fat-pointer implementations.

So if one wanted to use the fat-pointer approach in for more than just
a proof-of-concept, one would have to convert lots of libraries to be
compatible with it, either by "fixing" them to avoid things that would
upset the checking that the fat-pointer implementations provide, or by
at least making the libary conform to the fat-pointer ABI; in the
latter case the checking does not extend to the library, and any
buffer overflow in the library would compromise the program, reducing
the appeal of using fat pointers.

- anton
-- 
M. Anton Ertl                    Some things have to be seen to be believed
anton@mips.complang.tuwien.ac.at Most things have to be believed to be seen
http://www.complang.tuwien.ac.at/anton/home.html

Back to comp.arch | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Intel MPX Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2015-12-09 12:26 -0800
  Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-09 13:04 -0800
  Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-09 23:27 +0100
    Re: Intel MPX Melzzzzz <mel@zzzzz.com> - 2015-12-10 00:41 +0100
      Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-10 12:22 +0100
  Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-09 17:36 -0800
    Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-10 12:36 +0100
      Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-10 03:58 -0800
        Re: Intel MPX already5chosen@yahoo.com - 2015-12-10 07:39 -0800
          Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-10 16:41 +0000
            Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 10:06 -0800
              Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 11:14 -0800
                Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 11:23 -0800
      Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-10 07:37 -0800
  Re: Intel MPX timcaffrey@aol.com - 2015-12-15 09:51 -0800
    Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-15 09:57 -0800
      Re: Intel MPX Stephen Fuld <SFuld@alumni.cmu.edu.invalid> - 2015-12-15 11:07 -0800
      Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-16 02:21 -0800
        Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-16 08:01 -0800
          Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-16 18:17 +0200
            Re: Intel MPX already5chosen@yahoo.com - 2015-12-16 08:31 -0800
            Re: Intel MPX George Neuner <gneuner2@comcast.net> - 2015-12-16 13:06 -0500
            Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-16 13:03 -0800
              Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-16 23:42 +0200
                Re: Intel MPX Bill Findlay <yaldnif.w@blueyonder.co.uk> - 2015-12-16 23:34 +0000
              Re: Intel MPX Bill Findlay <yaldnif.w@blueyonder.co.uk> - 2015-12-16 23:34 +0000
                Re: Intel MPX William Edwards <willvarfar@gmail.com> - 2015-12-16 23:39 -0800
                Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 04:44 -0800
                Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-18 13:29 +0000
                Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-18 14:42 +0000
                Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-18 07:19 -0800
                Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-18 15:49 +0000
                Re: Intel MPX anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2015-12-21 17:04 +0000
                Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-21 18:10 +0000
                Re: Intel MPX Quadibloc <jsavard@ecn.ab.ca> - 2015-12-21 10:29 -0800
                Re: Intel MPX nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-21 19:36 +0000
                Re: Intel MPX Noob <root@127.0.0.1> - 2015-12-18 22:29 +0100
                Re: Ada vs C Noob <root@127.0.0.1> - 2015-12-18 22:37 +0100
                Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 11:37 +0000
                Re: Ada vs C Anonymous <no_email@invalid.invalid> - 2015-12-19 17:19 +0000
                Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 18:32 +0000
          Re: Intel MPX already5chosen@yahoo.com - 2015-12-16 08:25 -0800
          Re: Intel MPX Bruce Hoult <bruce.hoult@gmail.com> - 2015-12-16 12:17 -0800
            Re: Intel MPX jacko <jackokring@gmail.com> - 2015-12-16 12:30 -0800
          Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-16 13:42 -0800
        Re: Intel MPX Megol <golem960@gmail.com> - 2015-12-16 13:24 -0800
          Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-17 13:56 +0100
            Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 05:22 -0800
              Re: Intel MPX Chris Gray <cg@GraySage.COM> - 2015-12-17 10:59 -0700
            Re: Intel MPX Tom Gardner <spamjunk@blueyonder.co.uk> - 2015-12-17 14:22 +0000
              Re: Intel MPX Terje Mathisen <terje.mathisen@tmsw.no> - 2015-12-17 15:48 +0100
                Re: Intel MPX Tom Gardner <spamjunk@blueyonder.co.uk> - 2015-12-17 15:04 +0000
      Re: Intel MPX Walter Banks <walter@bytecraft.com> - 2015-12-17 06:10 -0500
        Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 03:33 -0800
          Re: Intel MPX Walter Banks <walter@bytecraft.com> - 2015-12-17 08:19 -0500
            Re: Intel MPX already5chosen@yahoo.com - 2015-12-17 05:32 -0800
          Re: Intel MPX Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-17 23:02 +0200
            Re: Intel MPX MitchAlsup <MitchAlsup@aol.com> - 2015-12-18 15:01 -0800
              Re: Intel MPX Ivan Godard <ivan@millcomputing.com> - 2015-12-18 16:45 -0800
              Re: Ada vs C Niklas Holsti <niklas.holsti@tidorum.invalid> - 2015-12-19 06:29 +0200
                Re: Ada vs C Ivan Godard <ivan@millcomputing.com> - 2015-12-18 20:55 -0800
                Re: Ada vs C Anonymous <no_email@invalid.invalid> - 2015-12-19 06:11 +0000
                displays for nested functions (was Ada vs C) Ivan Godard <ivan@millcomputing.com> - 2015-12-18 23:07 -0800
                Re: displays for nested functions (was Ada vs C) Anonymous <no_email@invalid.invalid> - 2015-12-19 17:19 +0000
                Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 11:46 +0000
                Re: Ada vs C jacko <jackokring@gmail.com> - 2015-12-19 05:59 -0800
                Re: Ada vs C nmm@wheeler.UUCP (Nick Maclaren) - 2015-12-19 14:11 +0000
                Re: Ada vs C jacko <jackokring@gmail.com> - 2015-12-19 06:29 -0800
                Re: Ada vs C timcaffrey@aol.com - 2015-12-21 09:39 -0800

csiph-web