URL:
<http://gna.org/bugs/?12249>
Summary: Index server can be blocked in read()
Project: Wormux
Submitted by: gentildemon
Submitted on: samedi 30.08.2008 à 12:40
Category: Index server
Severity: 5 - Blocker
Priority: 5 - Normal
Status: None
Assigned to: None
Originator Email:
Open/Closed: Open
Release: r4920
Discussion Lock: Any
_______________________________________________________
Details:
read() is called in blocking fashion. However, we are normally sure that
there is enough data to read when we call it.
Here are some information:
(gdb) bt
#0 0x00002af1a36bc352 in read () from /lib/libc.so.6
#1 0x000000000040c4e9 in NetData::ReceiveInt (this=0x51b5f0,
[EMAIL PROTECTED]) at net_data.cpp:170
#2 0x000000000040c942 in NetData::ReceiveStr (this=0x51b5f0,
[EMAIL PROTECTED]) at net_data.cpp:197
#3 0x0000000000406108 in Client::HandleMsg (this=0x51b5f0,
msg_id=TS_MSG_VERSION) at client.cpp:185
#4 0x000000000040c880 in NetData::Receive (this=0x51b5f0) at
net_data.cpp:363
#5 0x0000000000403837 in main (argc=1, argv=0x7fff089784e8) at main.cpp:199
(gdb) frame 1
#1 0x000000000040c4e9 in NetData::ReceiveInt (this=0x51b5f0,
[EMAIL PROTECTED]) at net_data.cpp:170
170 if( read(fd, &packet, sizeof(packet)) == -1 )
(gdb) print sizeof(packet)
$8 = 4
(gdb) print received
$9 = 4
So normally, there is enough data to read. Moreover, after hours, the timeout
must have been finished, thus, read() should either stop with "-1" and errno
set or with 0 and the buffer filled.
_______________________________________________________
Reply to this item at:
<http://gna.org/bugs/?12249>
_______________________________________________
Message posté via/par Gna!
http://gna.org/
_______________________________________________
Wormux-gna mailing list
[email protected]
https://mail.gna.org/listinfo/wormux-gna