Skip to content

[AI Generated] BugFix: iperf3 force source build for versions >= 3.14 to avoid UDP segfault#4445

Open
Gnandeep99 wants to merge 1 commit into
mainfrom
bugfix/iperf3-udp-segfault-handling_280426_155802
Open

[AI Generated] BugFix: iperf3 force source build for versions >= 3.14 to avoid UDP segfault#4445
Gnandeep99 wants to merge 1 commit into
mainfrom
bugfix/iperf3-udp-segfault-handling_280426_155802

Conversation

@Gnandeep99
Copy link
Copy Markdown
Collaborator

@Gnandeep99 Gnandeep99 commented Apr 29, 2026

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

Image Result
canonical ubuntu-24_04-lts server 24.04.202404230 PASSED

Copilot AI review requested due to automatic review settings April 29, 2026 15:07
@Gnandeep99 Gnandeep99 changed the title Bugfix/iperf3 udp segfault handling 280426 155802 iperf3: force source build for versions >= 3.14 to avoid UDP segfault (Bug #51331262) Apr 29, 2026
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 clone to the intended iperf3 source ref and improve JSON parsing failure handling with a LisaException.
  • Use host.connection_info["address"] (effective address) instead of host.public_address when 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.

Comment thread lisa/tools/iperf3.py Outdated
Comment on lines +74 to +76
# 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.
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread lisa/tools/iperf3.py Outdated
Comment on lines +74 to +76
# 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.
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# 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.

Copilot uses AI. Check for mistakes.
Comment thread lisa/tools/iperf3.py
Comment on lines +631 to +632
f"Failed to parse iperf3 JSON output. "
f"Raw output (first 500 chars): {result[:500]}"
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Suggested change
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]}"

Copilot uses AI. Check for mistakes.
Comment on lines 191 to 195
# 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,
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment on lines 250 to 254
# setup connection to nested vm
host_address = host.connection_info["address"]
connection_info = schema.ConnectionInfo(
address=host.public_address,
address=host_address,
port=port,
Copy link

Copilot AI Apr 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@Gnandeep99 Gnandeep99 changed the title iperf3: force source build for versions >= 3.14 to avoid UDP segfault (Bug #51331262) iperf3: force source build for versions >= 3.14 to avoid UDP segfault Apr 29, 2026
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

1 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 1
❌ Failed 0
⏭️ Skipped 0
Total 1
Test case details
Test Case Status Time (s) Message
verify_nested_kvm_basic (lisa_0_0) ✅ PASSED 270.072

@Gnandeep99 Gnandeep99 force-pushed the bugfix/iperf3-udp-segfault-handling_280426_155802 branch from f690e60 to 319a91f Compare April 29, 2026 15:50
Copilot AI review requested due to automatic review settings April 29, 2026 16:05
@Gnandeep99 Gnandeep99 force-pushed the bugfix/iperf3-udp-segfault-handling_280426_155802 branch from 319a91f to 33c3437 Compare April 29, 2026 16:05
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

4 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 1
Total 4
Test case details
Test Case Status Time (s) Message
verify_sriov_interrupts_change (lisa_0_3) ✅ PASSED 223.167
verify_sriov_ethtool_offload_setting (lisa_0_1) ⏭️ SKIPPED 0.000 deployment skipped: awaitable resource 'vm size' is not enough. . AllocationFailed: Allocation failed. We do not have su
verify_irqbalance (lisa_0_2) ✅ PASSED 326.303
verify_device_statistics (lisa_0_0) ✅ PASSED 326.443

@Gnandeep99 Gnandeep99 changed the title iperf3: force source build for versions >= 3.14 to avoid UDP segfault [AI Generated] BugFix: iperf3 force source build for versions >= 3.14 to avoid UDP segfault Apr 29, 2026
@Gnandeep99 Gnandeep99 force-pushed the bugfix/iperf3-udp-segfault-handling_280426_155802 branch from 33c3437 to edabc9c Compare April 30, 2026 00:35
@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

4 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 3
❌ Failed 0
⏭️ Skipped 1
Total 4
Test case details
Test Case Status Time (s) Message
verify_sriov_interrupts_change (lisa_0_3) ✅ PASSED 217.526
verify_irqbalance (lisa_0_2) ✅ PASSED 317.981
verify_sriov_ethtool_offload_setting (lisa_0_1) ⏭️ SKIPPED 0.000 deployment skipped: awaitable resource 'vm size' is not enough. . AllocationFailed: Allocation failed. We do not have su
verify_device_statistics (lisa_0_0) ✅ PASSED 319.760

@LiliDeng
Copy link
Copy Markdown
Collaborator

LiliDeng commented May 6, 2026

@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.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread lisa/tools/iperf3.py
Comment on lines +133 to +141
# 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
@Gnandeep99 Gnandeep99 force-pushed the bugfix/iperf3-udp-segfault-handling_280426_155802 branch from edabc9c to aa5f4e7 Compare May 11, 2026 02:12
@Gnandeep99
Copy link
Copy Markdown
Collaborator Author

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.
I realized there was no log message explaining this decision, which made it look like the version check never ran. I've just pushed an update that adds a debug log when the installed version is checked and found safe.

Could you give it another run when you get a chance? The logs should now make it clear the check is working.
Thanks!

@github-actions
Copy link
Copy Markdown

✅ AI Test Selection — PASSED

4 test case(s) selected (view run)

Marketplace image: canonical 0001-com-ubuntu-server-jammy 22_04-lts-gen2 latest

Count
✅ Passed 4
❌ Failed 0
⏭️ Skipped 0
Total 4
Test case details
Test Case Status Time (s) Message
verify_device_statistics (lisa_0_0) ✅ PASSED 323.061
verify_sriov_interrupts_change (lisa_0_3) ✅ PASSED 237.569
verify_sriov_ethtool_offload_setting (lisa_0_1) ✅ PASSED 289.509
verify_irqbalance (lisa_0_2) ✅ PASSED 338.619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants