[En-Nut-Discussion] Race condition in TCP statemachine

Harald Kipp harald.kipp at egnite.de
Sun Jan 12 12:34:33 CET 2014


Hi Ole,

On 10.01.2014 18:32, Ole Reinhardt wrote:
> Am 10.01.2014 18:26, schrieb Ole Reinhardt:
>> while implementing a TCP connect timeout, I found a severe problem
>> (racecondition) in the TCP statemachine.
> 
> I missed one thing:
> 
> There are still three places, where this kind of race condition still
> exists:
> 
> - net/netdebug.c

As far as netdebug is concerned, I typically use DEV_DEBUG, which
guarantees not to switch context.

> - hwtest/avr/basemon/webdemo.c:

I never cared much about this one.

> - app/httpd/httpserv.c:

Not sure to which version of httpserv you are referring to, but mine
clearly states

  /* Take a snapshot of ...

As you can see in this source, the same applies to the list of timers
and threads.

It's quite obvious, that you cannot walk through these lists and doing a
context switch in between.


Regards,

Harald



More information about the En-Nut-Discussion mailing list