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
[EMAIL PROTECTED]
+46 8 449 05 30

-----Ursprungligt meddelande-----
Från: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] För [EMAIL PROTECTED]
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

[EMAIL PROTECTED] 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/> /[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>/
>> /+46 8 449 05 30/
>>
>>  
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] *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/> /[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>/
>> /+46 8 449 05 30/
>>
>>  
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] *För 
>> [EMAIL PROTECTED]
>> *Skickat:* den 5 december 2007 17:10
>> *Till:* Mailing list for lwIP users
>> *Kopia:* [EMAIL PROTECTED];
>> '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" <[EMAIL PROTECTED]>*
>> Sent by: [EMAIL PROTECTED]
>>
>> 12/05/2007 11:07 AM
>> Please respond to
>> Mailing list for lwIP users <[email protected]>
>>
>>
>>      
>> To
>>      "'Mailing list for lwIP users'" <[email protected]> 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/>/_ _//[EMAIL PROTECTED]/ <mailto:[EMAIL PROTECTED]>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] *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:* 
>> [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> 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/>/_ _//[EMAIL PROTECTED]/ <mailto:[EMAIL PROTECTED]>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] *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:* 
>> [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED]
>> rg]
>> *Im Auftrag von *Jan Wester*
>> Gesendet:* Mittwoch, 5. Dezember 2007 15:51*
>> An:* [EMAIL PROTECTED]; '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/>/_ _//[EMAIL PROTECTED]/ <mailto:[EMAIL PROTECTED]>/
>> +46 8 449 05 30/
>>
>>
>>
>> ---------------------------------------------------------------------
>> ---
>> *Från:* [EMAIL PROTECTED]
>> [mailto:[EMAIL PROTECTED] *För *Thomas
>> Catalino*
>> Skickat:* den 3 december 2007 02:33*
>> Till:* [EMAIL PROTECTED]
>> Ä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
>> [email protected]
>> http://lists.nongnu.org/mailman/listinfo/lwip-users
>>
>>
>> ---------------------------------------------------------------------
>> ---
>>
>> _______________________________________________
>> lwip-users mailing list
>> [email protected]
>> 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
> [email protected]
> http://lists.nongnu.org/mailman/listinfo/lwip-users
>
>
>   



_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Watch1
  tcp_active_pcbs = Ptr(0x04005F40) = Ptr(memp_memory[2368])
    *tcp_active_pcbs = ((0x0100A8C0),(0x2F00A8C0),0x0000,\x00 (0x00),\xFF 
(0xFF),Ptr(0x04005FE0) = Ptr(memp_memory[2528]),CLOSING,'@' 
(0x40),Ptr(0x040106B4) = Ptr(httpHandlerArr[3].pcb),0x0050,0x043B,' ' 
(0x20),0x005466E7,0x01FF,0x00000033,\x00 (0x00),\x00 
(0x00),0xFFFF,0x0200,0x00000000)
      local_ip = (0x0100A8C0)
      remote_ip = (0x2F00A8C0)
      so_options = 0x0000
      tos = \x00 (0x00)
      ttl = \xFF (0xFF)
      next = Ptr(0x04005FE0) = Ptr(memp_memory[2528])
      state = CLOSING
      prio = '@' (0x40)
      callback_arg = Ptr(0x040106B4) = Ptr(httpHandlerArr[3].pcb)
      local_port = 0x0050
      remote_port = 0x043B
      flags = ' ' (0x20)
      rcv_nxt = 0x005466E7
      rcv_wnd = 0x01FF
      tmr = 0x00000033
      polltmr = \x00 (0x00)
      pollinterval = \x00 (0x00)
      rtime = 0xFFFF
      mss = 0x0200
      rttest = 0x00000000
      rtseq = 0x0000214B
      sa = 0x0000
      sv = 0x0003
      rto = 0x0003
      nrtx = \x00 (0x00)
      lastack = 0x000024AD
      dupacks = \x01 (0x01)
      cwnd = 0x0400
      ssthresh = 0x0400
      snd_nxt = 0x000024AC
      snd_max = 0x000024AD
      snd_wnd = 0x2000
      snd_wl1 = 0x005466E6
      snd_wl2 = 0x000024AD
      snd_lbb = 0x000024AD
      acked = 0x0000
      snd_buf = 0x0800
      snd_queuelen = 0x0000
      unsent = Ptr(0x00000000) = NULL
      unacked = Ptr(0x00000000) = NULL
      ooseq = Ptr(0x00000000) = NULL
      sent = Ptr(0x00000000) = NULL
      recv = Ptr(0x00000000) = NULL
      connected = Ptr(0x00000000) = NULL
      accept = Ptr(0x00025BDC) = Ptr(httpAccept)
      poll = Ptr(0x00000000) = NULL
      errf = Ptr(0x00000000) = NULL
      keep_idle = 0x006DDD00
      keep_cnt_sent = \x00 (0x00)
_______________________________________________
lwip-users mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/lwip-users

Reply via email to