100% CPU usage when no data sending was possible
- Dominant language
- C
- Stars
- 8.8k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
# Context
* Version of iperf3:
git ddb1055343948e0d0bc81f8d20245f1ada6430a0
* Hardware:
x86_64
* Operating system (and distribution, if any):
Linux Fedora 33
# Bug Report
* Expected Behavior
Try to send data without 100% CPU usage.
* Actual Behavior
```
23:11:55.328447 select(6, [4], [5], NULL, {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000009>
23:11:55.328482 select(6, [4], [5], NULL, {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000009>
23:11:55.328517 select(6, [4], [5], NULL, {tv_sec=0, tv_usec=0}) = 0 (Timeout) <0.000010>
```
```
Connecting to host ping.online.net, port 5204
[ 5] local 192.168.8.107 port 15936 connected to 62.210.18.40 port 5204
[ ID] Interval Transfer Bitrate Retr Cwnd
[ 5] 0.00-1.00 sec 374 KBytes 3.06 Mbits/sec 0 46.1 KBytes
[ 5] 1.00-2.00 sec 0.00 Bytes 0.00 bits/sec 9 42.0 KBytes
[ 5] 2.00-3.00 sec 125 KBytes 1.02 Mbits/sec 12 48.8 KBytes
[ 5] 3.00-4.00 sec 249 KBytes 2.04 Mbits/sec 0 62.4 KBytes
[ 5] 4.00-5.00 sec 0.00 Bytes 0.00 bits/sec 1 1.36 KBytes
[ 5] 5.00-6.00 sec 0.00 Bytes 0.00 bits/sec 1 1.36 KBytes
[ 5] 6.00-7.00 sec 0.00 Bytes 0.00 bits/sec 1 1.36 KBytes
[ 5] 7.00-8.00 sec 0.00 Bytes 0.00 bits/sec 0 1.36 KBytes
[ 5] 8.00-9.00 sec 0.00 Bytes 0.00 bits/sec 1 1.00 KBytes
^C
Program received signal SIGINT, Interrupt.
iperf_time_diff (time1=0x6060000013bc, time2=0x7fffffffc9c0, diff=0x7fffffffc9e0) at iperf_time.c:147
147 if (diff->usecs < time1->usecs) {
```
```
(gdb) bt full
#0 iperf_time_diff (time1=0x6060000013bc, time2=0x7fffffffc9c0, diff=0x7fffffffc9e0) at iperf_time.c:147
past = 0
cmp = -1
#1 0x00007ffff752a058 in tmr_timeout (nowP=0x7fffffffca90) at timer.c:165
now = {secs = 534143, usecs = 433837}
diff = {secs = 4, usecs = 433837}
usecs = 140737342756602
past = 32767
timeout = {tv_sec = 0, tv_usec = 0}
#2 0x00007ffff750c588 in iperf_run_client (test=0x619000000080) at iperf_client_api.c:517
startup = 0
result = 0
read_set = {__fds_bits = {16, 0 }}
write_set = {__fds_bits = {32, 0 }}
now = {secs = 534143, usecs = 433837}
timeout = 0x7ffff754e000
sp = 0x0
last_receive_time = {secs = 0, usecs = 0}
diff_time = {secs = 0, usecs = 0}
used_timeout = {tv_sec = 0, tv_usec = -3412033746864764672}
t_usecs = 0
timeout_us = 0
rcv_timeout_us = 0
#3 0x0000000000401a07 in run (test=0x619000000080) at main.c:183
No locals.
#4 0x00000000004014db in main (argc=5, argv=0x7fffffffcde8) at main.c:108
test = 0x619000000080
(gdb) step
151 diff->usecs = diff->usecs - time1->usecs;
(gdb) step
152 past = 1;
(gdb) step
155 return past;
```
* Steps to Reproduce
I guess it happens when no data is sent for the last couple of seconds?
Contributor guide
Assessment
This issue has not been assessed yet.