public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/56835] New: std::promise seems broken on 10.8 lion
@ 2013-04-03 18:05 verdagon at gmail dot com
  2013-04-03 18:06 ` [Bug c++/56835] " verdagon at gmail dot com
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: verdagon at gmail dot com @ 2013-04-03 18:05 UTC (permalink / raw)
  To: gcc-bugs


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: unassigned@gcc.gnu.org
        ReportedBy: verdagon@gmail.com


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)


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
@ 2013-04-03 18:06 ` verdagon at gmail dot com
  2013-04-04  8:39 ` redi at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: verdagon at gmail dot com @ 2013-04-03 18:06 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #1 from verdagon at gmail dot com 2013-04-03 18:06:09 UTC ---
*** Bug 56822 has been marked as a duplicate of this bug. ***


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
  2013-04-03 18:06 ` [Bug c++/56835] " verdagon at gmail dot com
@ 2013-04-04  8:39 ` redi at gcc dot gnu.org
  2013-04-09 20:33 ` howarth at nitro dot med.uc.edu
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-04  8:39 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2013-04-04
     Ever Confirmed|0                           |1

--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> 2013-04-04 08:39:23 UTC ---
You were asked to find where it crashes:
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=56822#c1

You were asked to read http://gcc.gnu.org/bugs and provide the requested
information, which is still missing e.g. the output of 'gcc -v'


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
  2013-04-03 18:06 ` [Bug c++/56835] " verdagon at gmail dot com
  2013-04-04  8:39 ` redi at gcc dot gnu.org
@ 2013-04-09 20:33 ` howarth at nitro dot med.uc.edu
  2013-04-09 22:55 ` howarth at nitro dot med.uc.edu
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2013-04-09 20:33 UTC (permalink / raw)
  To: gcc-bugs


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

Jack Howarth <howarth at nitro dot med.uc.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |howarth at nitro dot
                   |                            |med.uc.edu

--- Comment #3 from Jack Howarth <howarth at nitro dot med.uc.edu> 2013-04-09 20:33:39 UTC ---
I can't reproduce this crash with the fink build of gcc 4.8.0 on
x86_64-apple-darwin12. Notice that MacPorts is building the their gcc48 package
with additional change of...

https://trac.macports.org/browser/trunk/dports/lang/gcc48/files/libstdc%2B%2B-configure-timespec.patch

to get the _GLIBCXX_USE_CLOCK_MONOTONIC defined in config.h. This is claimed to
be in order to get  libstdc++ to use nanosleep. However, a different fix was
checked in...

r192335 | redi | 2012-10-10 19:12:10 -0400 (Wed, 10 Oct 2012) | 6 lines

2012-10-10  Jack Howarth  <howarth@bromo.med.uc.edu>
            Jonathan Wakely  <jwakely.gcc@gmail.com>

        * config/os/bsd/darwin/os_defines.h: Define _GLIBCXX_USE_NANOSLEEP
        and _GLIBCXX_USE_SCHED_YIELD.
        * acinclude.m4 (GLIBCXX_ENABLE_LIBSTDCXX_TIME): Add comment.

which results in nanosleep being used on darwin by default...

% cd
/sw/src/fink.build/gcc48-4.8.0-1000/darwin_objdir/x86_64-apple-darwin12.3.0/libstdc++-v3/src/c++11
% nm thread.o | grep nanosleep
                 U _nanosleep


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
                   ` (2 preceding siblings ...)
  2013-04-09 20:33 ` howarth at nitro dot med.uc.edu
@ 2013-04-09 22:55 ` howarth at nitro dot med.uc.edu
  2013-04-09 22:57 ` howarth at nitro dot med.uc.edu
  2013-04-11 12:44 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2013-04-09 22:55 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #4 from Jack Howarth <howarth at nitro dot med.uc.edu> 2013-04-09 22:55:27 UTC ---
IMHO, this should be closed as invalid since MacPorts is applying unnecessary
and invalid patches to gcc 4.8.0.


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
                   ` (3 preceding siblings ...)
  2013-04-09 22:55 ` howarth at nitro dot med.uc.edu
@ 2013-04-09 22:57 ` howarth at nitro dot med.uc.edu
  2013-04-11 12:44 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: howarth at nitro dot med.uc.edu @ 2013-04-09 22:57 UTC (permalink / raw)
  To: gcc-bugs


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

--- Comment #5 from Jack Howarth <howarth at nitro dot med.uc.edu> 2013-04-09 22:57:00 UTC ---
This has been filed with MacPorts as https://trac.macports.org/ticket/38732


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

* [Bug c++/56835] std::promise seems broken on 10.8 lion
  2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
                   ` (4 preceding siblings ...)
  2013-04-09 22:57 ` howarth at nitro dot med.uc.edu
@ 2013-04-11 12:44 ` redi at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: redi at gcc dot gnu.org @ 2013-04-11 12:44 UTC (permalink / raw)
  To: gcc-bugs


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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

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


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

end of thread, other threads:[~2013-04-11 12:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-04-03 18:05 [Bug c++/56835] New: std::promise seems broken on 10.8 lion verdagon at gmail dot com
2013-04-03 18:06 ` [Bug c++/56835] " verdagon at gmail dot com
2013-04-04  8:39 ` redi at gcc dot gnu.org
2013-04-09 20:33 ` howarth at nitro dot med.uc.edu
2013-04-09 22:55 ` howarth at nitro dot med.uc.edu
2013-04-09 22:57 ` howarth at nitro dot med.uc.edu
2013-04-11 12:44 ` redi at gcc dot gnu.org

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