public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/34236]  New: nth_element failure: infinite loop or segmentation fault
@ 2007-11-26 13:47 florent dot balestrieri at ofidea dot fr
  2007-11-26 13:53 ` [Bug libstdc++/34236] " pcarlini at suse dot de
  0 siblings, 1 reply; 2+ messages in thread
From: florent dot balestrieri at ofidea dot fr @ 2007-11-26 13:47 UTC (permalink / raw)
  To: gcc-bugs

When given certain input and certain comparator, nth_element
enters in a loop or crash the program. The problem didn't
appear when using less<double>. With the comparator:

   not2<less<double> >

it failed with an array of {1,1,1,1,2,3,4}
worked with an array of {1,1,1,1,2,3,4,5}
failed again with {1,1,1,1,2,2,2,3}

Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)

command line: g++ bug_nth_element.cpp && a.out

content of bug_nth_element follows:
<<EOF
#include <vector>
#include <iterator>
#include <iostream>
int main() {
   using namespace std;
   vector<double> a;
//   fill_n (back_inserter(a), 4, 1.0); // infinite loop
   fill_n (back_inserter(a), 4, 0.0); // segmentation fault
   nth_element (a.begin(), a.begin(), a.end(), not2(less<double>()));
   copy (a.begin(), a.end(), ostream_iterator<double>(cout, "\n"));
}
EOF


-- 
           Summary: nth_element failure: infinite loop or segmentation fault
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: florent dot balestrieri at ofidea dot fr


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


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

* [Bug libstdc++/34236] nth_element failure: infinite loop or segmentation fault
  2007-11-26 13:47 [Bug libstdc++/34236] New: nth_element failure: infinite loop or segmentation fault florent dot balestrieri at ofidea dot fr
@ 2007-11-26 13:53 ` pcarlini at suse dot de
  0 siblings, 0 replies; 2+ messages in thread
From: pcarlini at suse dot de @ 2007-11-26 13:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pcarlini at suse dot de  2007-11-26 13:53 -------


*** This bug has been marked as a duplicate of 18640 ***


-- 

pcarlini at suse dot de changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2007-11-26 13:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-26 13:47 [Bug libstdc++/34236] New: nth_element failure: infinite loop or segmentation fault florent dot balestrieri at ofidea dot fr
2007-11-26 13:53 ` [Bug libstdc++/34236] " pcarlini at suse dot de

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