public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Fix qsort comparison functions
@ 2015-12-17  8:55 Yury Gribov
  2015-12-17  8:58 ` [PATCH 1/5] Fix asymmetric " Yury Gribov
                   ` (4 more replies)
  0 siblings, 5 replies; 33+ messages in thread
From: Yury Gribov @ 2015-12-17  8:55 UTC (permalink / raw)
  To: GCC Patches

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

^ permalink raw reply	[flat|nested] 33+ messages in thread

end of thread, other threads:[~2016-01-08  8:23 UTC | newest]

Thread overview: 33+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-17  8:55 [PATCH 0/5] Fix qsort comparison functions Yury Gribov
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

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