unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Dmitry Antipov <dmantipov@yandex.ru>
Cc: 18361@debbugs.gnu.org
Subject: bug#18361: New 'sort' implementation can crash Emacs
Date: Sat, 30 Aug 2014 06:44:54 -0700	[thread overview]
Message-ID: <5401D556.4060102@cs.ucla.edu> (raw)
In-Reply-To: <54017555.8010903@yandex.ru>

Dmitry Antipov wrote:

> couldn't we detect an improper comparison
> function at runtime?

Not easily, because it doesn't suffice to check whether the function is 
antisymmetrical at each comparison (a local property).  One must check 
whether the function defines a total order (a global property).  One way 
to do such a check is to sort the array, and then compare all pairs to 
verify that the function is indeed a total order.  But of course that 
begs the question of sorting the array, plus it's an O(N**2) check, so 
it's not practical.





  reply	other threads:[~2014-08-30 13:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-29 21:24 bug#18361: New 'sort' implementation can crash Emacs Paul Eggert
2014-08-29 22:47 ` Dmitry Antipov
2014-08-29 23:07   ` Paul Eggert
2014-08-30  5:07     ` Dmitry Antipov
2014-08-30  5:22       ` Paul Eggert
2014-08-30  6:55         ` Dmitry Antipov
2014-08-30 13:44           ` Paul Eggert [this message]
2014-08-30 23:05             ` Paul Eggert
2014-08-31  2:50               ` Eli Zaretskii
2014-08-31  4:46                 ` Paul Eggert
2014-08-31 15:20                   ` Eli Zaretskii

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5401D556.4060102@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=18361@debbugs.gnu.org \
    --cc=dmantipov@yandex.ru \
    /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 public inbox

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

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).