Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UDP driver errno 22: Invalid Argument #3127

Open
zimri-leisher opened this issue Jan 13, 2025 · 2 comments · May be fixed by #3143
Open

UDP driver errno 22: Invalid Argument #3127

zimri-leisher opened this issue Jan 13, 2025 · 2 comments · May be fixed by #3143
Labels
bug High Priority High Priority issue that needs to be resolved. need-to-reproduce F´  developers need to reproduce.

Comments

@zimri-leisher
Copy link
Collaborator

F´ Version 3.5.1
Affected Component Udp

Problem Description

When trying to send to a UDP port with the Udp component, we are seeing errno 22 raised (invalid argument)

The driver is being configured like so:

instance x: Drv.Udp base id 0x1234 {
    phase Fpp.ToCpp.Phases.configComponents """
    x.configureSend(ip_c_str, port_int, 0, UDP_TIMEOUT_US);
    x.open();
    """

    phase Fpp.ToCpp.Phases.tearDownComponents """
    x.stop();
    x.join();
    """
}

From internal testing, we have validated that the data we are passing to the send port is a valid... Unsure what could be causing this.

Context / Environment

Execute fprime-util version-check and share the output.

Operating System: Linux
CPU Architecture: x86_64
Platform: Linux-5.15.133.1-microsoft-standard-WSL2-x86_64-with-glibc2.35
Python version: 3.10.12
CMake version: 3.22.1
Pip version: 22.0.2
Pip packages:
    fprime-tools==3.5.1
    fprime-gds==3.5.1
    fprime-fpp-*==2.2.1
Project submodules:
@LeStarch LeStarch added need-to-reproduce F´  developers need to reproduce. High Priority High Priority issue that needs to be resolved. labels Jan 15, 2025
LeStarch added a commit to LeStarch/fprime that referenced this issue Jan 16, 2025
@LeStarch LeStarch linked a pull request Jan 16, 2025 that will close this issue
13 tasks
@LeStarch
Copy link
Collaborator

@zimri-leisher I did find a bug with UDP. It would not work in send only mode because of an unguarded call to bind. I've corrected this.

I was not able to reproduce your exact error, but I also was relying on auto-connect, not an explicit call to open.

You did catch another critical detail, which is that configureSend must be called in the configure phase, not in the thread start phase. Good catch!

@zimri-leisher
Copy link
Collaborator Author

Awesome, that seems like it could be the fix. The exact error I had could be OS specific.
Glad I was able to catch that!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug High Priority High Priority issue that needs to be resolved. need-to-reproduce F´  developers need to reproduce.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants