Long-running ping command leads to 100% CPU usage

Bug #1697646 reported by Etienne Papegnies
54
This bug affects 12 people
Affects Status Importance Assigned to Milestone
iputils (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Since I've updated my laptop to Ubuntu MATE 17.04, I notice ping sometimes gets into a runaway mode.

I'm on a shaky Wi-Fi so to monitor connectivity I usually have a long running ping command against google's DNS server:

> ping -s16 8.8.4.4

Often, after leaving it for a while, I notice screaming vents and htop then shows the ping process consuming 100% of one CPU. It will stay like that until ping is killed.

I'm not sure how to troubleshoot this issue, can someone recommend a protocol?

ProblemType: Bug
DistroRelease: Ubuntu 17.04
Package: iputils-ping 3:20161105-1ubuntu2
ProcVersionSignature: Ubuntu 4.10.0-22.24-generic 4.10.15
Uname: Linux 4.10.0-22-generic x86_64
ApportVersion: 2.20.4-0ubuntu4.1
Architecture: amd64
Date: Tue Jun 13 11:11:26 2017
InstallationDate: Installed on 2017-04-05 (69 days ago)
InstallationMedia: Ubuntu-MATE 17.04 "Zesty Zapus" - Beta amd64 (20170321.1)
SourcePackage: iputils
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Etienne Papegnies (etienne-papegnies) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in iputils (Ubuntu):
status: New → Confirmed
Revision history for this message
Santiago Gala (sgala) wrote :
Download full text (3.6 KiB)

This happens (or used to happen) also in 16.04.2 (current). I paste here a couple of evidences (17.04):

$ ps auxwww | grep ping
sgala 12545 96.5 0.0 20592 1020 pts/2 R+ 13:18 118:36 ping 192.168.25.96
(...)

$ sudo strace -p 12545
(...)
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
recvmsg(3, 0x7ffe0a5d0b00, MSG_DONTWAIT) = -1 EAGAIN (Resource temporarily unavailable)
poll([{fd=3, events=POLLIN|POLLERR}], 1, 164) = 1 ([{fd=3, revents=POLLERR}])
(...)

The ping is taking 100% CPU. After I killed the process, one can see that the command line was a plain "ping 192.168.25.96"

About ping version:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=17.04
DISTRIB_CODENAME=zesty
DISTRIB_DESCRIPTION="Ubuntu 17.04"
$ dpkg -l $(dpkg-query -S $(which ping) | awk -F: '{print $1}')
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=================================-=====================-=====================-=======================================================================
ii iputils-ping 3:20161105-1ubuntu2 amd64 Tools to test the reachability of network hosts

I have also seen this going on with Ubuntu 16.04.2 LTS fully patched. I use something like ((ping -i 60 -B [address] >& /dev/null )&)& as a poor man's keepalive, and it jumps systematically to 100% CPU after one or two days.

Versions for 16.04.2:
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.2 LTS"
$ dpkg -l $(dpkg-query -S $(which ping) | awk -F: '{print $1}')
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name Version Architecture Description
+++-=======...

Read more...

Revision history for this message
Fabian Nitsche (pabian) wrote :
Norbert (nrbrtx)
tags: removed: zesty
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.