Re: tcludp - bug when closing 1-of-2 listening ports
- From: Vera <vera_soft@xxxxxx>
- Date: Tue, 04 Nov 2008 12:39:11 +0100
Vera schrieb:
Alexandre Ferrieux schrieb:On Nov 3, 2:07 am, Alexandre Ferrieux <alexandre.ferri...@xxxxxxxxx>
wrote:
If I were to guess, I'd say something like a zero-length UDP packet...
but who knows ?
Update 2: I think I have a better characterization of the behavior
now.
It is indeed linked with zero-sized UDP packets.
I have found a deterministic way of producing them (as witnessed by
Wireshark when sending over the LAN):
% set s [udp_open]
% fconfigure $s -remote {somemachine 3000} -buffering none
% puts -nonewline $s titi
% puts -nonewline $s titi
% puts -nonewline $s titi
% close $s
This sends 3 normal UDP packets + 1 zero-sized.
Notice that all this is at interactive speed (no race condition), and
that three 'titi' are needed (two are not enough). Now combined with
your receiver, sending an "exit" packet then a zero-sized one, this
locks the receiving code, somewhere inside the intricate tcludp
machinery,
Several observations:
(1) The speed of the sending sequence has no effect (contrarily to my
first impression)
(2) The zero-sized packet wreaks havoc in tcludp only if it comes on
a closed socket (your case)
(3) Tcludp is not supposed to send zero-sized UDP packets
(4) However it should handle them gracefully, because some other
source can send them.
So I think we have at least two bugs, one on the write side (producing
zero-sized packets) and one on the read side (locking an internal
thread when these beasts come at the wrong time).
I think you should forward this to the maintainer.
-Alex
Congratulation Alex, great work.
Can you, please, send me the method, NOT to get the bug?
Your handcrafted sender, you used at first?
Since you can reproduce the bug, I must not longer search for an PC not updated to XP SP3.
Alex,
I can reproduce the behavior, 2 packets will work, 3 not.
Here is the working output:
----------------------------------------------------------------
C:\user\vera\Projekte\tcludp\test>tclsh85 udpDoubleReceiver.tcl
package udp has version: 1.0.9
Listening on udp port: 1300
Listening on udp port: 1310
AWAIT_EXIT = 2
recv at 1300: 4 {titi}
recv at 1300: 4 {exit}
udp socket at port 1300 closed
AWAIT_EXIT = 1
recv at 1310: 3 {bla}
recv at 1310: 4 {exit}
udp socket at port 1310 closed
AWAIT_EXIT = 0
C:\user\vera\Projekte\tcludp\test>
----------------------------------------------------------------
and here the not working:
----------------------------------------------------------------
C:\user\vera\Projekte\tcludp\test>tclsh85 udpDoubleReceiver.tcl
package udp has version: 1.0.9
Listening on udp port: 1300
Listening on udp port: 1310
AWAIT_EXIT = 2
recv at 1300: 4 {titi}
recv at 1300: 4 {tata}
recv at 1300: 4 {exit}
udp socket at port 1300 closed
AWAIT_EXIT = 1
^CBatchvorgang abbrechen (J/N)? j
----------------------------------------------------------------
May be this helps me finding the bug.
--
Vera
.
- Follow-Ups:
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- References:
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Vera
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Neil Madden
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Vera
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Alexandre Ferrieux
- Re: tcludp - bug when closing 1-of-2 listening ports
- From: Vera
- Re: tcludp - bug when closing 1-of-2 listening ports
- Prev by Date: Re: tcludp - bug when closing 1-of-2 listening ports
- Next by Date: Re: doubt in tcl
- Previous by thread: Re: tcludp - bug when closing 1-of-2 listening ports
- Next by thread: Re: tcludp - bug when closing 1-of-2 listening ports
- Index(es):
Relevant Pages
|