lwip-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SV: [lwip-users] Re: TCP_SEG Leak ...


From: Jan Wester
Subject: SV: [lwip-users] Re: TCP_SEG Leak ...
Date: Wed, 2 Jan 2008 14:10:52 +0100

Hi
I have temporary removed the patch for check of active pcb i CLOSING state,
I have waited for 20 minutes but the problem is still where and after a
while all pcbs is in this state and no more connection can bee done
I add a the dump of active pcbs, let me know how I can go further 


Med vänlig hälsning/Best Regards
Jan Wester

_________________________________ 
WHI Konsult AB
Scheelegatan 11, 112 28 Stockholm, Sweden
www.whi.se
address@hidden
+46 8 449 05 30

-----Ursprungligt meddelande-----
Från: address@hidden
[mailto:address@hidden För address@hidden
Skickat: den 6 december 2007 21:33
Till: Mailing list for lwIP users
Ämne: Re: [lwip-users] Re: TCP_SEG Leak ...

After trying to reproduce your bug report, I'm not so sure any more that
there is a problem: when the last ACK is lost (for whatever reason),
tcp_slowtmr will eventually retransmit the outstanding (unacked) segment
(the FIN,ACK). The retransmission will take place when (pcb->rtime >= 
pcb->rto). And if the server still does not send the ACK again (or a
RST), or it is lost again, the connection will eventually time out (after 12
retransmissions per default).

That can be quite long, of course (since pcb->rto is growing nearly
exponentially with each retransmission). But until the retransmission timer
is not running (pcb->rtime would be -1) - which would be a bug somewhere -
your pcbs should time out. Be aware that 12 retransmissions need quite long
(I calculated it between 3 and 4 minutes - that is, if your timers are
running correctly and accurately).

Could you maybe post a dump of all pcbs in the CLOSED state when you see
this bug? (Plus maybe a note on the segments that are in the unacked or
unsent queues - length FIN/ACK flags)

Simon

address@hidden schrieb:
> I don't know for which reason the lask ACK 'disappears' (shouldn't the 
> remote side try again?) but I think the patch is reasonable to keep 
> the system stable... I'll submit a bug report (which is the normal 
> thing to do when discovering bugs, they easily get lost when only 
> posting to the
> mailing-list) and test it.
>
> Simon
>
> Jan Wester schrieb:
>   
>> Hi
>> I added check for CLOSING state in tcp.c, with this patch the pcb is 
>> freed
>>  
>>     /* Check if this PCB has stayed too long in LAST-ACK */
>>     if (pcb->state == LAST_ACK) {
>>       if ((u32_t)(tcp_ticks - pcb->tmr) > 2 * TCP_MSL /
>> TCP_SLOW_INTERVAL) {
>>         ++pcb_remove;
>>         LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in 
>> LAST-ACK\n"));
>>       }
>>     }
>>  
>> +    /* Check if this PCB has stayed too long in CLOSING */
>> +   if (pcb->state == CLOSING) {
>> +     if ((u32_t)(tcp_ticks - pcb->tmr) >
>> +       TCP_CLOSING_TIMEOUT / TCP_SLOW_INTERVAL) {
>> +       ++pcb_remove;
>> +       LWIP_DEBUGF(TCP_DEBUG, ("tcp_slowtmr: removing pcb stuck in
>> CLOSING\n"));
>> +     }
>> +   }
>>  
>>     /* If the PCB should be removed, do it. */
>>  
>>
>> /Med vänlig hälsning/Best Regards
>> Jan Wester
>> /
>>
>> /_________________________________ /
>>
>> /**WHI Konsult AB**/
>>
>> /Scheelegatan 11, 112 28 Stockholm//, //Sweden //www.whi.se/ 
>> <http://www.whi.se/> /address@hidden <mailto:address@hidden>/
>> /+46 8 449 05 30/
>>
>>  
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* address@hidden
>> [mailto:address@hidden *För *Jan 
>> Wester
>> *Skickat:* den 5 december 2007 17:16
>> *Till:* 'Mailing list for lwIP users'
>> *Ämne:* SV: SV: [lwip-users] Re: TCP_SEG Leak ...
>>
>> Ok
>> I try to fix the closing first. Take a look on it tomorrow
>>  
>>
>> /Med vänlig hälsning/Best Regards
>> Jan Wester
>> /
>>
>> /_________________________________ /
>>
>> /**WHI Konsult AB**/
>>
>> /Scheelegatan 11, 112 28 Stockholm//, //Sweden //www.whi.se/ 
>> <http://www.whi.se/> /address@hidden <mailto:address@hidden>/
>> /+46 8 449 05 30/
>>
>>  
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* address@hidden
>> [mailto:address@hidden *För 
>> address@hidden
>> *Skickat:* den 5 december 2007 17:10
>> *Till:* Mailing list for lwIP users
>> *Kopia:* address@hidden;
>> 'Mailing list for lwIP users'
>> *Ämne:* Re: SV: [lwip-users] Re: TCP_SEG Leak ...
>>
>>
>> Could you add a routine that checks for "all PCB is in CLOSING state" 
>> and issue a reset to the micro?
>>
>> Not a good solution for the long term (obviously lwip needs fix), but 
>> it would at least keep the system available for the short term.
>>
>> Andy
>>
>>
>>
>>
>> *"Jan Wester" <address@hidden>*
>> Sent by: address@hidden
>>
>> 12/05/2007 11:07 AM
>> Please respond to
>> Mailing list for lwIP users <address@hidden>
>>
>>
>>      
>> To
>>      "'Mailing list for lwIP users'" <address@hidden> cc
>>      
>> Subject
>>      SV: [lwip-users] Re: TCP_SEG Leak ...
>>
>>
>>
>>      
>>
>>
>>
>>
>>
>> Ok,
>> I found it in my changelog
>> Still not working, sometimes the last ack disappears and on close the 
>> pcb state is changed to CLOSING, forever After a while all pcb is in 
>> CLOSING state and I have to reset the system
>>  
>>
>> /Med vänlig hälsning/Best Regards
>> Jan Wester/
>>
>> /_________________________________ /
>>
>> */WHI Konsult AB/*
>>
>> /Scheelegatan 11, 112 28 Stockholm, Sweden/_ _/_www.whi.se_/ 
>> <http://www.whi.se/>/_ _//address@hidden/ <mailto:address@hidden>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* address@hidden
>> [mailto:address@hidden *För 
>> *Goldschmidt Simon*
>> Skickat:* den 5 december 2007 16:33*
>> Till:* Mailing list for lwIP users*
>> Ämne:* AW: [lwip-users] Re: TCP_SEG Leak ...
>>
>> _http://cvs.savannah.nongnu.org/viewvc/lwip/CHANGELOG?root=lwip&r1=1.
>> 267&r2=1.268_ 
>> <http://cvs.savannah.nongnu.org/viewvc/lwip/CHANGELOG?root=lwip&r1=1.
>> 267&r2=1.268>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Von:* 
>> address@hidden
>> [mailto:address@hidden
>> rg]
>> *Im Auftrag von *Jan Wester*
>> Gesendet:* Mittwoch, 5. Dezember 2007 16:26*
>> An:* 'Mailing list for lwIP users'*
>> Betreff:* SV: [lwip-users] Re: TCP_SEG Leak ...
>>
>> Sorry about the version, I use 1.3.0, Ok, I have downloaded the 
>> latest cvs head, but nothing was mentioned in the changelog I shall 
>> start to test to see if it works
>>  
>>
>> /Med vänlig hälsning/Best Regards
>> Jan Wester/
>>
>> /_________________________________ /
>>
>> */WHI Konsult AB/*
>>
>> /Scheelegatan 11, 112 28 Stockholm, Sweden/_ _/_www.whi.se_/ 
>> <http://www.whi.se/>/_ _//address@hidden/ <mailto:address@hidden>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* address@hidden
>> [mailto:address@hidden *För 
>> *Goldschmidt Simon*
>> Skickat:* den 5 december 2007 15:58*
>> Till:* Mailing list for lwIP users*
>> Ämne:* RE: [lwip-users] Re: TCP_SEG Leak ...
>>
>> Hi,
>>  
>> the fix for this bug is included in CVS head. I can't send you 'a fix' 
>> since I would have to create one for your lwIP version (by 
>> backporting it to the version of lwIP you use). You can either 
>> download a CVS version of lwIP ('pretty stable' at the moment... - no 
>> guarantee for that, though!), wait until 1.3.0 is released, or 
>> backport it yourself by looking at the latest diffs to tcp.c and tcp_in.c
in WebCVS.
>>  
>> Simon
>>  
>>
>> ---------------------------------------------------------------------
>> ---
>> *Von:* 
>> address@hidden
>> [mailto:address@hidden
>> rg]
>> *Im Auftrag von *Jan Wester*
>> Gesendet:* Mittwoch, 5. Dezember 2007 15:51*
>> An:* address@hidden; 'Mailing list for lwIP users'*
>> Betreff:* SV: [lwip-users] Re: TCP_SEG Leak ...
>>
>> Hi
>> Can you send me the fix for ooseq, I belive I have the same problem 
>> with my webserver with more simultane connections
>>  
>>
>> /Med vänlig hälsning/Best Regards
>> Jan Wester/
>>
>> /_________________________________ /
>>
>> */WHI Konsult AB/*
>>
>> /Scheelegatan 11, 112 28 Stockholm, Sweden/_ _/_www.whi.se_/ 
>> <http://www.whi.se/>/_ _//address@hidden/ <mailto:address@hidden>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* address@hidden
>> [mailto:address@hidden *För *Thomas
>> Catalino*
>> Skickat:* den 3 december 2007 02:33*
>> Till:* address@hidden
>> Ämne:* [lwip-users] Re: TCP_SEG Leak ...
>>
>>
>> Simon -
>>
>> Thanks for confirming the bug. We'll put a patch in our code for now 
>> and will watch the bug for the real fix. Let me know if I can help, I 
>> would have suggested a fix, but I'm not familiar enough with the 
>> ooseq processing in the stack.
>>
>> As you can imagine this is eventually fatal -- especially for 
>> applications that make / break a lot of TCP connections (we do a lot 
>> of HTTP GETs and POSTs and is how we discovered it).
>>
>> Thanks again -
>> Tom
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> _______________________________________________
>> lwip-users mailing list
>> address@hidden
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> No virus found in this incoming message.
>> Checked by AVG Free Edition. 
>> Version: 7.5.503 / Virus Database: 269.16.15/1174 - Release Date: 
>> 06.12.2007 10:11
>>     
>
>
>
> _______________________________________________
> lwip-users mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>   



_______________________________________________
lwip-users mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/lwip-users

Attachment: tcp_active_pcbs.txt
Description: Text document


reply via email to

[Prev in Thread] Current Thread [Next in Thread]