[En-Nut-Discussion] TCP stops working after some time

Bernd Walter ticso at cicely12.cicely.de
Mon Dec 20 12:25:04 CET 2004


On Mon, Dec 20, 2004 at 10:07:14AM +0100, Harald Kipp wrote:
> Hello Bernd,
> 
> Long time ago since this had been reported. Last night
> our long time test failed. Ethernut seems to be dead.
> Despite similar situations reported by someone else,
> there was even no ping response.

IIRC tests with older Ethernut resulted in different symptoms, but
we had application bugs too that time which might have caused it
as well.

> I also recognized, that several calls to NutEventPostAsync()
> are unprotected from interrupts. Several had been used by
> Oliver's last change to replace NutEventPost(). I do not
> know right now, what's the reason behind this. But there
> may be one. Oliver may have tried to avoid thread switching
> when the socket is in an intermediate state.

We added protection localy, but this didn't change the TCP problem,
but since changing the timeout we had no single failure.
With 100ms we had been seen timeouts with less than 10ms, so there
is at least something to document.
Of course it still might be that we just hide the problem since we
rarely run into timeouts now.

> In July 2003 Ralph Mason fixed a bug by replacing NutEventPost()
> by NutEventPostAsync():
> 
> "When you accept using NutTcpAccept if the accepting thread priority
> is higher than the TCP state machine thread you get a returned socket
> that is not established."

We hadn't changed priorities beside dropping priority on the end
of main and starting an endless NutSleep(60000) loop.

> I'll probably need some time to analyze this. Any additional
> help is welcome.

I will try to make a small testcase out of our software.

-- 
B.Walter                   BWCT                http://www.bwct.de
bernd at bwct.de                                  info at bwct.de




More information about the En-Nut-Discussion mailing list