all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Emanuel Berg <moasen@zoho.com>
To: help-gnu-emacs@gnu.org
Subject: Re: CVE-2017-14482 - Red Hat Customer Portal
Date: Sat, 23 Sep 2017 00:14:22 +0200	[thread overview]
Message-ID: <86k20qbcu9.fsf@zoho.com> (raw)
In-Reply-To: 1b3bec6e-d4d5-37a7-ba54-49bd2d8281bd@yandex.com

Mario Castelán Castro wrote:

> That is the problem with nearly all
> contemporary programs: Instead of verifying
> that they are correct; it is verified that
> they are not incorrect according to a small
> set of ways in which a program may be
> incorrect. [...]

Also, formal verification that is applied on
a model will only prove that *the model* is
correct, not the real thing.

There is one automated way of testing that
I know of that actually works, and that is for
shell tools that have the super-simple text
interface where the tool accepts a limited set
of arguments. Say that it accepts one integer
as the first argument and then one string as
its second. Then it is trivial to setup a test
program that will just invoke repeatedly with
randomized integers and strings. Because its
random, it might find borderline cases which
makes absolutely no sense (but still shouldn't
break the program), but which supposedly
rational human beings would never think of
to input, and thus without the test program,
would never get tested.

But for a huge software system like Emacs,
formal verification being obviously out of the
question, even simple-minded brute-force
testing is difficult to set up, at least for
anything bigger than the smallest module.el.
So the byte-compiler and style checks
(`checkdoc-current-buffer') is what you got.

Instead, I think the best way to test is just
to have lots of people using it. At least major
flaws will surface really soon this way.

There are also languages like Dafny where you
can state formally what a function should do,
and the verification tool will match that to
your code. Problem is, it isn't refined to any
degree where it actually will matter for
every-day programming. Often, the code will be
correct, and the formal description is correct
as well, only the verifier will still say it
doesn't compute. And programming should
obviously not be about tinkering with code and
expressions that already makes sense, just so
that the computer will agree it does.
So straight down the line, this will amount to
toy/demo programs as well.

Here is an example:

    method Main () {
      var n := f(4, 5);
      print "The result is ";
      print n;
    }

    method f(a:int, b:int) returns (r:int)
      requires a >= 0;
      requires b >= 0;
      ensures  r == 4*a + b;
    {
      r := 0;
      var i := 0;
      var j := 0;
      while (i < a || j < b)
        decreases a + b - (i + j);
        invariant 0 <= i <= a;
        invariant 0 <= j <= b;
        invariant r == 4*i + j;
      {
        if (j < b) {
          r := r + 1;
          j := j + 1;
        }
        else {
          r := r + 4;
          i := i + 1;
        }
      }
    }

There is a Dafny mode for Emacs, and with Mono
(because it is an .NET thing to begin with),
perhaps one could hook that up into a neat IDE.
Still, it will only amount to poor Dafny.

-- 
underground experts united
http://user.it.uu.se/~embe8573




  reply	other threads:[~2017-09-22 22:14 UTC|newest]

Thread overview: 68+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-21 21:51 CVE-2017-14482 - Red Hat Customer Portal ken
2017-09-21 22:03 ` Kaushal Modi
2017-09-21 23:07   ` ken
2017-09-22  7:37     ` Alberto Luaces
2017-09-22  7:48       ` Emanuel Berg
2017-09-22 20:12         ` Mario Castelán Castro
2017-09-22 22:14           ` Emanuel Berg [this message]
2017-09-24  2:08             ` Mario Castelán Castro
     [not found]             ` <mailman.1063.1506218941.14750.help-gnu-emacs@gnu.org>
2017-09-24  6:47               ` Emanuel Berg
2017-09-24 13:38                 ` Mario Castelán Castro
2017-09-24 14:42                   ` Óscar Fuentes
2017-09-24 14:54                     ` tomas
2017-09-26 18:57                       ` Narendra Joshi
2017-09-24 23:06                     ` Emanuel Berg
2017-09-25 21:23                       ` Mario Castelán Castro
2017-09-25 21:49                         ` Emanuel Berg
2017-09-26  1:43                           ` Mario Castelán Castro
2017-09-26  2:17                             ` Emanuel Berg
2017-09-25 21:11                     ` Mario Castelán Castro
2017-09-25 23:58                       ` Óscar Fuentes
2017-09-26 14:46                         ` Mario Castelán Castro
2017-09-26 23:31                           ` Óscar Fuentes
2017-09-29 20:21                             ` Mario Castelán Castro
2017-09-29 12:43                           ` Eli Zaretskii
2017-09-29 14:59                             ` dekkzz78
2017-09-29 16:51                               ` Óscar Fuentes
2017-09-29 17:20                                 ` Emanuel Berg
2017-09-29 18:27                                   ` Óscar Fuentes
2017-09-29 19:45                                     ` Emanuel Berg
2017-09-29 20:06                                       ` Óscar Fuentes
2017-09-29 23:24                                         ` Emanuel Berg
2017-09-29 18:03                               ` Eli Zaretskii
2017-09-24 23:07                   ` Emanuel Berg
2017-09-23 10:05           ` Charles A. Roelli
2017-09-23 12:53             ` Óscar Fuentes
2017-09-23 13:12               ` Eli Zaretskii
2017-09-23 17:18                 ` Glenn Morris
2017-09-23 17:34                   ` Eli Zaretskii
2017-09-23 20:50                     ` Yuri Khan
2017-09-24  2:53                       ` Eli Zaretskii
2017-09-24  7:13                         ` Philipp Stephani
2017-09-24 18:29                           ` Robert Thorpe
2017-09-29  8:17                             ` Eli Zaretskii
2017-09-29 20:28                             ` Stefan Monnier
2017-09-29 23:28                               ` Emanuel Berg
2017-10-03  0:52                                 ` Stefan Monnier
2017-10-03  1:04                                   ` Emanuel Berg
2017-09-29  7:11                           ` Eli Zaretskii
     [not found]                         ` <mailman.1068.1506237251.14750.help-gnu-emacs@gnu.org>
2017-09-24  7:48                           ` Emanuel Berg
2017-09-25 21:26                         ` Glenn Morris
2017-09-25 22:02                           ` Emanuel Berg
2017-09-25 22:08                           ` Ludwig, Mark
2017-09-26  5:50                             ` Emanuel Berg
2017-09-26 13:40                               ` Ludwig, Mark
2017-09-26 17:46                             ` Philipp Stephani
2017-09-26 19:00                               ` Ludwig, Mark
2017-09-29 13:23                               ` Eli Zaretskii
2017-09-29  9:48                           ` Eli Zaretskii
2017-09-26 18:44                   ` Narendra Joshi
2017-09-26 18:51                     ` Philipp Stephani
     [not found]           ` <mailman.988.1506161159.14750.help-gnu-emacs@gnu.org>
2017-09-24  6:31             ` Emanuel Berg
2017-09-22 16:40       ` ken
2017-09-22 19:07         ` Emanuel Berg
2017-09-23 20:27     ` Bob Proulx
     [not found]     ` <mailman.1053.1506198486.14750.help-gnu-emacs@gnu.org>
2017-09-24  6:38       ` Emanuel Berg
2017-09-24 17:17         ` Maxim Cournoyer
2017-09-24 22:38           ` Emanuel Berg
  -- strict thread matches above, loose matches on Subject: below --
2017-09-27 10:51 Richard Melville

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=86k20qbcu9.fsf@zoho.com \
    --to=moasen@zoho.com \
    --cc=help-gnu-emacs@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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.