NANO54415 locks up after a lot of TCP connect()s

Discussion to talk about software related topics only.
User avatar
mx270a
Posts: 80
Joined: Tue Jan 19, 2010 6:55 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by mx270a »

Good news. I added a high priority task, and it keeps running while everything else stops.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by pbreed »

Ok there is a diagnostic...

Step 1 go into nburn\include\predef.h
and make #define UCOS_STACKCHECK (1)
Active (IE uncomment it)

Step 2 rebuild EVERYTHING ie system, project, libraries etc...


Step 3 Add a call to OSDumpTasks( void );

In your high priority task...
It would be best if you only did this when it hung as OSDumTasks is an expensive call...


Paul
User avatar
mx270a
Posts: 80
Joined: Tue Jan 19, 2010 6:55 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by mx270a »

I logged OSDumpTasks() from three lockups.

Code: Select all

uc/OS Tasks
Prio  State    Ticks    Call Stack
Idle|Ready    |forever |at: 400076ec
Main|Ready    |forever |4000784e->400045da->400076d0-><END>
TCP |Semaphore|forever |40007d72->40014b4a->400076d0-><END>
IP  |Ready    |forever |at: 4001199a
Esnd|Fifo     |    32  |40008ad8->4001c60c->400076d0-><END>
 1??|Running
42??|Semaphore|forever |at: 40007704


uc/OS Tasks
Prio  State    Ticks    Call Stack
Idle|Ready    |forever |at: 4000771c
Main|Ready    |forever |4000786e->400045da->400076f0-><END>
TCP |Semaphore|forever |40007d92->40014b6a->400076f0-><END>
IP  |Ready    |forever |at: 400119ba
Esnd|Fifo     |    32  |40008af8->4001c62c->400076f0-><END>
 1??|Running
42??|Ready    |forever |4000786e->400046c4->400076f0-><END>


uc/OS Tasks
Prio  State    Ticks    Call Stack
Idle|Ready    |forever |at: 400076fa
Main|Ready    |forever |4000784e->400045f4->400076d0-><END>
TCP |Semaphore|forever |40007d72->40014b4a->400076d0-><END>
IP  |Ready    |forever |at: 4001199a
Esnd|Fifo     |    22  |40008ad8->4001c60c->400076d0-><END>
 1??|Running
42??|Ready    |forever |4000784e->400046c4->400076d0-><END>
Edit: Am I interested in the TCP or the Esnd task stack?
4001c60c traces to C:\nburn\NANO54415\system/ethernet.cpp:297 which is "if (pb == NULL)"
4001c62c traces to C:\nburn\NANO54415\system/ethernet.cpp:310 which is "if ( RxBD.flags & RXBD_Error_Mask )"
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by pbreed »

Looks like its stuck in the IP task, ie the one task that is always READY....
User avatar
mx270a
Posts: 80
Joined: Tue Jan 19, 2010 6:55 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by mx270a »

The address the IP task is sitting at comes back as:
HashSocketList::findsocket(unsigned short, unsigned short, unsigned long) const
C:\nburn\system/tcp.cpp:4443

Which is this line:

Code: Select all

while ( ps != NULL )
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by pbreed »

What is the content of

nburn\release_tag
(Trying to make sure you have the latest revision)
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by pbreed »

This code stores TCP sockets in a linked list indexed by
a hash function to find the "Right" socket to process an incoming packet.
It looks like the linked list is getting corrupted....

1)Could be either a race condition between tasks...

2)Or some kind of steping on oneself memory problem (stack overflow wild pointer)

Please submit a support request and we'll try and get you a tcp.cpp
that might resolve issue 1) above....
User avatar
mx270a
Posts: 80
Joined: Tue Jan 19, 2010 6:55 pm

Re: NANO54415 locks up after a lot of TCP connect()s

Post by mx270a »

Resolved. I updated to NNDK 2.6.7 and haven't seen the issue since. Rookie mistake not updating the software first, I should have known better. On the plus side, I learned a lot about how the NB system works. Thanks for the assistance.
Post Reply