[En-Nut-Discussion] Question about two network connections.

Alexander Baranov Baranov at intech21.com
Tue Feb 3 20:25:55 CET 2004


Thanks, Harald.
I suspect that the size of stack is the point. Could you tell me how to
increase the size of stack of main thread or give me the reference to the
doc?  I could not  find it using context search.
Regards, Alex.

----- Original Message ----- 
From: "Harald Kipp" <harald.kipp at egnite.de>
To: "Ethernut User Chat (English)" <en-nut-discussion at egnite.de>
Sent: Tuesday, February 03, 2004 8:30 AM
Subject: Re: [En-Nut-Discussion] Question about two network connections.


> Hi Alexander,
>
> This may be caused by many bugs. The system itself
> seems to be stable in this sense...but who knows.
> Recently a bug in netbuf.c had been detected, but
> it appears under very specific circumstances only.
> May be try a copy of this file from CVS.
>
> In the first place increase the stack size of
> your threads. This is easy.
>
> Next, carefully review your code, specially those
> parts, that write to allocated memory. The malloc
> routines in the debug version (NUTDEBUG) offer
> some additional protection and may help to locate
> the problem.
>
> If two threads are modifying multibyte values,
> make sure, that the modification is atomic.
>
> Most likely the problem is _not_ caused by too less
> heap space.
>
> Harald
>
>
> At 09:56 02.02.2004 -0500, you wrote:
> >Hi, All.
> >I have such a problem:
> >I use two network oriented threads.
> >Main thread periodically sends data through Inet using POST method of
http
> >protocol. Having sent the next potion of data, it obtains something as
> >server reply and parses it as server command.
> >Another thread, which I call DirectTCP, opens another socket and accepts
> >data from port 23 - telnet like this:
> >NutTcpAccept(dirsock, 23).
> >It is supposed to be used for immediate incoming commands from the
server.
> >Actually, it works but sometimes it hangs up and the box is being
reloaded
> >by watchdog. I tried to investigate the situation and found that the
> >'tdp->td_memory' of the  main thread after some time becomes  not equal
to
> >DEADBEEF, which is interpreted as "CORRUPT" in one of the examples. I
tried
> >to free as much heap as possible and now I have almost 16K heap
available,
> >but I have not achieved stable work still.
> >Maybe I have to upgrade the system? Judging from version.c I use 3.3.0.1.
> >now. Please, advise.
> >Thanks,
> >Alexander Baranov
> >
> >_______________________________________________
> >En-Nut-Discussion mailing list
> >En-Nut-Discussion at egnite.de
> >http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion
>
> _______________________________________________
> En-Nut-Discussion mailing list
> En-Nut-Discussion at egnite.de
> http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list