public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/7018] bug in _quicksort
       [not found] <bug-7018-131@http.sourceware.org/bugzilla/>
@ 2012-12-19 10:44 ` schwab@linux-m68k.org
  2013-09-15  0:47 ` ebiggers3 at gmail dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: schwab@linux-m68k.org @ 2012-12-19 10:44 UTC (permalink / raw)
  To: glibc-bugs

http://sourceware.org/bugzilla/show_bug.cgi?id=7018

Andreas Schwab <schwab@linux-m68k.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper.fsp at gmail dot    |unassigned at sourceware
                   |com                         |dot org

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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

* [Bug libc/7018] bug in _quicksort
       [not found] <bug-7018-131@http.sourceware.org/bugzilla/>
  2012-12-19 10:44 ` [Bug libc/7018] bug in _quicksort schwab@linux-m68k.org
@ 2013-09-15  0:47 ` ebiggers3 at gmail dot com
  2013-09-15  0:55 ` ebiggers3 at gmail dot com
  2014-07-01 21:16 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: ebiggers3 at gmail dot com @ 2013-09-15  0:47 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=7018

Eric Biggers <ebiggers3 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebiggers3 at gmail dot com

--- Comment #2 from Eric Biggers <ebiggers3 at gmail dot com> ---
I was surprised no one has looked into this, so I decided to.  My conclusion is
that this is not, in fact, a bug.

The supposedly problematic assignments to 'mid' are used to update the pointer
to the pivot in cases where it was already swapped to a new location.  Since
'mid' is not otherwise used except to access the pivot element, the real
question is whether moving the pivot can invalidate the algorithm.

Unlike in some implementations of quicksort partitioning, in the glibc
implementation the state of the array after partitioning will not necessarily
be two partitions separated by the pivot element.  Instead, the final state
will be either two consecutive nonempty partitions or two nonempty partitions
separated by one element equal to (but not necessarily the same as) the pivot. 
In both cases all elements in the first partition will be less than or equal to
the pivot and all elements in the second partition will be greater than or
equal to the pivot.  The original pivot element may end up anywhere in the
array except the first and last position, but this appears valid in this
implementation.  Furthermore, in both cases, 'left_ptr' ends up pointing to the
first element of the second partition and 'right_ptr' ends up pointing to the
last element of the first partition, so these pointers can be (and are) used to
measure the size of the partitions.  I don't know whether this is really the
"optimal" partitioning algorithm, but it seems valid.  Therefore this bug as
reported appears to be nonexistent.

Note:  No relevant changes were made to the code between the time the bug was
reported and now.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/7018] bug in _quicksort
       [not found] <bug-7018-131@http.sourceware.org/bugzilla/>
  2012-12-19 10:44 ` [Bug libc/7018] bug in _quicksort schwab@linux-m68k.org
  2013-09-15  0:47 ` ebiggers3 at gmail dot com
@ 2013-09-15  0:55 ` ebiggers3 at gmail dot com
  2014-07-01 21:16 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: ebiggers3 at gmail dot com @ 2013-09-15  0:55 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=7018

Eric Biggers <ebiggers3 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |INVALID

--- Comment #3 from Eric Biggers <ebiggers3 at gmail dot com> ---
Marking as RESOLVED - INVALID for reasons stated above.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/7018] bug in _quicksort
       [not found] <bug-7018-131@http.sourceware.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2013-09-15  0:55 ` ebiggers3 at gmail dot com
@ 2014-07-01 21:16 ` fweimer at redhat dot com
  3 siblings, 0 replies; 5+ messages in thread
From: fweimer at redhat dot com @ 2014-07-01 21:16 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=7018

Florian Weimer <fweimer at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
              Flags|                            |security-

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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

* [Bug libc/7018] bug in _quicksort
  2008-11-11  1:58 [Bug libc/7018] New: " laurent dot deniau at cern dot ch
@ 2008-11-11  2:04 ` laurent dot deniau at cern dot ch
  0 siblings, 0 replies; 5+ messages in thread
From: laurent dot deniau at cern dot ch @ 2008-11-11  2:04 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From laurent dot deniau at cern dot ch  2008-11-11 02:03 -------
*** Bug 7019 has been marked as a duplicate of this bug. ***

-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=7018

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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

end of thread, other threads:[~2014-07-01 21:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-7018-131@http.sourceware.org/bugzilla/>
2012-12-19 10:44 ` [Bug libc/7018] bug in _quicksort schwab@linux-m68k.org
2013-09-15  0:47 ` ebiggers3 at gmail dot com
2013-09-15  0:55 ` ebiggers3 at gmail dot com
2014-07-01 21:16 ` fweimer at redhat dot com
2008-11-11  1:58 [Bug libc/7018] New: " laurent dot deniau at cern dot ch
2008-11-11  2:04 ` [Bug libc/7018] " laurent dot deniau at cern dot ch

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