[En-Nut-Discussion] Thread stops executing after some time.

Erik L erik.lindstein at gmail.com
Thu Mar 27 11:12:48 CET 2008


For some reason the client socket that should loop and try to connect to the
server gets stuck.
I left four systems running over night and now two of them are no longer
trying to connect to the server.
And when i connect to them and list the sockets i can se the folowing:

NOT OK.
---------------------------------
222 List of sockets
SYN SENT        394B     TCP     192.168.0.105:8681      192.168.0.115:9050
<<<- This one is always there.
ESTABLISHED     3AB0     TCP     192.168.0.105:23        192.168.0.115:6473
<<<- This i me connected 
---------------------------------


OK.
---------------------------------
222 List of sockets
SYN SENT        397E     TCP     192.168.0.102:11431     192.168.0.115:9050
<<<- This one is working ESTABLISHED     3AB0     TCP     192.168.0.102:23       
192.168.0.115:6477 <<<- Me connected

222 List of sockets
ESTABLISHED     3AB0     TCP     192.168.0.102:23        192.168.0.115:6477
<<<- Me connected ( Other socket removed correct... )
---------------------------------


The ones that dont connect any more list two sockets ( The one ESTABLISHED
is me connected from my PC ) The other one with SYN SENT is what i guess the
last atempt from the ethernut to connect to my server software. Why it just
gets stuck there i cant understand. The timeouts works fine for 24h then it
just stops. 

Any ideas?



Erik Lindstein wrote:
> 
>>
>>Hi,
>>
>>just an Idea. You seem to have two threads with very low available stack
>>memory. "SmuTh" and "TaTh". It might be possible that those two threads
>>produce a stack overflow and overwrite some data of another thread. I
>>had a similar problem in one of my projects and this also lead to a
>>hanging thread.
>>
>>You should try to increase the threads stack as a first try.
>>
>>Regards,
>>
>>Ole Reinhardt
> 
> Hi Ole.
> I don't think the problem is the stacksize ( atleast not for them
> threads ) because I have the same problem with a minimized setup with
> only the folowing threads:
> 
> 
> ------Output after a couple of hours test without PC connected-------
> 220 List of threads with name,state,prio,stack,mem,timeout follows
> tcpsm   Sleep   32      461     OK      204
> inetd   Sleep   64      2385    OK      None <<<<--( DEAD )
> rxi5    Sleep   9       603     OK      1843
> main    Run     64      650     OK      None
> idle    Ready   254     356     OK      None
> -----
> 
> 
> -----Output when PC is connected and thread running as i should -----
> 220 List of threads with name,state,prio,stack,mem,timeout follows
> tcpsm   Sleep   32      461     OK      60
> inetd   Sleep   64      2399    OK      144 ( RUNNING )
> rxi5    Sleep   9       603     OK      1843
> main    Run     64      650     OK      None
> idle    Ready   254     356     OK      None
> -----
> 
> 
> Regards/Erik
> 
>> When the inetd thread stops executing i can connect to the unit and i
>> get the output seen below:
>> ------------------------------------------------------------------------------------------------------------------------
>> 220 List of threads with name,state,prio,stack,mem,timeout follows
>> tcpsm   Sleep   32      461     OK      27
>> TcpS    Run     64      2546    OK      None
>> inetd   Sleep   64      2381    OK      None
>> rxi5    Sleep   9       603     OK      1392
>> wdt     Sleep   40      255     OK      8
>> SmuTh   Sleep   64      65      OK      71
>> PcuTh   Sleep   64      805     OK      1
>> HvpsTh  Sleep   64      605     OK      24
>> IppsTh  Sleep   64      965     OK      4
>> TaTh    Sleep   64      65      OK      35
>> LcdTh   Sleep   64      929     OK      34
>> main    Sleep   64      733     OK      451
>> idle    Ready   254     356     OK      None
> --
> _______________________________________________
> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
> 
> 

-- 
View this message in context: http://www.nabble.com/Thread-stops-executing-after-some-time.-tp16299152p16323605.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.




More information about the En-Nut-Discussion mailing list