From: Yury Gribov <y.gribov@samsung.com>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: [PATCH 0/5] Fix qsort comparison functions
Date: Thu, 17 Dec 2015 08:55:00 -0000 [thread overview]
Message-ID: <5672787D.6040105@samsung.com> (raw)
Hi all,
This patchset fixes bugs in comparison functions used in qsort(3).
Standard requires comparison functions to satisfy certain
symmetry/transitivity axioms ("total ordering" in
http://pubs.opengroup.org/onlinepubs/009695399/functions/qsort.html).
Violation triggers undefined behavior which can e.g. cause qsort to
produce invalid results (or even crash - check
https://bugzilla.samba.org/show_bug.cgi?id=3959).
Most of the patches are pretty obvious except for no. 3 for which I was
failed to devise a behavior-preserving fix. I've Cc-ed the original
authors in hope they'll be able to help.
I've verified all patches on x86_64-pc-linux-gnu (bootstrap + regression
test).
NB: Bugs were found with SortChecker tool
(https://github.com/yugr/sortcheck).
/Yury
next reply other threads:[~2015-12-17 8:55 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-12-17 8:55 Yury Gribov [this message]
2015-12-17 8:58 ` [PATCH 1/5] Fix asymmetric " Yury Gribov
2015-12-17 11:39 ` Jakub Jelinek
2015-12-17 12:04 ` Yury Gribov
2015-12-18 19:40 ` Yury Gribov
2015-12-18 20:07 ` Jakub Jelinek
2015-12-18 20:09 ` Yury Gribov
2015-12-17 11:41 ` Richard Biener
2015-12-17 11:47 ` Yury Gribov
2015-12-17 11:57 ` Jakub Jelinek
2015-12-17 11:59 ` Richard Biener
2015-12-17 12:14 ` Yury Gribov
2015-12-17 12:25 ` Richard Biener
2015-12-17 12:36 ` Yury Gribov
2015-12-17 11:59 ` Andrey Belevantsev
2015-12-17 12:12 ` Yury Gribov
2015-12-17 12:48 ` Andrey Belevantsev
2015-12-17 19:39 ` Andrew Pinski
2015-12-17 22:00 ` Jason Merrill
2015-12-17 8:59 ` [PATCH 2/5] Fix more " Yury Gribov
2015-12-17 9:00 ` [PATCH 3/5] "Fix" intransitive comparison in reload_pseudo_compare_func Yury Gribov
2015-12-17 19:36 ` Vladimir Makarov
2015-12-18 19:50 ` Yury Gribov
2015-12-17 9:02 ` [PATCH 4/5] Fix intransitive comparison in compare_access_positions Yury Gribov
2015-12-17 14:58 ` Martin Jambor
2015-12-17 9:03 ` [PATCH 5/5] Fix intransitive comparison in dr_group_sort_cmp Yury Gribov
2015-12-17 11:57 ` Richard Biener
2015-12-17 12:33 ` Yury Gribov
2015-12-17 12:51 ` Richard Biener
2015-12-18 20:19 ` Yury Gribov
2015-12-18 22:30 ` Yuri Gribov
2015-12-25 11:42 ` Yury Gribov
2016-01-08 8:23 ` Richard Biener
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=5672787D.6040105@samsung.com \
--to=y.gribov@samsung.com \
--cc=gcc-patches@gcc.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.
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).