public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "glisse at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/58800] [4.8.2/4.9 Regression] std::nth_element segfaults on valid input
Date: Sat, 19 Oct 2013 07:36:00 -0000	[thread overview]
Message-ID: <bug-58800-4-fi0KSS5CBB@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-58800-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58800

--- Comment #10 from Marc Glisse <glisse at gcc dot gnu.org> ---
{0, 1, 2, 0} should be enough.

__unguarded_partition only stops increasing __first when *__first is not
smaller than the pivot. If all elements are smaller than the pivot, boom. And
when we have fewer than 5 elements (the check in __introselect is only for >
3), the pivot selection code doesn't guarantee that (some of the 3 pointers
used to compute the median are the same, and with Paolo's change they become
distinct).


  parent reply	other threads:[~2013-10-19  7:36 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-18 22:21 [Bug libstdc++/58800] New: [4.8 regression, I think] " luto at mit dot edu
2013-10-18 22:22 ` [Bug libstdc++/58800] " luto at mit dot edu
2013-10-18 22:48 ` paolo.carlini at oracle dot com
2013-10-18 23:05 ` paolo.carlini at oracle dot com
2013-10-18 23:17 ` paolo.carlini at oracle dot com
2013-10-18 23:53 ` paolo.carlini at oracle dot com
2013-10-19  0:13 ` [Bug libstdc++/58800] [4.8.2/4.9 Regression] " luto at mit dot edu
2013-10-19  0:20 ` luto at mit dot edu
2013-10-19  0:22 ` paolo.carlini at oracle dot com
2013-10-19  0:35 ` luto at mit dot edu
2013-10-19  7:36 ` glisse at gcc dot gnu.org [this message]
2013-10-19  7:48 ` paolo.carlini at oracle dot com
2013-10-19  7:55 ` [Bug libstdc++/58800] [4.7.4/4.8.2/4.9 " chris at bubblescope dot net
2013-10-19  8:05 ` paolo.carlini at oracle dot com
2013-10-19  8:15 ` glisse at gcc dot gnu.org
2013-10-19  8:49 ` chris at bubblescope dot net
2013-10-19  8:54 ` chris at bubblescope dot net
2013-10-19 10:02 ` paolo.carlini at oracle dot com
2013-10-19 11:06 ` chris at bubblescope dot net
2013-10-19 12:11 ` chris at bubblescope dot net
2013-10-19 17:47 ` paolo.carlini at oracle dot com
2013-10-19 18:07 ` paolo.carlini at oracle dot com
2013-10-20  9:07 ` paolo at gcc dot gnu.org
2013-10-20  9:08 ` paolo at gcc dot gnu.org
2013-10-20  9:08 ` paolo at gcc dot gnu.org
2013-10-20  9:09 ` paolo.carlini at oracle dot com
2013-10-21  8:39 ` rguenth at gcc dot gnu.org
2013-11-13 15:59 ` [Bug libstdc++/58800] [4.7/4.8/4.9 " glisse at gcc dot gnu.org
2013-12-19 16:12 ` rguenth at gcc dot gnu.org

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=bug-58800-4-fi0KSS5CBB@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).