Comments (13)
I'm not going to be clever - will change our packetisation to 1024 bytes and be done with it. I guess the solution on the C# side would be a slight delay from reading the size to the full stream to ensure all the packets have landed but reducing our write size just guarantees future success with the same behaviour.
Hooray for integration testing managing to dig this up again!
from g-cli.
Comment from James:
The size out of range error is that we have tried to read the wrong number of bytes from the network stream. This could be: a) LabVIEW sends a zero or negative size or b) LabVIEW sends a size that is too large or c) We have had an unclean read previously which means we read the wrong data.
With the other problems as well I am slightly inclined towards c) (a) should be impossible and the code to handle b) seems robust). Do you know if you could ever write an empty output string? I’m looking at the code and thinking that could cause a problem. Alternatively do you commonly write strings of 8992 bytes or larger?
from g-cli.
I think I’m writing too much data in one chunk - 17000 characters in this case. I go through all VI Analyzer test results and print out any VI that failed, together with the name of the test that failed. Depending on how many VIs fail, this string can become fairly long. I’ll move the CLI write function into the loop iterating through the results, that should fix the problem at hand.
from g-cli.
Comment from James:
That’s interesting. Please try the new version before making your change because it should give more information on the fault. I believed that case should be correctly handled (if you look in the write function in LabVIEW I automatically break it out to 8992 chunks which is the max size the CLI app can use at once)
from g-cli.
So the new version 1.5.1 does give a better message for this error:
C:\Multi-Runner\builds\df1e0484\0\hampel-soft\cmdRead Error
: Bad Length Read: 1548580204
Since the network stream will be out of sync the application will now exit.
LabVIEW/App exiting...
LabVIEW exited with code 0
process tracking thread finished
ERROR: Job failed: exit status 1
I'm still at a loss as to why the error occurs in the first place?
from g-cli.
Can you save the output you are trying to write to a file so I can test it and see if there is something specific to the output (email privately if you prefer?) I can generate 17000 random characters without issue and it all works.
from g-cli.
Email is on its way. Its size is 18.682 Bytes.
from g-cli.
Do you remember if this was as an exe or VI? Just seen a similar error when running code as EXE which works fine as VI
from g-cli.
Scratch that, it isn't so simple.
I've written some integration tests as a batch file (since we need some test coverage to avoid bugs if we change how we launch LV). This was showing the same failure on a large output from an EXE. However the error is sporadic. Whats the money that as soon as I try to debug it then it works!
from g-cli.
I saw that error when running the VIs in the development environment (triggered automatically on my build server). As you already know, I also couldn't reproduce the behaviour...
from g-cli.
Well, of course now I have a packet sniffer it won't crash again! Will have it automatically try for the afternoon to see if I can catch it in the act.
from g-cli.
So, here is what I have found from a packet capture. The issue is in the middle of the block from a single TCP write in LabVIEW.
Each write can contain 9000 characters. The idea being this is a multiple of a standard 1500 byte MTU (I now see that to be flawed).
When this is written the driver splits this to several 1460 byte (1500 - header?) packets. What has happened in my case is that only the first few packets are read and then it attempts to read one of these packets as a new header which is where it gets the rediculous read.
I guess the TCP read in C# is not waiting for all of the packets. The simple solution will be to split down the packet sizes in LabVIEW to below 1460 bytes. I will investigate if this is a C# issue though so we don't break it again in the future
from g-cli.
Hell to the yeah ;-)
from g-cli.
Related Issues (20)
- Start-cli argument parsing off 1 index for port when running an LV exe HOT 5
- Better Powershell Integration
- Duplicate messages when LabVIEW crashes (Comms Error: Unexpected EOF Error)
- g-cli did not show any warnings or errors when using the deprecated (2.x) `--timeout` argument HOT 1
- Set LabVIEW Version With Environmental Variable
- *relative* paths to VIs inside of PPLs does not work (on Linux at least) HOT 1
- Kill LabVIEW Command Doesn't Work on Linux HOT 4
- Add an `--exit` argument for LabVIEW to exit after completion of cmd HOT 3
- Handle Missing NI Registry Keys
- Get Option Value.vi should return 'option type' HOT 1
- Add Cache or Pre Build to Linux Dev Container
- Exception during registry scan for active lv version HOT 1
- Multi-Instance Environments Could Kill the Wrong Instance
- Linux doesn't detach from LabVIEW process
- g-cli in Linux hangs if called from an SSH session HOT 2
- lvBuild missing in VIP HOT 1
- Testing with G-CLI HOT 4
- Memory Allocation Errors - Improved Error Checking?
- UNC Paths Fail To Launch
- Timed out waiting for app to connect to g-cli HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from g-cli.