SBL2E XA Error in ReadDataCb

Discussion to talk about software related topics only.
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

SBL2E XA Error in ReadDataCb

Post by nsclfrib »

My application is using the buffered TCP Network interface to handle a Telnet connection.

After about 10-12 hours of operation, I get a message on the debug console
"
"****** Error in ReadDataCb, nPut=81, nGet=81
"
Have no idea what/where that is coming from, except once it comes in, only way to get things restarted is by a reset.

This won't do for a device that's going to be buried inside equipment.

Any idea's what is causing this?
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: SBL2E XA Error in ReadDataCb

Post by rnixon »

What buffer size did you specify when you created the object?
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

Re: SBL2E XA Error in ReadDataCb

Post by nsclfrib »

I allocated 256 bytes. Here's the code:
"
// create tcp buffer object
#define TCP_BUFF_SIZE 256
BYTE buff_obj_buffer[TCP_BUFF_SIZE];
BufferedTcpObject tcp(buff_obj_buffer, TCP_BUFF_SIZE, NULL);
"

Just got another error, last night. Message on the debug console is:
"
***** Error in ReadDataCb, nPut=242, nGet=242
"

Later-
David
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

Re: SBL2E XA Error in ReadDataCb

Post by nsclfrib »

A little extra information related to this latest crash (since it happened before, I trapped when it happened this time):

My client sends a continuous stream of 4 byte commands to the NetBurner. It received somewhere around 8000-10,000 of them before this error, and logged a continuous stream of commands / responses on the terminal. When the error occurred, the NetBurner had been sent a 4 byte command, but it only received the first 2 bytes of this command, and then this error occurred. The client sent the 4 bytes out (according to it's log), but the NetBurner only received the first 2.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: SBL2E XA Error in ReadDataCb

Post by pbreed »

Strange.....
Can you modify the file nburn\system_sc\tcp_buffer.cpp

In the function

void BufferedTcpObject::ReadDataCb(PBYTE Data, int len)

Add the following code before the for loop:

if(len > RxWindowCb())
{
iprintf("****** ERROR More data than the allowed window! len=%d win=%d nPut=%d, nGet=%d\r\n",len,RxWindowCb(), nPut, nGet);
}


Recompile everything and see if you get the "new" error.....

Paul
rnixon
Posts: 833
Joined: Thu Apr 24, 2008 3:59 pm

Re: SBL2E XA Error in ReadDataCb

Post by rnixon »

Not sure how difficult it would be for you, but a wireshark trace would really help to determine what is going on, since it appears to be related to window size and flow control.
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

Re: SBL2E XA Error in ReadDataCb

Post by nsclfrib »

I added the code indicated into tcp_buffer.cpp,(and changed the working of the other error message as well, to insure that the new code got loaded), however when I get the error, I just get my new error message.

Later-
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

Re: SBL2E XA Error in ReadDataCb

Post by nsclfrib »

I meant, I get my reworded error message. The new code I added doesn't return an error.
User avatar
pbreed
Posts: 1088
Joined: Thu Apr 24, 2008 3:58 pm

Re: SBL2E XA Error in ReadDataCb

Post by pbreed »

That is strange....
The combination you describe should not happen unless some kind of memory corruption is happening....
Do you have other tasks that might be overflowing their stack?
nsclfrib
Posts: 13
Joined: Tue Dec 23, 2014 12:38 pm

Re: SBL2E XA Error in ReadDataCb

Post by nsclfrib »

This application only has a Telnet socket enabled now.

I've disabled most everything else.

When I look at the uc/OS Tasks dump I get (real disappointed that mtty doesn't let me grab text)

uc/OS Stacks
Prio StackPtr Stack Bottom Free Now Minimum Free
31 | 0x20005ac8 | 0x20005920 | 424 | 288
5 | 0x20006878 | 0x20005cd0 | 2984 | 2460
10 | 0x20002ab0 | 0x20001f20 | 2960 | 2740

uc/OS Tasks
Prio State Ticks Call Stack
31??|Ready |forever |at: ffc09b02
5??|Running
NET |Ready |forever |ffc09f0c->ffc06e0c-><END>
:
Post Reply