public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/36333]  New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
@ 2008-05-26 12:57 dominik dot strasser at onespin-solutions dot com
  2008-05-26 12:58 ` [Bug libstdc++/36333] " dominik dot strasser at onespin-solutions dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2008-05-26 12:57 UTC (permalink / raw)
  To: gcc-bugs

I have an application calling stable_sort with a comparison operator.

stable_sort internally calls
__stable_sort_adaptive
__merge_sort_with_buffer
__merge_sort_loop
_GLIBCXX_STD_P::merge
The last function (if called directly) requires the parameters to be sorted.
It seems to me that this is not necessarily the case here.


-- 
           Summary: stable_sort calling merge; problems when _GLIBCXX_DEBUG
                    is switched on
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: dominik dot strasser at onespin-solutions dot com


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
@ 2008-05-26 12:58 ` dominik dot strasser at onespin-solutions dot com
  2008-05-26 15:10 ` paolo dot carlini at oracle dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2008-05-26 12:58 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from dominik dot strasser at onespin-solutions dot com  2008-05-26 12:57 -------
Created an attachment (id=15685)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=15685&action=view)
Source code illustrating the problem


-- 


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
  2008-05-26 12:58 ` [Bug libstdc++/36333] " dominik dot strasser at onespin-solutions dot com
@ 2008-05-26 15:10 ` paolo dot carlini at oracle dot com
  2008-05-26 15:51 ` chris at bubblescope dot net
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-05-26 15:10 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo dot carlini at oracle dot com  2008-05-26 15:10 -------
Will investigate ASAP, note this is not a regression, already fails at least
with 4.1.3...


-- 


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
  2008-05-26 12:58 ` [Bug libstdc++/36333] " dominik dot strasser at onespin-solutions dot com
  2008-05-26 15:10 ` paolo dot carlini at oracle dot com
@ 2008-05-26 15:51 ` chris at bubblescope dot net
  2008-05-26 20:42 ` paolo dot carlini at oracle dot com
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: chris at bubblescope dot net @ 2008-05-26 15:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from chris at bubblescope dot net  2008-05-26 15:51 -------
Out of interest, how did you come across this comparison operator?

You comparison operator fails to be an ordering, in particular it is required
that:

comp(a,b) && comp(b,c) implies comp(a,c)

comp(0x8ac6a30, 0x8ac69e4) and comp(0x8ac69e4, 0x8ac6ac8) are both true, but
comp(0x8ac6a30, 0x8ac6ac8) is false.


-- 

chris at bubblescope dot net changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |chris at bubblescope dot net


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
                   ` (2 preceding siblings ...)
  2008-05-26 15:51 ` chris at bubblescope dot net
@ 2008-05-26 20:42 ` paolo dot carlini at oracle dot com
  2008-06-06  7:08 ` dominik dot strasser at onespin-solutions dot com
  2009-05-20 14:59 ` dominik dot strasser at onespin-solutions dot com
  5 siblings, 0 replies; 7+ messages in thread
From: paolo dot carlini at oracle dot com @ 2008-05-26 20:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from paolo dot carlini at oracle dot com  2008-05-26 20:42 -------
It's *extremely* unlikely that stable_sort, unchanged for many years, is
misusing merge. Therefore, before any further investigation, please provide a
testcase involving a well-formed comparison operator.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
                   ` (3 preceding siblings ...)
  2008-05-26 20:42 ` paolo dot carlini at oracle dot com
@ 2008-06-06  7:08 ` dominik dot strasser at onespin-solutions dot com
  2009-05-20 14:59 ` dominik dot strasser at onespin-solutions dot com
  5 siblings, 0 replies; 7+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2008-06-06  7:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from dominik dot strasser at onespin-solutions dot com  2008-06-06 07:07 -------
Bug was on my side, the comparison operator didn't form a total order.
Sorry for the noise.


-- 

dominik dot strasser at onespin-solutions dot com changed:

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


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


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

* [Bug libstdc++/36333] stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on
  2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
                   ` (4 preceding siblings ...)
  2008-06-06  7:08 ` dominik dot strasser at onespin-solutions dot com
@ 2009-05-20 14:59 ` dominik dot strasser at onespin-solutions dot com
  5 siblings, 0 replies; 7+ messages in thread
From: dominik dot strasser at onespin-solutions dot com @ 2009-05-20 14:59 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from dominik dot strasser at onespin-solutions dot com  2009-05-20 14:59 -------
Works fine


-- 

dominik dot strasser at onespin-solutions dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |VERIFIED


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


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

end of thread, other threads:[~2009-05-20 14:59 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-26 12:57 [Bug libstdc++/36333] New: stable_sort calling merge; problems when _GLIBCXX_DEBUG is switched on dominik dot strasser at onespin-solutions dot com
2008-05-26 12:58 ` [Bug libstdc++/36333] " dominik dot strasser at onespin-solutions dot com
2008-05-26 15:10 ` paolo dot carlini at oracle dot com
2008-05-26 15:51 ` chris at bubblescope dot net
2008-05-26 20:42 ` paolo dot carlini at oracle dot com
2008-06-06  7:08 ` dominik dot strasser at onespin-solutions dot com
2009-05-20 14:59 ` dominik dot strasser at onespin-solutions dot com

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