Hanging in tcp_slowtmr

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Hanging in tcp_slowtmr

Jan Wester

Hi

I have a small client system with an ATMEL AT91 processor.

This client regularly polls a server program on my pc with a tcp call.

If the server program is running when I start the client everything works nicely.

If I start the client when the server program is not running the client tries to contact the server regularly without success, but works as it should otherwise.

But if I now start the server program, the client polls the server two times successfully and then hangs. It hangs in the module tcp.c in function tcp_slowtmr in the section at the end of the function that starts with the comment:

/* Steps through all of the TIME-WAIT PCBs. */ Line 620

I am no expert on tcp/ip communication, so maybe I am not doing something right when a connection attempt fails.

What is the proper way to deal with an unsuccessful connection attempt?

Please help me with this. We just got an interested customer who wants a test installation in a few weeks.

 

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

_________________________________

WHI Konsult AB

Scheelegatan 11, 112 28 Stockholm, Sweden
www.whi.se
[hidden email]
+46 8 449 05 30

 

_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users
Reply | Threaded
Open this post in threaded view
|

Re: Hanging in tcp_slowtmr

Kieran Mansley
On Tue, 2006-11-14 at 15:00 +0100, Jan Wester wrote:

> But if I now start the server program, the client polls the server two
> times successfully and then hangs. It hangs in the module tcp.c in
> function tcp_slowtmr in the section at the end of the function that
> starts with the comment:
>
> /* Steps through all of the TIME-WAIT PCBs. */ Line 620
>
> I am no expert on tcp/ip communication, so maybe I am not doing
> something right when a connection attempt fails.
>
> What is the proper way to deal with an unsuccessful connection
> attempt?

Hard to say without more detail.  Two things spring to mind as possible:
 - you're leaking some resource on each unsuccessful connection attempt
that causes it to later lock up.
 - you haven't properly protected the stack from multiple threads
accessing it.  Timers are often implemented as a separate thread, and so
that would tie-up.

Both of these might be entirely wrong, but they fit with the sort of
thing that you're talking about.

For it to hang in that loop suggests that the list of PCBs has become
corrupt and (for example) has the same PCB on it twice, so if you try
and iterate it you loop indefinitely.

Kieran



_______________________________________________
lwip-users mailing list
[hidden email]
http://lists.nongnu.org/mailman/listinfo/lwip-users