[PATCH] fix the Sorcerer's Apprentice Syndrome in tftp (-g)

Denys Vlasenko vda.linux at googlemail.com
Sun May 10 20:57:44 UTC 2009


On Friday 08 May 2009 05:43, Baruch Siach wrote:
> Hi busybox mailing list,
> 
> The attached patch fixes a variant of the famous Sorcerer's Apprentice 
> Syndrome (http://en.wikipedia.org/wiki/Sorcerer's_Apprentice_Syndrome) in the 
> tftp client.
> 
> I'm seeing this bug on tftp downloads (-g). When a DATA packet is received 
> from the tftp server after more than 50ms, the tftp client resends TFTP_ACK, 
> thus getting the DATA packet twice, and acknowledging it twice.

Hmm. Doe it happen with _busybox_ TFTP server? It seems to contain the code
to prevent that.

> From this  
> point on each DATA packet is sent and acknowledged twice. If another timeout 
> occurs, we get three DATA packets for each block, and no on. At some point we 
> saw hundreds of packets being sent for one block. In one instance the transfer 
> of a 2.5MB file took a few hours to complete. Using http/ftp for the same 
> transfer takes less than 15 seconds.
> 
> This patch actually reverts r10885 (and r10477 which is a duplicate) as 
> resending a TFTP_ACK is not needed anymore. I verified that the current code 
> recovers from lost ACKs correctly. Dropping a few TFTP_ACK during the transfer 
> didn't break the transfer.

Applied, thanks.
--
vda


More information about the busybox mailing list