当前位置: 技术问答>linux和unix
linux 段错误,我快疯了,搞了两天了
来源: 互联网 发布时间:2016-05-06
本文导语: Core was generated by `./test'. Program terminated with signal 11, Segmentation fault. Reading symbols from /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so...done. Loaded symbols for /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so Reading symbols from /opt/SinoVoice/jTT...
Core was generated by `./test'.
Program terminated with signal 11, Segmentation fault.
Reading symbols from /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so...done.
Loaded symbols for /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so
Reading symbols from /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_Audio.so...done.
Loaded symbols for /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_Audio.so
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 0x00c89f68 in ?? ()
(gdb) bt
#0 0x00c89f68 in ?? ()
#1 0x001f3597 in exit () from /lib/tls/libc.so.6
#2 0x001ddded in __libc_start_main () from /lib/tls/libc.so.6
#3 0x08048a05 in _start ()
(gdb)
程序大概是这样的
test调用a.so,然后a.so中调用b.so。
程序出现段错误以后,就是上面的内容。谁知道这什么问题啊。我快疯了。!!!!!!!
Program terminated with signal 11, Segmentation fault.
Reading symbols from /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so...done.
Loaded symbols for /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_ML.so
Reading symbols from /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_Audio.so...done.
Loaded symbols for /opt/SinoVoice/jTTS-5.0.1.0/bin/libjTTS_Audio.so
Reading symbols from /lib/libdl.so.2...done.
Loaded symbols for /lib/libdl.so.2
Reading symbols from /lib/tls/libpthread.so.0...done.
Loaded symbols for /lib/tls/libpthread.so.0
Reading symbols from /usr/lib/libstdc++.so.6...done.
Loaded symbols for /usr/lib/libstdc++.so.6
Reading symbols from /lib/tls/libm.so.6...done.
Loaded symbols for /lib/tls/libm.so.6
Reading symbols from /lib/tls/libc.so.6...done.
Loaded symbols for /lib/tls/libc.so.6
Reading symbols from /lib/libgcc_s.so.1...done.
Loaded symbols for /lib/libgcc_s.so.1
Reading symbols from /lib/ld-linux.so.2...done.
Loaded symbols for /lib/ld-linux.so.2
#0 0x00c89f68 in ?? ()
(gdb) bt
#0 0x00c89f68 in ?? ()
#1 0x001f3597 in exit () from /lib/tls/libc.so.6
#2 0x001ddded in __libc_start_main () from /lib/tls/libc.so.6
#3 0x08048a05 in _start ()
(gdb)
程序大概是这样的
test调用a.so,然后a.so中调用b.so。
程序出现段错误以后,就是上面的内容。谁知道这什么问题啊。我快疯了。!!!!!!!
|
如果有.so的代码,建议:
1.将.so静态链接到主程序。
2.直接测试.so的代码。
3.使用purify等测试工具,查看内存错误。
1.将.so静态链接到主程序。
2.直接测试.so的代码。
3.使用purify等测试工具,查看内存错误。
|
试试先把.so都编译成.o然后静态链接有没有问题?静态链接调试方便些吧
|
?? () 栈出错了...最好能贴代码.
|
贴下代码看看.
|
试着把那些变量定义放到函数的开头试试, 不要在函数中间间插定义变量
|
用用的是C++, 编译的时候有没有什么告警之类的东西?
|
在exit()中会关闭所有文件,可能是文件操作的问题。检查一下jTTS_PlayToFile中是怎么处理szToFile的。