https://bugzilla.novell.com/show_bug.cgi?id=469342
Summary: avahi-daemon eats all CPU-time, caused by libdaemon0
Classification: openSUSE
Product: openSUSE 11.1
Version: Final
Platform: Other
OS/Version: Other
Status: NEW
Severity: Critical
Priority: P5 - None
Component: Basesystem
AssignedTo: seife@novell.com
ReportedBy: sbrabec@novell.com
QAContact: qa@suse.de
CC: bnc-team-gnome@forge.provo.novell.com
Found By: ---
From: Stefan
Subject: patch-proposal: opensuse 11.1: avahi-daemon eats all CPU-time, caused
by libdaemon0
Date: Thu, 15 Jan 2009 00:09:16 +0100
Hi folks!
On opensuse 11.1:
No Avahi daemon is running. If I start it at command-line
with
etc/init.d/avahi-daemon start
or simply with
avahi-daemon -D
then the avahi-daemon eats all CPU-time.
Stracing the process shows, that it loops endlessly in
gettimeofday({1231956423, 692711}, NULL) = 0
gettimeofday({1231956423, 692735}, NULL) = 0
poll([{fd=5, events=POLLIN}, {fd=15, events=POLLIN}, \
{fd=14, events=POLLIN}, {fd=13, events=POLLIN}, \
{fd=12, events=POLLIN}, {fd=11, events=POLLIN}, \
{fd=10, events=POLLIN}, {fd=8, events=POLLIN}], 8, 62150) = 1 \
([{fd=5, revents=POLLNVAL}])
The fd=5 is a BADFD.
I found out that the fd was closed by daemon_retval_send() from libdaemon.
(But: I think avahi-daemon should handle the POLLERR nevertheless.)
Looking in libdaemon I found, that the library had already closed the fd=5
in daemon_close_all(), and closed it "again" as _daemon_retval_pipe[0] in
daemon_retval_send() -> daemon_retval_done(), but in the meantime, this
is an fd from the application, not from the library. I think, after closing
_daemon_retval_pipe[0] in daemon_close_allv() the fd must be marked as closed.
I have attached a patch. For me it works fine.
BTW: The headerfile says to daemon_close_all(): "FDs 0, 1, 2 will be kept open
anyway."
But I see, fd 3 is kept open as well.
For Suse:
For a fix, you should rebase to version 0.13 of libdaemon0, since the version
in
opensuse 11.1 (0.12-30.13) has even more errors:
The except-list in daemon_close_all(int except_fd,...) is ignored,
and the program could be aborted. I have attached a demo xxx.c for reproducing
this behaviour. Compile it with
cc -g xxx.c -o xxx -ldaemon
and see with
strace -f ./xxx
what happens: all fd are closed, and the child aborts.
Best regards
stefan
From: Stefan
Subject: Re: patch-proposal: opensuse 11.1: avahi-daemon eats all CPU-time,
caused by libdaemon0
Date: Thu, 15 Jan 2009 00:09:16 +0100
I wrote:
The except-list in daemon_close_all(int except_fd,...) is ignored,
and the program could be aborted. I have attached a demo xxx.c for
reproducing this behaviour. Compile it with
cc -g xxx.c -o xxx -ldaemon
and see with
strace -f ./xxx
what happens: all fd are closed, and the child aborts.
My error, I forgot the -1 at the end of except_fd list, then the program does
not abort,
but the fds are closed.
Best regards
stefan
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.