Page 1 of 2
SBL2E XA Error in ReadDataCb
Posted: Wed Jan 21, 2015 11:31 am
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?
Re: SBL2E XA Error in ReadDataCb
Posted: Wed Jan 21, 2015 2:22 pm
by rnixon
What buffer size did you specify when you created the object?
Re: SBL2E XA Error in ReadDataCb
Posted: Thu Jan 22, 2015 4:51 am
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
Re: SBL2E XA Error in ReadDataCb
Posted: Thu Jan 22, 2015 4:57 am
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.
Re: SBL2E XA Error in ReadDataCb
Posted: Thu Jan 22, 2015 9:19 am
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
Re: SBL2E XA Error in ReadDataCb
Posted: Thu Jan 22, 2015 9:23 am
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.
Re: SBL2E XA Error in ReadDataCb
Posted: Fri Jan 23, 2015 7:48 am
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-
Re: SBL2E XA Error in ReadDataCb
Posted: Fri Jan 23, 2015 12:43 pm
by nsclfrib
I meant, I get my reworded error message. The new code I added doesn't return an error.
Re: SBL2E XA Error in ReadDataCb
Posted: Fri Jan 23, 2015 2:52 pm
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?
Re: SBL2E XA Error in ReadDataCb
Posted: Mon Jan 26, 2015 7:36 am
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>
: