From: Dmitry Antipov <dmantipov@yandex.ru>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: 18361@debbugs.gnu.org
Subject: bug#18361: New 'sort' implementation can crash Emacs
Date: Sat, 30 Aug 2014 02:47:01 +0400 [thread overview]
Message-ID: <540102E5.6040404@yandex.ru> (raw)
In-Reply-To: <5400EFA5.6090902@cs.ucla.edu>
On 08/30/2014 01:24 AM, Paul Eggert wrote:
> The new implementation of 'sort' in the trunk invokes qsort (or qsort_r),
> but these functions have undefined behavior if the comparison function is
> ill-behaved. Since the comparison predicate is user-defined, this means
> a bad user-supplied comparison function could crash Emacs.
I don't see how is that possible if we operate on a correctly initialized
vector and sort_vector_predicate is a valid function accepting 2 arguments.
Can you provide an example? Is that just a poor property of the particular
qsort(_r) implementation?
Dmitry
next prev parent reply other threads:[~2014-08-29 22:47 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 [this message]
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
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=540102E5.6040404@yandex.ru \
--to=dmantipov@yandex.ru \
--cc=18361@debbugs.gnu.org \
--cc=eggert@cs.ucla.edu \
/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.