http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56835
Bug #: 56835
Summary: std::promise seems broken on 10.8 lion
Classification: Unclassified
Product: gcc
Version: 4.8.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: [email protected]
ReportedBy: [email protected]
Hi all, the following code crashes on 10.8 lion.
#include <future>
#include <iostream>
int main() {
std::cout << "doing the test" << std::endl;
std::promise<bool> mypromise;
std::future<bool> myfuture = mypromise.get_future();
mypromise.set_value(true);
bool result = myfuture.get();
std::cout << "success, result is " << result << std::endl;
return 0;
}
with this output:
$ g++-mp-4.8 -std=c++11 test.cpp
$ ./a.out
doing the test
Segmentation fault: 11
$
more info:
gcc version 4.8.0 20130310 (experimental) (MacPorts gcc48 4.8-20130310_0)
I'm on a Mac OS 10.8 (mountain lion)
compiled with: g++-mp-4.8 -std=c++11 test.cpp
(though I've tried with -lpthread and -pthread and they also crashed)
No compiler output, compiled just fine.
(see
http://stackoverflow.com/questions/15778085/is-stdpromise-broken-on-my-machine-using-g-mp?noredirect=1#comment22437010_15778085
for some runs on other machines)