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

--- Comment #3 from DBarto at visionpro dot com ---
/opt/local/bin/g++-mp-4.7 -std=c++11 -Wall -Wextra  -pthread -g use_once.cpp -o
use_once
./use_once
571_ ./use_once
Segmentation fault: 11

gdb use_once
(gdb) r
Starting program: /Users/barto/mvp/trunk/unit_test/use_once 
Reading symbols for shared libraries +++.............................. done

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: 13 at address: 0x0000000000000000
[Switching to process 22829 thread 0x1203]
0x0000000100074b20 in __once_proxy ()
(gdb) where
#0  0x0000000100074b20 in __once_proxy ()
#1  0x00007fff8f7e0ff0 in pthread_once ()
#2  0x0000000100001165 in __gthread_once (__once=0x1000055e0,
__func=0x100074b10 <__once_proxy>) at gthr-default.h:718
#3  0x000000010000142d in call_once<do_once()::<lambda()> >
(__once=@0x1000055e0, __f=@0x100293e6f) at mutex:822
#4  0x0000000100001247 in do_once () at use_once.cpp:47
#5  0x0000000100002a29 in
_ZNSt12_Bind_simpleIFPFvvEvEE9_M_invokeIIEEEvSt12_Index_tupleIIXspT_EEE
(this=0x100303aa0) at functional:1598
#6  0x0000000100002979 in std::_Bind_simple<void (*()())()>::operator()
(this=0x100303aa0) at functional:1586
#7  0x0000000100002912 in std::thread::_Impl<std::_Bind_simple<void (*()())()>
>::_M_run (this=0x100303a88) at thread:115
#8  0x00000001000754b0 in execute_native_thread_routine ()
#9  0x00007fff8f7cc1e1 in thread_start ()

On Aug 8, 2013, at 9:10 AM, redi at gcc dot gnu.org <gcc-bugzi...@gcc.gnu.org>
 wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=58104
> 
> --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> ---
> Works for me.
> 
> Are you using the -pthread flag?
> 
> You haven't actually said what fails, what fails to execute?
> 
> -- 
> You are receiving this mail because:
> You reported the bug.

Reply via email to