当前位置: 技术问答>linux和unix
请问这个gdb提示的错误是什么原因?(pure virtual method called)
来源: 互联网 发布时间:2015-08-28
本文导语: pure virtual method called Program received signal SIGABRT, Aborted. [Switching to Thread 65541 (LWP 5042)] 0x407e05c1 in kill () from /lib/libc.so.6 (gdb) up #1 0x4069258d in pthread_kill () from /lib/libpthread.so.0 (gdb) up #2 0x4069290b in raise () f...
pure virtual method called
Program received signal SIGABRT, Aborted.
[Switching to Thread 65541 (LWP 5042)]
0x407e05c1 in kill () from /lib/libc.so.6
(gdb) up
#1 0x4069258d in pthread_kill () from /lib/libpthread.so.0
(gdb) up
#2 0x4069290b in raise () from /lib/libpthread.so.0
(gdb) up
#3 0x407e0364 in raise () from /lib/libc.so.6
(gdb) up
#4 0x407e189b in abort () from /lib/libc.so.6
(gdb) up
#5 0x08077a97 in __cxxabiv1::__terminate(void (*)()) ()
(gdb) up
#6 0x08077ae4 in std::terminate() ()
(gdb) up
#7 0x08076e77 in __cxa_pure_virtual ()
(gdb) up
#8 0x0805dd4e in Player::_start_routine(void*) (arg=0x80f3f98) at mediaplayer/player.cpp:250
player.cpp:250内容如下:
pPlayer->m_pDecoder->play();
这个Decoder::play()是一个pure virtual function,在这里pPlayer->m_pDecoder是一个MP3Decoder,继承于Decoder
注明:程序在播放一首歌曲的时候实际上是一个独立的线程,在切换歌曲的时候一般运行正常,但是如果切换速度非常快,切了几首就会出现gdb上面的提示。可能是什么原因?
Program received signal SIGABRT, Aborted.
[Switching to Thread 65541 (LWP 5042)]
0x407e05c1 in kill () from /lib/libc.so.6
(gdb) up
#1 0x4069258d in pthread_kill () from /lib/libpthread.so.0
(gdb) up
#2 0x4069290b in raise () from /lib/libpthread.so.0
(gdb) up
#3 0x407e0364 in raise () from /lib/libc.so.6
(gdb) up
#4 0x407e189b in abort () from /lib/libc.so.6
(gdb) up
#5 0x08077a97 in __cxxabiv1::__terminate(void (*)()) ()
(gdb) up
#6 0x08077ae4 in std::terminate() ()
(gdb) up
#7 0x08076e77 in __cxa_pure_virtual ()
(gdb) up
#8 0x0805dd4e in Player::_start_routine(void*) (arg=0x80f3f98) at mediaplayer/player.cpp:250
player.cpp:250内容如下:
pPlayer->m_pDecoder->play();
这个Decoder::play()是一个pure virtual function,在这里pPlayer->m_pDecoder是一个MP3Decoder,继承于Decoder
注明:程序在播放一首歌曲的时候实际上是一个独立的线程,在切换歌曲的时候一般运行正常,但是如果切换速度非常快,切了几首就会出现gdb上面的提示。可能是什么原因?
|
纯虚函数有实现吗?
我最近也碰到这个问题,一起探讨下吧:)
不过我感觉问题应该不在这个地方
我最近也碰到这个问题,一起探讨下吧:)
不过我感觉问题应该不在这个地方
|
线程切换的源码?
|
把你的程序简化一下,贴上来。