noushi/iperf-ssm

nanosleep too long can fail with "Invalid argument"

Closed this issue · 4 comments

$ iperf-ssm/src/iperf --client 232.43.211.200 --udp --ttl 30 --bandwidth 1K --bind 192.168.122.1 --len 125 --time 900

Client connecting to 232.43.211.200, UDP port 5001
Binding to local address 192.168.122.1
Sending 125 byte datagrams
Setting multicast TTL to 30
UDP buffer size: 208 KByte (default)

nanosleep failed: Invalid argument
[ 3] local 192.168.122.1 port 5001 connected with 232.43.211.200 port 5001
nanosleep failed: Invalid argument
nanosleep failed: Invalid argument
nanosleep failed: Invalid argument
nanosleep failed: Invalid argument
nanosleep failed: Invalid argument
...

(The invalid argument continues, spinning very quickly.)

This was observed on ubuntu 14.04:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04.5 LTS
Release: 14.04
Codename: trusty

@GrumpyOldTroll Thanks for the report and PR!
I'll check this when I can.

mabra commented

The same for me, but only using a loop on one of the local interfaces.
(Wanted to see the speed of the hardware).
Linux matrix 3.16.0-4-amd64 #1 SMP Debian 3.16.39-1 (2016-12-30) x86_64 GNU/Linux
Distributor ID: Debian
Description: Debian GNU/Linux 8.7 (jessie)
Release: 8.7
Codename: jessie
HW: Supermicro.A1SRM-2758F
iperf version 2.0.5 (08 Jul 2010) pthreads [using Stretch/stable]
I would provide more info, if I one let me know.

@mabra, I've merged @GrumpyOldTroll 's PR after some testing, and it works great!
Could you please test on your system?
Thank you both!

Fixed by PR #2