News:

  • September 30, 2026, 09:47:33 PM

Login with username, password and session length

Author Topic: Clarification of error message needed  (Read 11059 times)

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Clarification of error message needed
« on: August 24, 2019, 03:56:59 PM »
"Attempted string operation was longer than target string and was truncated in STREAMOUT @000007C4 (STREAMOUT at SendFile@286)"

I'm using a buffer instead of a string and I'm setting the length to no more than 1000 bytes. It's binary data read in from a file. Buffer length is determined by number of bytes read.

The problem appears to be sporadic (although the data in the buffer probably varies each time the code is run).

Does anyone have any ideas?
Andrew.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Clarification of error message needed
« Reply #1 on: August 25, 2019, 02:39:14 PM »
It's a buffer overflow error that was used primarily for strings, and is apparently being wrongly used in this context.

STREAMOUT produces that error when you are overflowing the outbound stream buffer, which I think is 1k. Chunk it.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Clarification of error message needed
« Reply #2 on: August 25, 2019, 03:40:54 PM »
I'm already chunking at 1,000 bytes. I'll try reducing it to see what changes. The weird thing is that it's sporadic though. I'd have thought that it would happen every time.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Clarification of error message needed
« Reply #3 on: August 25, 2019, 03:55:12 PM »
I'm already chunking at 1,000 bytes. I'll try reducing it to see what changes. The weird thing is that it's sporadic though. I'd have thought that it would happen every time.

Length may not be the issue, but allowing time for the queue to clear.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Andrew S

  • Hero Member
  • *****
  • Posts: 144
Re: Clarification of error message needed
« Reply #4 on: August 25, 2019, 04:37:36 PM »
Can the STREAMOUT return before the queue has been fully processed? I have a FILEREAD stage and on success I jump to a STREAMOUT stage. On success from that I jump to a stage to check the byte count and then if necessary jump back to the FILEREAD stage.

I can put a timer in to delay the loop frequency if necesssary.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6176
  • Yes Pinky, Do-more will control the world!
Re: Clarification of error message needed
« Reply #5 on: August 25, 2019, 04:54:55 PM »
Can the STREAMOUT return before the queue has been fully processed? I have a FILEREAD stage and on success I jump to a STREAMOUT stage. On success from that I jump to a stage to check the byte count and then if necessary jump back to the FILEREAD stage.

I can put a timer in to delay the loop frequency if necesssary.

It's a little more complicated than it might seem. The STREAMOUT instruction interacts with the TCP device which interacts with the IP stack which interacts with the Ethernet hardware. The instruction returns that error when the underlying buffer can't take the full request, but there is more downstream involved.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO