std::thread segfault

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm using my 4.4.0 SVN checked out a few days ago, and I tried to use C++0x's std::thread, but it kept segfaulting on me.

This is on 64-bit Linux, x86-64 (Ubuntu 8.10).

-------------------------------------------------
#include <thread>

void t() {
}

int main() {
   std::thread t1(&t);

   t1.join();
}
-------------------------------------------------

-------------------------------------------------
cyberfish@cyberfish-desktop:/tmp$ g++-4.4 -v
Using built-in specs.
Target: x86_64-linux-gnu
Configured with: ../configure --enable-languages=c,c++ --prefix=/opt/gcc --with-system-zlib --without-included-gettext --disable-nls --enable-libstdcxx-debug --enable-checking=release --build=x86_64-linux-gnu
Thread model: posix
gcc version 4.4.0 20090407 (prerelease) (GCC)
cyberfish@cyberfish-desktop:/tmp$ g++-4.4 -g -std=gnu++0x a.cpp
cyberfish@cyberfish-desktop:/tmp$ gdb a.out
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu"...
(gdb) r
Starting program: /tmp/a.out

Program received signal SIGSEGV, Segmentation fault.
0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1 0x00007fab24c6ffa7 in std::thread::_M_start_thread (this=0x7fff2d0db420, __b=DWARF-2 expression error: DW_OP_reg operations must be used either alone or in conjuction with DW_OP_piece.
)
at /home/cyberfish/gcc_svn/gcc/build/x86_64-linux-gnu/libstdc++-v3/include/x86_64-linux-gnu/bits/gthr-default.h:682
#2  0x0000000000400dce in thread<void (*)()> (this=0x7fff2d0db420,
   __f=0x400bbc <t()>)
at /opt/gcc/lib/gcc/x86_64-linux-gnu/4.4.0/../../../../include/c++/4.4.0/thread:134
#3  0x0000000000400bde in main () at a.cpp:7
(gdb) l
1    #include <thread>
2 3 void t() {
4    }
5 6 int main() {
7        std::thread t1(&t);
8 9 t1.join();
10    }
(gdb)
-------------------------------------------------

Thanks
Matthew Lai

[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux