STL std::nth_element bug (fixed upstream)
Bug #1246802 reported by
Garth Wells
This bug affects 10 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
FEniCS Project |
New
|
Undecided
|
Unassigned | ||
gcc |
Fix Released
|
High
|
|||
gcc-4.8 (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
Saucy |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
The package llibstdc++-4.8 (4.8.1-10ubuntu8) has a nasty STL std::nth_element bug that has been fixed upstream, see http://
Related branches
tags: | added: saucy |
Changed in gcc: | |
importance: | Unknown → High |
status: | Unknown → Fix Released |
To post a comment you must log in.
This program segfaults on gcc 4.8.1 from Ubuntu 13.10. I'm building a copy of the 4.8 branch to see if I can reproduce it there.
This is on x86_64. I used a gross hack to specify the input so I don't have to think about precision issues. The numbers are all well-behaved values near 0.9.
I'll attach preprocessed source. The preprocessed source crashes even if built with gcc 4.7.something.
#include <algorithm>
#include <stdint.h>
//#include <iostream>
double to_double(uint64_t x)
{
union {double d; uint64_t x;} u;
u.x = x;
return u.d;
}
int main()
std::vector< double> v = {
to_double( 460667207089024 3784),
to_double( 460667202585424 7510),
to_double( 460667180067426 6141),
to_double( 460667157549428 4772),
to_double( 460667211592624 0057),
to_double( 460667216096223 6330),
to_double( 460667207089024 3784),
{
};
// for (auto i : v)
// std::cout << i << std::endl;
return 0;
}