免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 5064 | 回复: 10
打印 上一主题 下一主题

程序挂死在send(),大家帮猜猜什么原因,server是正常的 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2010-08-28 09:52 |只看该作者 |倒序浏览
程序挂死在send(),大家帮猜猜什么原因,server是正常的
下面是gdb调试PID的信息,fork的进程。

[root@tatu bin]# gdb -p 21142
GNU gdb Fedora (6.8-27.el5)
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-redhat-linux-gnu".
Attaching to process 21142
Reading symbols from /home/wangss/workspace/zdnsm_svn/work/bin/zdnsm...done.
Error while mapping shared library sections:
./nmsg_msg7_isc.so: No such file or directory.
Reading symbols from /usr/local/lib/libnmsg.so.6...done.
Loaded symbols for /usr/local/lib/libnmsg.so.6
Reading symbols from /usr/local/lib/libprotobuf.so.6...done.
Loaded symbols for /usr/local/lib/libprotobuf.so.6
Reading symbols from /usr/local/lib/libldns.so.1...done.
Loaded symbols for /usr/local/lib/libldns.so.1
Reading symbols from /usr/lib64/libncurses.so.5...done.
Loaded symbols for /usr/lib64/libncurses.so.5
Reading symbols from /usr/local/lib/libpcap.so.1...done.
Loaded symbols for /usr/local/lib/libpcap.so.1
Reading symbols from /lib64/libdl.so.2...done.
Loaded symbols for /lib64/libdl.so.2
Reading symbols from /lib64/librt.so.1...done.
Loaded symbols for /lib64/librt.so.1
Reading symbols from /usr/local/lib/libz.so.1...done.
Loaded symbols for /usr/local/lib/libz.so.1
Reading symbols from /lib64/libpthread.so.0...done.
[Thread debugging using libthread_db enabled]
[New Thread 0x2b13ede9a3b0 (LWP 21142)]
[New Thread 0x40f69940 (LWP 21149)]
[New Thread 0x45607940 (LWP 2114]
[New Thread 0x44c06940 (LWP 21147)]
[New Thread 0x44205940 (LWP 21146)]
[New Thread 0x43804940 (LWP 21145)]
[New Thread 0x42e03940 (LWP 21144)]
[New Thread 0x42402940 (LWP 21143)]
Loaded symbols for /lib64/libpthread.so.0
Reading symbols from /opt/oracle/lib/libocci.so.10.1...done.
Loaded symbols for /opt/oracle/lib/libocci.so.10.1
Reading symbols from /opt/oracle/lib/libclntsh.so.10.1...done.
Loaded symbols for /opt/oracle/lib/libclntsh.so.10.1
Reading symbols from /usr/local/lib/libGeoIP.so.1...done.
Loaded symbols for /usr/local/lib/libGeoIP.so.1
Reading symbols from /usr/lib64/libstdc++.so.6...done.
Loaded symbols for /usr/lib64/libstdc++.so.6
Reading symbols from /lib64/libm.so.6...done.
Loaded symbols for /lib64/libm.so.6
Reading symbols from /lib64/libgcc_s.so.1...done.
Loaded symbols for /lib64/libgcc_s.so.1
Reading symbols from /lib64/libc.so.6...done.
Loaded symbols for /lib64/libc.so.6
Reading symbols from /lib64/libnsl.so.1...done.
Loaded symbols for /lib64/libnsl.so.1
Reading symbols from /lib64/libcrypto.so.6...done.
Loaded symbols for /lib64/libcrypto.so.6
Reading symbols from /lib64/ld-linux-x86-64.so.2...done.
Loaded symbols for /lib64/ld-linux-x86-64.so.2
Reading symbols from /opt/oracle/lib/libnnz10.so...done.
Loaded symbols for /opt/oracle/lib/libnnz10.so
Reading symbols from /lib64/libnss_files.so.2...done.
Loaded symbols for /lib64/libnss_files.so.2
Symbol file not found for ./nmsg_msg7_isc.so
0x00000030e360d841 in send () from /lib64/libpthread.so.0

到这里按c
程序也不动,就一直卡在这里。我都快疯了
大家帮我想想原因,谢了

论坛徽章:
0
2 [报告]
发表于 2010-08-28 10:19 |只看该作者
我顶

论坛徽章:
0
3 [报告]
发表于 2010-08-28 10:57 |只看该作者
信息太少,没法判断原因。

论坛徽章:
0
4 [报告]
发表于 2010-08-28 11:37 |只看该作者
send()阻塞,只能说明发送缓冲区是满的

论坛徽章:
0
5 [报告]
发表于 2010-08-28 12:39 |只看该作者
send()阻塞,只能说明发送缓冲区是满的
lanying_wzw 发表于 2010-08-28 11:37



   

也要看是socket否为阻塞

论坛徽章:
0
6 [报告]
发表于 2010-08-28 13:48 |只看该作者
描述符是fork之前生成的还是fork之后生成的?

论坛徽章:
0
7 [报告]
发表于 2010-08-28 18:06 |只看该作者
遇到过一次 未解决  同等。

论坛徽章:
0
8 [报告]
发表于 2010-08-28 21:31 |只看该作者
设成非阻塞的socket,然后看send()的返回值,查找下原因。

论坛徽章:
0
9 [报告]
发表于 2010-08-29 12:53 |只看该作者
先打log吧, 没必要一上来就gdb.

论坛徽章:
0
10 [报告]
发表于 2010-08-30 20:10 |只看该作者
是不是send阻塞啦。。。在调用 read 之前调用select 做一个定时器试试看。

用 select 来检查send handle是否可写,如果不可写的话,超时之后,输出点信息出来看看额。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP