Robert,

Please review and consider this patch to iperf to fix the segfault.
Looks like in function byte_snprintf() when calculating SUM, where SUM
is in terabyte, we go past the kLabel_Byte/kLabel_bit array limit (by
increment of conv past kConv_Giga)  and this causes iperf to segfault
because suffix is pointing past the array bounds. The attached patch
addresses this issue.

-- Before patch --
$ iperf -c 192.168.120.2 -P10 -w 130k -t 1200
------------------------------------------------------------
Client connecting to 192.168.120.2, TCP port 5001
TCP window size:  254 KByte (WARNING: requested  127 KByte)
------------------------------------------------------------
[ 12] local 192.168.120.3 port 47668 connected with 192.168.120.2 port 5001
[ 10] local 192.168.120.3 port 47664 connected with 192.168.120.2 port 5001
[ 11] local 192.168.120.3 port 47666 connected with 192.168.120.2 port 5001
[  8] local 192.168.120.3 port 47662 connected with 192.168.120.2 port 5001
[  5] local 192.168.120.3 port 47656 connected with 192.168.120.2 port 5001
[  4] local 192.168.120.3 port 47650 connected with 192.168.120.2 port 5001
[  6] local 192.168.120.3 port 47654 connected with 192.168.120.2 port 5001
[  9] local 192.168.120.3 port 47660 connected with 192.168.120.2 port 5001
[  7] local 192.168.120.3 port 47658 connected with 192.168.120.2 port 5001
[  3] local 192.168.120.3 port 47652 connected with 192.168.120.2 port 5001
 [ ID] Interval       Transfer     Bandwidth
[ 12]  0.0-1200.0 sec  73.3 GBytes   525 Mbits/sec
[ 10]  0.0-1200.0 sec   164 GBytes  1.17 Gbits/sec
[ 11]  0.0-1200.0 sec   219 GBytes  1.57 Gbits/sec
[  8]  0.0-1200.0 sec  73.3 GBytes   525 Mbits/sec
[  5]  0.0-1200.0 sec   164 GBytes  1.18 Gbits/sec
[  4]  0.0-1200.0 sec   165 GBytes  1.18 Gbits/sec
[  6]  0.0-1200.0 sec   109 GBytes   784 Mbits/sec
[  9]  0.0-1200.0 sec   165 GBytes  1.18 Gbits/sec
[  7]  0.0-1200.0 sec   109 GBytes   783 Mbits/sec
[  3]  0.0-1200.0 sec  73.3 GBytes   525 Mbits/sec
Segmentation fault (core dumped)

-- After patch --
$ src/iperf -c 192.168.120.2 -P10 -w 130k -t 1200
------------------------------------------------------------
Client connecting to 192.168.120.2, TCP port 5001
TCP window size:  254 KByte (WARNING: requested  127 KByte)
------------------------------------------------------------
[ 12] local 192.168.120.3 port 47626 connected with 192.168.120.2 port 5001
[  8] local 192.168.120.3 port 47616 connected with 192.168.120.2 port 5001
[ 10] local 192.168.120.3 port 47622 connected with 192.168.120.2 port 5001
[  3] local 192.168.120.3 port 47610 connected with 192.168.120.2 port 5001
[  9] local 192.168.120.3 port 47620 connected with 192.168.120.2 port 5001
[  4] local 192.168.120.3 port 47608 connected with 192.168.120.2 port 5001
[  7] local 192.168.120.3 port 47614 connected with 192.168.120.2 port 5001
[ 11] local 192.168.120.3 port 47624 connected with 192.168.120.2 port 5001
[  5] local 192.168.120.3 port 47612 connected with 192.168.120.2 port 5001
[  6] local 192.168.120.3 port 47618 connected with 192.168.120.2 port 5001
[ ID] Interval       Transfer     Bandwidth
[  3]  0.0-1200.0 sec   142 GBytes  1.02 Gbits/sec
[  9]  0.0-1200.0 sec   120 GBytes   862 Mbits/sec
[ 11]  0.0-1200.0 sec   121 GBytes   867 Mbits/sec
[  5]  0.0-1200.0 sec   122 GBytes   874 Mbits/sec
[ 12]  0.0-1200.0 sec   120 GBytes   856 Mbits/sec
[  8]  0.0-1200.0 sec   122 GBytes   871 Mbits/sec
[ 10]  0.0-1200.0 sec   146 GBytes  1.04 Gbits/sec
[  4]  0.0-1200.0 sec   141 GBytes  1.01 Gbits/sec
[  7]  0.0-1200.0 sec   122 GBytes   873 Mbits/sec
[  6]  0.0-1200.0 sec   143 GBytes  1.02 Gbits/sec
[SUM]  0.0-1200.0 sec  1299 GBytes  9.30 Gbits/sec


** Patch added: "fix segfault in iperf"
   
https://bugs.launchpad.net/ubuntu/+source/iperf/+bug/1771283/+attachment/5147771/+files/0001-Fix-segfault-while-calculating-sum-on-long-iperf-run.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1771283

Title:
  iperf2 long time run on 40Gb/s NIC crashes

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/iperf/+bug/1771283/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to