public inbox for glibc-bugs@sourceware.org help / color / mirror / Atom feed
From: "andersk at ksplice dot com" <sourceware-bugzilla@sourceware.org> To: glibc-bugs@sources.redhat.com Subject: [Bug libc/10672] qsort may not be a stable sort under memory exhaustion Date: Sun, 20 Sep 2009 16:57:00 -0000 [thread overview] Message-ID: <20090920165712.962.qmail@sourceware.org> (raw) In-Reply-To: <20090920165230.10672.andersk@ksplice.com> [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1: Type: text/plain, Size: 758 bytes --] ------- Additional Comments From andersk at ksplice dot com 2009-09-20 16:57 ------- Created an attachment (id=4219) --> (http://sourceware.org/bugzilla/attachment.cgi?id=4219&action=view) Test program This program exhausts all the available heap memory using malloc(), then attempts to do a stable sort using qsort() as described by the glibc manual. As you can see from the output, some items with equal values have been reordered: 0 0 0 0 10 4 10 2 10 3 20 1 If you comment the malloc() exhaustion loop, the sort becomes stable: 0 0 0 0 10 2 10 3 10 4 20 1 -- http://sourceware.org/bugzilla/show_bug.cgi?id=10672 ------- You are receiving this mail because: ------- You are on the CC list for the bug, or are watching someone who is.
prev parent reply other threads:[~2009-09-20 16:57 UTC|newest] Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top 2009-09-20 16:52 [Bug libc/10672] New: " andersk at ksplice dot com 2009-09-20 16:57 ` andersk at ksplice dot com [this message]
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=20090920165712.962.qmail@sourceware.org \ --to=sourceware-bugzilla@sourceware.org \ --cc=glibc-bugs@sources.redhat.com \ /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: linkBe 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).