dnsmasq lockup at 100% cpu

Bug #1313393 reported by Dave Gilbert
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
dnsmasq (Ubuntu)
Confirmed
High
Unassigned

Bug Description

I hit a case where dnsmasq was running at 100% cpu and not responding to requests.
This is a freshly installed and updated trusty VM which has just been dist-upgraded to utopic.

At boot/login it seemed OK, but then I bought up firefox and it couldn't get to it's home page, top showed dnsmasq eating cpu.
strace'ing dnsmasq showed it doing:

select(8, [0 3 6 7], [], [6], NULL) = 1 (in [0])
recvmsg(0, 0x7ffffba98110, 0) = -1 ENOTSOCK (Socket operation on non-socket)
accept(0, 0, NULL) = -1 ENOTSOCK (Socket operation on non-socket)
select(8, [0 3 6 7], [], [6], NULL) = 1 (in [0])

constantly.

fd 8 is a pipe (not sure where to - back to another thread?)

This is the dnsmasq kicked off by a default network manager setup; not changed any networking settings.

ProblemType: Bug
DistroRelease: Ubuntu 14.10
Package: dnsmasq-base 2.70-1
ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
Uname: Linux 3.13.0-24-generic x86_64
ApportVersion: 2.14.1-0ubuntu3
Architecture: amd64
CurrentDesktop: Unity
Date: Sun Apr 27 17:58:21 2014
InstallationDate: Installed on 2014-04-27 (0 days ago)
InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Daily amd64 (20140412)
SourcePackage: dnsmasq
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in dnsmasq (Ubuntu):
status: New → Confirmed
Revision history for this message
Simon Kelley (simon-thekelleys) wrote : Re: [Bug 1313393] [NEW] dnsmasq lockup at 100% cpu

This is useful, thanks. A couple of questions:

1) Is this easily reproducible?
2) Could you tell me exactly what command-line flags dnsmasq is being
started with?

Cheers,

Simon.

On 27/04/14 18:02, Dave Gilbert wrote:
> Public bug reported:
>
> I hit a case where dnsmasq was running at 100% cpu and not responding to requests.
> This is a freshly installed and updated trusty VM which has just been dist-upgraded to utopic.
>
> At boot/login it seemed OK, but then I bought up firefox and it couldn't get to it's home page, top showed dnsmasq eating cpu.
> strace'ing dnsmasq showed it doing:
>
> select(8, [0 3 6 7], [], [6], NULL) = 1 (in [0])
> recvmsg(0, 0x7ffffba98110, 0) = -1 ENOTSOCK (Socket operation on non-socket)
> accept(0, 0, NULL) = -1 ENOTSOCK (Socket operation on non-socket)
> select(8, [0 3 6 7], [], [6], NULL) = 1 (in [0])
>
> constantly.
>
> fd 8 is a pipe (not sure where to - back to another thread?)
>
> This is the dnsmasq kicked off by a default network manager setup; not
> changed any networking settings.
>
> ProblemType: Bug
> DistroRelease: Ubuntu 14.10
> Package: dnsmasq-base 2.70-1
> ProcVersionSignature: Ubuntu 3.13.0-24.46-generic 3.13.9
> Uname: Linux 3.13.0-24-generic x86_64
> ApportVersion: 2.14.1-0ubuntu3
> Architecture: amd64
> CurrentDesktop: Unity
> Date: Sun Apr 27 17:58:21 2014
> InstallationDate: Installed on 2014-04-27 (0 days ago)
> InstallationMedia: Ubuntu 14.04 LTS "Trusty Tahr" - Daily amd64 (20140412)
> SourcePackage: dnsmasq
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> ** Affects: dnsmasq (Ubuntu)
> Importance: Undecided
> Status: Confirmed
>
>
> ** Tags: amd64 apport-bug utopic
>

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi Simon,
  1) Apparently so - I just rebooted the vm to see if I could repeat it, and it was already stuck at 100% and non-responsive.
      (and blueskaj who confirmed it was seeing the same problem on irc)
  2) /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
(typed so typos are probably mine)

sudo killing the dnsmasq and then reenabling the network interface on nm gets it working again.

Revision history for this message
Simon Kelley (simon-thekelleys) wrote : Re: [Bug 1313393] Re: dnsmasq lockup at 100% cpu

On 27/04/14 18:53, Dave Gilbert wrote:
> Hi Simon,
> 1) Apparently so - I just rebooted the vm to see if I could repeat it, and it was already stuck at 100% and non-responsive.
> (and blueskaj who confirmed it was seeing the same problem on irc)
> 2) /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
> (typed so typos are probably mine)
>
> sudo killing the dnsmasq and then reenabling the network interface on nm
> gets it working again.
>

That's great, thanks. I can't reproduce this, but I have a few hunches
as to what the problem may be. If I supply you with modified code are
you in a position to compile and test it?

Cheers,

Simon.

Revision history for this message
Simon Kelley (simon-thekelleys) wrote :

On 27/04/14 18:53, Dave Gilbert wrote:
> Hi Simon,
> 1) Apparently so - I just rebooted the vm to see if I could repeat it, and it was already stuck at 100% and non-responsive.
> (and blueskaj who confirmed it was seeing the same problem on irc)
> 2) /usr/sbin/dnsmasq --no-resolv --keep-in-foreground --no-hosts --bind-interfaces --pid-file=/run/sendsigs.omit.d/network-manager.dnsmasq.pid --listen-address=127.0.1.1 --conf-file=/var/run/NetworkManager/dnsmasq.conf --cache-size=0 --proxy-dnssec --enable-dbus=org.freedesktop.NetworkManager.dnsmasq --conf-dir=/etc/NetworkManager/dnsmasq.d
> (typed so typos are probably mine)
>
> sudo killing the dnsmasq and then reenabling the network interface on nm
> gets it working again.
>

Further to my previous, another useful option would be to replace the
dnsmasq binary with a wrapper which runs is under strace and routes the
strace output to a file.

Cheers,

Simon.

Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Simon: Sure, send me stuff to test and I'm happy to run it (unusually I'm also going to be around more for the next week so I'll be able to turn it around within a day or maybe less)

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

probably related to bug #1314697

Changed in dnsmasq (Ubuntu):
importance: Undecided → High
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.