[En-Nut-Discussion] Thread stops executing after some time.
Erik L
erik.lindstein at gmail.com
Wed Apr 2 10:46:40 CEST 2008
Oh.. two of the ones with pointer debug just died.
Here is the output from two clients ( 192.168.0.103 AND 192.168.0.104 )
------------------------------------------------------------------------------
s
222 List of sockets
SYN SENT 3A24 TCP 192.168.0.103:5202 192.168.0.115:9050
last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:0,
NutGetMillis:34782
nbq=0x3755 ac_tq=0x2c85 pc_tq=0x0
ESTABLISHED 3B73 TCP 192.168.0.103:23 192.168.0.115:15485
last_error:0 so_retran_time:0 so_rtto:710 so_retransmits:0,
NutGetMillis:34786
nbq=0x0 ac_tq=0xffff pc_tq=0x0
s
222 List of sockets
SYN SENT 3A24 TCP 192.168.0.103:5202 192.168.0.115:9050
last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:0,
NutGetMillis:36933
nbq=0x3755 ac_tq=0x2c85 pc_tq=0x0
ESTABLISHED 3B73 TCP 192.168.0.103:23 192.168.0.115:15485
last_error:0 so_retran_time:0 so_rtto:640 so_retransmits:0,
NutGetMillis:36936
nbq=0x0 ac_tq=0xffff pc_tq=0x0
s
222 List of sockets
SYN SENT 3A24 TCP 192.168.0.103:5202 192.168.0.115:9050
last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:0,
NutGetMillis:65159
nbq=0x3755 ac_tq=0x2c85 pc_tq=0x0
ESTABLISHED 3B73 TCP 192.168.0.103:23 192.168.0.115:15485
last_error:0 so_retran_time:0 so_rtto:470 so_retransmits:0,
NutGetMillis:65163
nbq=0x0 ac_tq=0xffff pc_tq=0x0
m
210 17337 bytes RAM free
s
222 List of sockets
SYN SENT 3A24 TCP 192.168.0.103:5202 192.168.0.115:9050
last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:0,
NutGetMillis:65159
nbq=0x3755 ac_tq=0x2c85 pc_tq=0x0
ESTABLISHED 3B73 TCP 192.168.0.103:23 192.168.0.115:15485
last_error:0 so_retran_time:0 so_rtto:470 so_retransmits:0,
NutGetMillis:65163
nbq=0x0 ac_tq=0xffff pc_tq=0x0
m
210 17337 bytes RAM free
kill
Posting event to kill socket..
m
210 17495 bytes RAM free
s
222 List of sockets
ESTABLISHED 3B73 TCP 192.168.0.103:23 192.168.0.115:15485
last_error:0 so_retran_time:0 so_rtto:356 so_retransmits:0,
NutGetMillis:16133
nbq=0x0 ac_tq=0xffff pc_tq=0x0
------------------------------------------------------------------------------
------------------------------------------------------------------------------
222 List of sockets
SYN SENT 3A24 TCP 192.168.0.104:8610 192.168.0.115:9050
last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:8,
NutGetMillis:3621
nbq=0x37b0 ac_tq=0x2c85 pc_tq=0x0
ESTABLISHED 3B73 TCP 192.168.0.104:23 192.168.0.115:15491
last_error:0 so_retran_time:0 so_rtto:716 so_retransmits:0,
NutGetMillis:3625
nbq=0x0 ac_tq=0xffff pc_tq=0x0
kill
Posting event to kill socket..
s
222 List of sockets
ESTABLISHED 3B73 TCP 192.168.0.104:23 192.168.0.115:15491
last_error:0 so_retran_time:0 so_rtto:571 so_retransmits:0,
NutGetMillis:32794
nbq=0x0 ac_tq=0xffff pc_tq=0x0
------------------------------------------------------------------------------
Erik L wrote:
>
> Because of the long time it takes before i can see the result of the tests
> only the ones without debuging of the pointers have falled now.
>
> But i did get some interesting info out of that one.
> The printout i get from the one that faild is the following (I listed the
> sockets 3 times)
>
> -----------
> 222 List of sockets
>
> (DEAD SOCKET)
> SYN SENT 220F TCP 192.168.0.112:6130
> 192.168.0.115:9050
> last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:2,
> NutGetMillis:35943
>
> (ME CONNECTED)
> ESTABLISHED 2181 TCP 192.168.0.112:23
> 192.168.0.115:15293
> last_error:0 so_retran_time:0 so_rtto:612 so_retransmits:0,
> NutGetMillis:35946
>
> s
> 222 List of sockets
>
> SYN SENT 220F TCP 192.168.0.112:6130
> 192.168.0.115:9050
> last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:2,
> NutGetMillis:38312
>
> ESTABLISHED 2181 TCP 192.168.0.112:23
> 192.168.0.115:15293
> last_error:0 so_retran_time:0 so_rtto:542 so_retransmits:0,
> NutGetMillis:38315
>
> s
> 222 List of sockets
>
> SYN SENT 220F TCP 192.168.0.112:6130
> 192.168.0.115:9050
> last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:2,
> NutGetMillis:39424
>
> ESTABLISHED 2181 TCP 192.168.0.112:23
> 192.168.0.115:15293
> last_error:0 so_retran_time:0 so_rtto:500 so_retransmits:0,
> NutGetMillis:39426
> ---------
>
> So one can see that se socket just gets stuck there.
> But i did add the following code bellow just to test if i could kick the
> socket in the a*s and get it working again. And it worked, so by using the
> kill command the socket / NutTcpConnect came thru and the thread started
> execute again.
>
> ----
> if (strncmp("kill", buff, got) == 0)
> {
> extern TCPSOCKET *tcpSocketList;
> TCPSOCKET *ts;
> for (ts = tcpSocketList; ts; ts = ts->so_next)
> {
> switch (ts->so_state)
> {
> case TCPS_SYN_SENT:
> NutEventBroadcast(&ts->so_rx_tq);
> NutEventBroadcast(&ts->so_pc_tq);
> NutEventBroadcast(&ts->so_ac_tq);
> fputs("Posting event to kill socket..\r\n", stream);
> break;
> }
> }
> continue;
> }
> ----
>
>
> After i run that code i get:
> --------------
> 222 List of sockets
>
> SYN SENT 220F TCP 192.168.0.112:6130
> 192.168.0.115:9050
> last_error:0 so_retran_time:0 so_rtto:1000 so_retransmits:2,
> NutGetMillis:19124
>
> ESTABLISHED 2181 TCP 192.168.0.112:23
> 192.168.0.115:15293
> last_error:0 so_retran_time:0 so_rtto:360 so_retransmits:0,
> NutGetMillis:19127
>
> kill
> Killing sockets
>
> s
> 222 List of sockets
>
> ESTABLISHED 2181 TCP 192.168.0.112:23
> 192.168.0.115:15293
> last_error:0 so_retran_time:0 so_rtto:334 so_retransmits:0,
> NutGetMillis:40380
> --------------
>
> So the question is why don´t NutEventBroadcast get called (as i guess it
> should.)
>
> Regards/Erik
>
>
>
>
> Henrik Maier wrote:
>>
>>> -----Original Message-----
>>> From: en-nut-discussion-bounces at egnite.de [mailto:en-nut-discussion-
>>> bounces at egnite.de] On Behalf Of Erik L
>>>
>>> Also i'm not sure how to debug this ones:
>>> sock->so_tx_nbq
>>> sock->so_ac_tq
>>
>> They are both pointers, so fprintf(stream,"nbq=%p tq=%p\n",
>> sock->so_tx_nbq,
>> sock->so_ac_tq) should do the job. In only want to know if they are 0,
>> 0xFFFF or anything else.
>>
>> Henrik
>> http://www.proconx.com
>>
>>
>> _______________________________________________
>> http://lists.egnite.de/mailman/listinfo/en-nut-discussion
>>
>>
>
>
--
View this message in context: http://www.nabble.com/Thread-stops-executing-after-some-time.-tp16299152p16445434.html
Sent from the MicroControllers - Ethernut mailing list archive at Nabble.com.
More information about the En-Nut-Discussion
mailing list