inspircd consumes all cpu

Bug #1003196 reported by Tom Wright
18
This bug affects 4 people
Affects Status Importance Assigned to Milestone
inspircd (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

=== Ubuntu release ===

$lsb_release -rd
Description: Ubuntu 12.04 LTS
Release: 12.04

=== Version ===

$apt-cache policy inspircd
inspircd:
  Installed: 1.1.22+dfsg-4ubuntu2
  Candidate: 1.1.22+dfsg-4ubuntu2
  Version table:
 *** 1.1.22+dfsg-4ubuntu2 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/universe i386 Packages
        100 /var/lib/dpkg/status

=== What happened ===

When I ran inspircd like so:

> $inspircd --config inspircd.conf --nofork

It consumed an entire cpu (it also did this without nofork)

stracing the process with strace -p showed lots of the following

poll([{fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=4, events=POLLIN}, {fd=5, events=POLLIN}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, {fd=0, events=0}, ...], 1024, 1000) = 1 ([...])
time(NULL) = 1337733367

=== What I expected to happen ===

It not to consume an entire cpu.

=== Speculation on the cause ===

This would appear to be this bug: https://github.com/inspircd/inspircd/issues/34, which seems to have had this fix https://github.com/inspircd/inspircd/pull/62/commits (which seems like a security fix that happens to fix this bug).

This patch does not cleanly apply to the tree (however it will with minor tweaking). I'm not sure if this patch actually works because the version of inspircd shipped with pangolin does not build under pangolin due to the lack of libgnutls-config or similar.

=== Possible fix ===

Someone who can actually build inspircd on their machine might like to apply this patch and see if this fixes the problem.

Revision history for this message
Tom Wright (tat.wright) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

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

Changed in inspircd (Ubuntu):
status: New → Confirmed
Revision history for this message
theparanoidone (theparanoidone) wrote :

+1, I can confirm this report... inspircd consumes 100% cpu

Revision history for this message
theparanoidone (theparanoidone) wrote :

quoting from: https://github.com/inspircd/inspircd/issues/34

"I noticed that my inspircd would run at 100% CPU usage after being restarted. Well actually this only started after I logged out. A quick strace shows that inspircd calls poll in a loop and the result is always fd=0. lsof then shows that fd=0 is connected to the terminal I used to restart inspircd. ************ When I logged out, it was closed and poll would always return that fd. *********** The problem is worse though. This can be used to escalate privileges (from irc to root) when combined with an arbitrary code execution flaw (such as the one fixed in DSA-2448-1)."

Based upon: ... "when I logged out, it was closed and poll would always return that fd..."

POTENTIAL WORKAROUND:

I ssh'd into server as normal user:

screen
sudo /etc/init.d/inspircd restart
(enter passwd)
(ctrl-a, ctrl-d to detach)
exit

Upon logging back in, CPU usage is normal. This is obviously less than ideal... (but may be of some help for anyone running internal irc servers)

Actual long term fix still needed.

Revision history for this message
Matt Arnold (mattarnold5) wrote :

This is an issue that affects 1.1.x versions of inspircd I will backport 2.0 to precise, but there is nothing that can be done, otherwise

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.