Skip to content

tests(sharness): socat version #10682

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

Closed
3 tasks done
guillaumemichel opened this issue Jan 29, 2025 · 2 comments · Fixed by #10683
Closed
3 tasks done

tests(sharness): socat version #10682

guillaumemichel opened this issue Jan 29, 2025 · 2 comments · Fixed by #10683
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@guillaumemichel
Copy link
Contributor

guillaumemichel commented Jan 29, 2025

Checklist

Installation method

built from source

Version

ipfs version 0.34.0-dev

Config

not relevant

Description

Following 3c9cc3f, sharness tests are failing in CI.

I have tried to run them locally and they also fail for the same tests. I have isolated the problem as coming from socat. The sharness tests are passing fine with socat 1.7.4.4, but not with socat 1.8.0.0 and above. There are just 4 tests using socat that are failing, the rest of the sharness tests using socat are passing.

IIUC after 3c9cc3f, we use a more recent ubuntu image in the CI, which comes with socat 1.8.0.0. Before the ubuntu image was probably shipped with an older socat.

I tried to specify the version when installing socat as a dependency, but it didn't work, probably because versions prior to 1.8.0.0 are tagged as unstable by ubuntu noble (ubuntu:latest).

Failures are reported for socat 1.8.0.0, but apparently they were fixed in 1.8.0.1. I am running the latest 1.8.0.2 and the tests still failed. There was probably a change of behaviour between socat 1.7.4.4 and socat 1.8.0.0.

When trying to debug I got the following outputs when running the command with both socat versions in the according test

socat -d -d - tcp:localhost:$SWARM_PORT,connect-timeout=1 >swarmnc <../t0060-data/mss-plaintext

1.7.4.4 (SUCCESSFUL):
2025/01/29 13:00:45 socat[174418] N reading from and writing to stdio
2025/01/29 13:00:45 socat[174418] N opening connection to AF=2 127.0.0.1:40201
2025/01/29 13:00:45 socat[174418] N starting data transfer loop with FDs [0,1] and [9,9]
2025/01/29 13:00:45 socat[174418] N socket 1 (fd 0) is at EOF
2025/01/29 13:00:45 socat[174418] W read(9, 0x5747a4d95000, 8192): Connection reset by peer
2025/01/29 13:00:45 socat[174418] N socket 2 to socket 1 is in error
2025/01/29 13:00:45 socat[174418] N socket 2 (fd 9) is at EOF
2025/01/29 13:00:45 socat[174418] N exiting with status 0

1.8.0.2 (FAILURE):
2025/01/29 13:01:04 socat[175148] N reading from and writing to stdio
2025/01/29 13:01:04 socat[175148] N opening connection to AF=2 127.0.0.1:36491
2025/01/29 13:01:04 socat[175148] N starting data transfer loop with FDs [0,1] and [9,9]
2025/01/29 13:01:04 socat[175148] N write(9, 0x5a0e4ce8f000, 38) completed
2025/01/29 13:01:04 socat[175148] N socket 1 (fd 0) is at EOF
2025/01/29 13:01:04 socat[175148] N write(1, 0x5a0e4ce8f000, 20) completed
2025/01/29 13:01:04 socat[175148] N write(1, 0x5a0e4ce8f000, 18) completed
2025/01/29 13:01:04 socat[175148] N write(1, 0x5a0e4ce8f000, 79) completed
2025/01/29 13:01:04 socat[175148] E read(9, 0x5a0e4ce8f000, 8192): Connection reset by peer
2025/01/29 13:01:04 socat[175148] N exit(1)

The newer version is making more write. Also 1.7.4.4 has a warning W on connection reset by peer, where as 1.8.0.2 has an error E. I didn't find what is the cause of this change. 1.7.4.4 is probably ending on a FIN and 1.8.0.2 on a RST.

It seems like the quick fix is to install socat 1.7.4.4 from source in sharness.yml. Any cleaner suggestions are welcome.

cc: @galargh

@guillaumemichel guillaumemichel added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 29, 2025
@galargh
Copy link
Contributor

galargh commented Jan 29, 2025

3c9cc3f is not exactly relevant here. It just happened to coincide with the changes to the base images used on self-hosted runners.

Last weekend, we transitioned from using Ubuntu 22.04 to 24.04 on self-hosted runners. A similar change on GitHub hosted runners (ubuntu-latest label), happened earlier in the month.

I was able to make the sharness tests pass again on 24.04 by passing the -s option to socat. I created a PR with that change here: #10683

Let me know if that works for you 😄

@guillaumemichel
Copy link
Contributor Author

That's perfect, thanks a lot @galargh!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants