public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/42734]  New: trivial use of std::thread fails with "pure virtual method called"
@ 2010-01-13 20:21 phil at nwl dot cc
  2010-01-13 20:22 ` [Bug libstdc++/42734] " phil at nwl dot cc
                   ` (28 more replies)
  0 siblings, 29 replies; 50+ messages in thread
From: phil at nwl dot cc @ 2010-01-13 20:21 UTC (permalink / raw)
  To: gcc-bugs

---------- code ----------------

#include <cstdio>
#include <thread>

using namespace std;

void f()
{
    fputs("f()\n", stderr);
}

int main()
{
    fputs("before new thread\n", stderr);
    thread t(f);
    fputs("after new thread\n", stderr);
    t.join();
    fputs("after join\n", stderr);

    return 0;
}

---------- system information ----------------

uname -a:
Linux nuty 2.6.33-rc2-zen1-zen-nuty-07221-g526ecd7 #4 ZEN PREEMPT Sun Jan 10
23:33:42 CET 2010 i686 Intel(R) Pentium(R) M processor 1.40GHz GenuineIntel
GNU/Linux

gcc --version:
gcc (GCC) 4.4.2 20091208 (prerelease)
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

---------- complier arguments ----------------

$ g++ -std=c++0x -pthread thread.cc -o thread

---------- output ----------------

before new thread
after new thread
pure virtual method called
terminate called without an active exception

---------- gdb run ----------------

(gdb) r
Starting program: /tmp/thread 
[Thread debugging using libthread_db enabled]
before new thread
[New Thread 0xb7d30b70 (LWP 5676)]
after new thread
pure virtual method called
terminate called without an active exception

Program received signal SIGABRT, Aborted.
[Switching to Thread 0xb7d30b70 (LWP 5676)]
0xb7fe1424 in __kernel_vsyscall ()
(gdb) bt
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7d5c571 in raise () from /lib/libc.so.6
#2  0xb7d5dd72 in abort () from /lib/libc.so.6
#3  0xb7f9352f in __gnu_cxx::__verbose_terminate_handler() () from
/usr/lib/libstdc++.so.6
#4  0xb7f90eb5 in __cxxabiv1::__terminate(void (*)()) () from
/usr/lib/libstdc++.so.6
#5  0xb7f90ef2 in std::terminate() () from /usr/lib/libstdc++.so.6
#6  0xb7f92155 in __cxa_pure_virtual () from /usr/lib/libstdc++.so.6
#7  0xb7f89c16 in execute_native_thread_routine () from /usr/lib/libstdc++.so.6
#8  0xb7e7f8ac in start_thread () from /lib/libpthread.so.0
#9  0xb7e0001e in clone () from /lib/libc.so.6
(gdb) info threads
* 2 Thread 0xb7d30b70 (LWP 5676)  0xb7fe1424 in __kernel_vsyscall ()
  1 Thread 0xb7d316d0 (LWP 5673)  0xb7fe1424 in __kernel_vsyscall ()
(gdb) thread 1
[Switching to thread 1 (Thread 0xb7d316d0 (LWP 5673))]#0  0xb7fe1424 in
__kernel_vsyscall ()
(gdb) bt
#0  0xb7fe1424 in __kernel_vsyscall ()
#1  0xb7e80a3d in pthread_join () from /lib/libpthread.so.0
#2  0xb7f89b22 in std::thread::join() () from /usr/lib/libstdc++.so.6
#3  0x08048b30 in main () at thread.cc:16
(gdb)


-- 
           Summary: trivial use of std::thread fails with "pure virtual
                    method called"
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: phil at nwl dot cc


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


^ permalink raw reply	[flat|nested] 50+ messages in thread
[parent not found: <bug-42734-4@http.gcc.gnu.org/bugzilla/>]

end of thread, other threads:[~2015-10-05 10:18 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-01-13 20:21 [Bug libstdc++/42734] New: trivial use of std::thread fails with "pure virtual method called" phil at nwl dot cc
2010-01-13 20:22 ` [Bug libstdc++/42734] " phil at nwl dot cc
2010-01-13 20:23 ` phil at nwl dot cc
2010-01-13 20:24 ` phil at nwl dot cc
2010-01-13 20:41 ` paolo dot carlini at oracle dot com
2010-01-13 21:33 ` redi at gcc dot gnu dot org
2010-01-13 21:37 ` redi at gcc dot gnu dot org
2010-01-13 22:34 ` phil at nwl dot cc
2010-01-13 22:37 ` phil at nwl dot cc
2010-01-13 22:40 ` paolo dot carlini at oracle dot com
2010-01-13 22:40 ` paolo dot carlini at oracle dot com
2010-01-13 22:53 ` phil at nwl dot cc
2010-01-13 23:10 ` paolo dot carlini at oracle dot com
2010-01-13 23:34 ` redi at gcc dot gnu dot org
2010-01-14  1:14 ` phil at nwl dot cc
2010-01-14  1:59 ` paolo dot carlini at oracle dot com
2010-01-14 21:36 ` paolo dot carlini at oracle dot com
2010-01-15  1:49 ` phil at nwl dot cc
2010-01-15  1:55 ` phil at nwl dot cc
2010-01-15  2:00 ` paolo dot carlini at oracle dot com
2010-01-15  2:02 ` paolo dot carlini at oracle dot com
2010-01-15  2:05 ` paolo dot carlini at oracle dot com
2010-01-15 22:07 ` phil at nwl dot cc
2010-01-15 22:15 ` paolo dot carlini at oracle dot com
2010-01-15 22:32 ` phil at nwl dot cc
2010-01-15 23:07 ` paolo dot carlini at oracle dot com
2010-01-15 23:49 ` phil at nwl dot cc
2010-01-16  0:05 ` paolo dot carlini at oracle dot com
2010-01-16  1:08 ` phil at nwl dot cc
2010-01-16 10:10 ` paolo dot carlini at oracle dot com
     [not found] <bug-42734-4@http.gcc.gnu.org/bugzilla/>
2010-10-15 18:46 ` nacitar at gmail dot com
2010-10-15 18:49 ` pinskia at gcc dot gnu.org
2010-10-15 19:28 ` redi at gcc dot gnu.org
2010-10-15 19:38 ` redi at gcc dot gnu.org
2010-10-15 19:45 ` redi at gcc dot gnu.org
2010-10-15 19:47 ` nacitar at gmail dot com
2010-10-15 20:07 ` redi at gcc dot gnu.org
2010-10-15 23:42 ` paolo.carlini at oracle dot com
2010-10-16 13:32 ` redi at gcc dot gnu.org
2010-10-16 15:54 ` redi at gcc dot gnu.org
2010-10-17  9:57 ` paolo.carlini at oracle dot com
2014-07-18  5:43 ` damien.buhl at lecbna dot org
2014-12-03 18:40 ` fenixk19 at mail dot ru
2014-12-04 12:52 ` fenixk19 at mail dot ru
2014-12-04 12:55 ` damien.buhl at lecbna dot org
2014-12-04 19:28 ` fenixk19 at mail dot ru
2014-12-05  0:26 ` damien.buhl at lecbna dot org
2014-12-08 15:54 ` damien.buhl at lecbna dot org
2014-12-08 21:05 ` fenixk19 at mail dot ru
2015-10-05 10:18 ` 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).