[AI Generated] BugFix: iperf3 force source build for versions >= 3.14 to avoid UDP segfault#4445
[AI Generated] BugFix: iperf3 force source build for versions >= 3.14 to avoid UDP segfault#4445Gnandeep99 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Pull request overview
Updates LISA’s iperf3 tool installation logic to avoid a known UDP segfault in newer distro-packaged iperf3 versions, and adjusts nested VM connection setup to respect the effective host connection address (honoring use_public_address).
Changes:
- Detect installed iperf3 version and force a source build from a known-good ref when the installed version is in the reported UDP-segfault range.
- Pin
git cloneto the intended iperf3 source ref and improve JSON parsing failure handling with aLisaException. - Use
host.connection_info["address"](effective address) instead ofhost.public_addresswhen connecting to nested VMs.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| lisa/tools/iperf3.py | Adds iperf3 version detection and conditional source rebuild; pins clone ref; improves JSON parse failure error handling. |
| lisa/microsoft/testsuites/nested/common.py | Uses the host’s effective connection address for nested VM connectivity to respect use_public_address. |
| # iperf3 versions 3.14+ have a known segfault in UDP mode with high | ||
| # parallelism (-P 64+). Force a source build from _branch when the | ||
| # distro-installed version falls in this buggy range. |
There was a problem hiding this comment.
The PR template description is empty. Please add a description explaining what this PR does and why, and (if applicable) link the related issue for traceability.
| # iperf3 versions 3.14+ have a known segfault in UDP mode with high | ||
| # parallelism (-P 64+). Force a source build from _branch when the | ||
| # distro-installed version falls in this buggy range. |
There was a problem hiding this comment.
The comment about the "known UDP segfault" would be more actionable if it referenced an upstream issue/commit (or internal tracking link) and, if known, the version where it is fixed. This helps future maintainers validate whether the forced downgrade is still necessary.
| # iperf3 versions 3.14+ have a known segfault in UDP mode with high | |
| # parallelism (-P 64+). Force a source build from _branch when the | |
| # distro-installed version falls in this buggy range. | |
| # iperf3 versions >= 3.14.0 have been observed to segfault in UDP mode | |
| # with high parallelism (-P 64+), so versions in that range are replaced | |
| # with a source build from _branch. When the upstream issue/commit and the | |
| # first fixed release are confirmed, record them here and remove or narrow | |
| # this workaround only after validating that fixed version in LISA. |
| f"Failed to parse iperf3 JSON output. " | ||
| f"Raw output (first 500 chars): {result[:500]}" |
There was a problem hiding this comment.
This exception message explains what happened, but it doesn’t give a next step to investigate/resolve. Consider mentioning common causes (e.g., iperf3 crash/segfault or non-JSON output because -J wasn’t used) and what to check (exit code, iperf3 version, full stdout/stderr/logfile).
| f"Failed to parse iperf3 JSON output. " | |
| f"Raw output (first 500 chars): {result[:500]}" | |
| "Failed to parse iperf3 JSON output. " | |
| "This usually means iperf3 produced non-JSON output, such as " | |
| "running without JSON mode enabled, a crash/segfault, or truncated " | |
| f"output. Verify the iperf3 command used JSON output and inspect the " | |
| f"full stdout/stderr or logfile for errors. Raw output (first 500 " | |
| f"chars): {result[:500]}" |
| # Use the host's connection address which respects use_public_address setting. | ||
| host_address = host.connection_info["address"] | ||
| connection_info = schema.ConnectionInfo( | ||
| address=host.public_address, | ||
| address=host_address, | ||
| port=guest_port, |
There was a problem hiding this comment.
To match the established pattern elsewhere in the repo, consider indexing connection_info with constants.ENVIRONMENTS_NODES_REMOTE_ADDRESS instead of the string literal "address". This avoids typos and keeps key usage consistent.
| # setup connection to nested vm | ||
| host_address = host.connection_info["address"] | ||
| connection_info = schema.ConnectionInfo( | ||
| address=host.public_address, | ||
| address=host_address, | ||
| port=port, |
There was a problem hiding this comment.
To match the established pattern elsewhere in the repo, consider indexing connection_info with constants.ENVIRONMENTS_NODES_REMOTE_ADDRESS instead of the string literal "address". This avoids typos and keeps key usage consistent.
✅ AI Test Selection — PASSED1 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
f690e60 to
319a91f
Compare
319a91f to
33c3437
Compare
✅ AI Test Selection — PASSED4 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
33c3437 to
edabc9c
Compare
✅ AI Test Selection — PASSED4 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
|
@Gnandeep99 please double check the logic, I ran case perf_tcp_iperf_sriov + canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest, I saw the iperf version is 3.9 and the iperf was not upgraded. |
| # iperf3 >= 3.14 segfaults in UDP mode with high parallelism. | ||
| # Force a source build from a known-good version. | ||
| version = self.get_version() | ||
| if version and version >= self._buggy_version_min: | ||
| self._log.info( | ||
| f"iperf3 {version} has known UDP segfault, " | ||
| f"rebuilding from source ({self._branch})" | ||
| ) | ||
| install_from_src = True |
… to avoid UDP segfault
edabc9c to
aa5f4e7
Compare
|
Hi @LiliDeng, thanks for testing this! The behavior you saw is actually expected, iperf3 3.9 is below the 3.14 threshold, so the fix intentionally leaves it as-is. Could you give it another run when you get a chance? The logs should now make it clear the check is working. |
✅ AI Test Selection — PASSED4 test case(s) selected (view run) Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest
Test case details
|
Summary
Force source build of iperf3 from tag 3.10.1 when the distro-installed version is >= 3.14, which has a known segfault in UDP mode with high parallelism (-P 64+). Also passes ref to git.clone() and replaces bare assert with LisaException for better diagnostics.
Validation Results