Bug 148384

Summary: restarting acpid makes X consume 100% cpu
Product: [openSUSE] SUSE Linux 10.1 Reporter: Forgotten User ZhJd0F0L3x <forgotten_ZhJd0F0L3x>
Component: X.OrgAssignee: Stefan Dirsch <sndirsch>
Status: RESOLVED FIXED QA Contact: Stefan Dirsch <sndirsch>
Severity: Critical    
Priority: P5 - None CC: eich, suse-beta, trenn
Version: Beta 3   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: Component Test Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: xorg.conf
xorg.log.old
fix

Description Forgotten User ZhJd0F0L3x 2006-02-06 13:59:01 UTC
if i restart, X seems to go into an endless loop, consuming 100% cpu.
It is easily reproducible on all my machines.
Comment 1 Stefan Dirsch 2006-02-06 14:00:36 UTC
Seife, what about config and logfile? :-)
Comment 2 Forgotten User ZhJd0F0L3x 2006-02-06 16:24:24 UTC
Created attachment 66567 [details]
xorg.conf
Comment 3 Forgotten User ZhJd0F0L3x 2006-02-06 16:25:22 UTC
Created attachment 66568 [details]
xorg.log.old

does this mean that you cannot reproduce it?
Comment 4 Forgotten User ZhJd0F0L3x 2006-02-06 17:22:52 UTC
Probably the culprit is:

- acpid starts first
- X server connects to the acpid socket.
- when acpid is restarted, the socket is stale
  => select on the stale socket always returns immediately
  => read from the socket fails.

X should now disconnect the stale socket and reconnect to acpid (and probably retry with a some-second timeout if acpid is not available immediately).
Comment 5 Stefan Dirsch 2006-02-06 17:26:52 UTC
Hmm ... why is acpid restarted?
Comment 6 Stefan Dirsch 2006-02-06 18:16:31 UTC
Oops. I think I can reproduce this.
Comment 7 Forgotten User ZhJd0F0L3x 2006-02-06 18:20:06 UTC
(In reply to comment #5)
> Hmm ... why is acpid restarted?

rpm -hUv acpid.rpm 

Comment 8 Thomas Renninger 2006-02-06 19:12:23 UTC
IIRC Egbert has added acpid functionality to X, at this point this must be caught.
The acpid cannot make the X server not going in an endless loop.

Just an idea, how much sense would it make to let the X-server talk dbus to get the events?
Probably not much as the service comes up quite late?
Comment 9 Stefan Dirsch 2006-02-06 19:16:21 UTC
AFAIK Alan Hourihane added it. Matthias will try to have a look at it during
the X.Org conference. IMHO this is *not* a blocker. Setting to CRITICAL.
Comment 10 Stefan Dirsch 2006-02-06 21:06:55 UTC
Assigning to Matthias ...
Comment 11 Egbert Eich 2006-02-14 12:53:05 UTC
Hm, this should be easy to fix - if I can set up a system to reproduce it.
Will give it a try.
Comment 12 Stefan Dirsch 2006-02-14 14:04:06 UTC
Should be pretty easy on 10.1. acpid must be active before Xserver has been started (default). Then kill acpid during an Xsession and have a look at top/ps. :-)

Egbert, I'll assign this to you.
Comment 13 Egbert Eich 2006-02-15 19:01:45 UTC
Created attachment 68704 [details]
fix

This patch fixes the problem. Not pretty but the APM functions were not designed for ACPI in the first place.
Comment 14 Stefan Dirsch 2006-02-15 20:18:08 UTC
Thanks! I'll apply the patch.
Comment 15 Stefan Dirsch 2006-02-16 03:36:30 UTC
Works fine! I add the current DEBUG output of Xserver.

#rcacpid stop

ACPI: Closing device
ACPI: trying to reopen
ACPI: Opening device
ACPI: trying to reopen
[...]
< Xserver CPU load about 5% instead of 95% before >

# rcacpid stop
(II) Open ACPI successful (/var/run/acpid.socket)
ACPI: successfully reopened
Comment 16 Stefan Dirsch 2006-02-16 03:51:21 UTC
Anyone who want test?

--> /work/built/mbuild/shannon-sndirsch-11/*/xorg-x11-server-6*.rpm

Otherwise I'll commit it with DEBUG disabled.
Comment 17 Egbert Eich 2006-02-16 08:46:46 UTC
Please do so! I forgot to turn the DEBUG stuff off. Sorry.
Comment 18 Stefan Dirsch 2006-02-16 09:48:56 UTC
submitted for STABLE.
Comment 19 Stefan Dirsch 2007-09-12 20:12:51 UTC
*** Bug 273667 has been marked as a duplicate of this bug. ***