SCTP interval reporting prints an uninitialized retransmit value

Open
#2,086 10 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 2 days

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
c
Domain
networking

Research direction

Reproduce the issue with iperf3 -s and iperf3 -c localhost --sctp -V -t 5, then inspect iperf_stats_callback and the SCTP reporting branch where temp.interval_retrans is left unset. Determine the intended SCTP retransmit and header values, and verify that interval output no longer contains uninitialized data while preserving correct reporting.

Written by the indexing model from the issue text.

Description

Hi, when I run iperf3 -s in one window and iperf3 -c localhost --sctp -V -t 5 in another, I get the following:

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-1.00   sec  1.08 GBytes  9.24 Gbits/sec  140615631915280   96.1 KBytes
[  5]   1.00-2.00   sec  1.09 GBytes  9.32 Gbits/sec  140615631915280   96.1 KBytes
[  5]   2.00-3.00   sec  1.06 GBytes  9.10 Gbits/sec  140615631915280   96.1 KBytes
[  5]   3.00-4.00   sec  1.13 GBytes  9.70 Gbits/sec  140615631915280   96.1 KBytes
[  5]   4.00-5.00   sec  1.17 GBytes  10.1 Gbits/sec    0    104 KBytes

The 140615631915280 is clearly incorrect here. This apparently happens because temp.interval_retrans (in iperf_stats_callback) is not initialized, and the sctp branch never sets it.

Zeroing temp.interval_retrans fixes the issue*, though I'd consider something like memset(&temp, 0, sizeof(temp)) to make it more robust.

*) It fixes the uninitialized memory, but it will always report 0, which is not exactly correct. Also, the table header seems to be missing some values? I did not look into that further, though.

Dominant language
C
Stars
8.9k
Forks
1.5k
Avg merge
5d 11h
Merged PRs (30d)
2

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from esnet/iperf

All issues in esnet/iperf

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.