[En-Nut-Discussion] rs232d: closing socket while other thread is write blocked on socket

Henrik Maier hmnews at proconx.com
Mon Nov 30 11:54:03 CET 2009


Yeah, the implementation looks unsuspicious, nice and elegant and one thinks
that the lock with the connected flag is sufficient. But when I inspected
the call tree in NutTcpClose it became apparent that important data
structures are freed while NutTcpSend surrenders several times to other
threads and then continues to access the very same data structures which
potentially don't exist anymore.

Henrik

> -----Original Message-----
> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
> bounces at egnite.de] On Behalf Of Harald Kipp
> Sent: Monday, 30 November 2009 6:59 PM
> To: Ethernut User Chat (English)
> Subject: Re: [En-Nut-Discussion] rs232d: closing socket while other
> thread is write blocked on socket
> 
> Hi Henrik,
> 
> Henrik Maier wrote:
> > If Harald agrees as well it should be changed. I am sure some people
> build
> > their apps based on that example and wonder why its crashing every now
> and
> > then for no obvious reason and all they did is followed an example.
> 
> Thanks for looking into this. Possibly one or the other app I wrote
> myself is based on this sample.
> 
> I intended to clean up some of the samples anyway. Most of them still
> use the old BSD types and storing constant data in AVR program space
> confuses newbies and developers not working with Harvard architectures.
> 
> Harald
> 
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion




More information about the En-Nut-Discussion mailing list