This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libstdc++/18640] New: sorting std::vector filled with same values causes segmentation fault
- From: "dp-gccbugzilla at bucho dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2004 00:53:43 -0000
- Subject: [Bug libstdc++/18640] New: sorting std::vector filled with same values causes segmentation fault
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
gcc version is 3.4.3 configured as:
../gcc-3.4.3/configure --prefix=/usr/local/encap/gcc-3.4.3
--program-suffix=-3.4.3 --enable-languages=f77,c++
The attached program simply fills a std::vector<int> with some number of items
of the same value.
If the vector has 16 or less elements, everything is fine. But if the vector has
17 or more, it will seg fault.
The program takes one argument, the number of elements:
./a.out 16 # works fine
./a.out 17 # core dumps
Three additional comments:
- If the values are NOT the same, there seems to be no problem.
- If the std::not2() adapter is removed, there seems to be no problem.
- valgrind complains of invalid reads within std::less<int>::operator()
--
Summary: sorting std::vector filled with same values causes
segmentation fault
Product: gcc
Version: 3.4.3
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: libstdc++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: dp-gccbugzilla at bucho dot org
CC: gcc-bugs at gcc dot gnu dot org
GCC host triplet: i686-pc-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=18640