Bug 2775 - When launching MageiaUpdate, /etc/X11/X eats 80% of the CPU for more than a minute, leaving the system mostly unresponsive
Summary: When launching MageiaUpdate, /etc/X11/X eats 80% of the CPU for more than a m...
Status: RESOLVED FIXED
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: Cauldron
Hardware: i586 Linux
Priority: High major
Target Milestone: ---
Assignee: Thierry Vignaud
QA Contact:
URL:
Whiteboard:
Keywords: PATCH
: 3480 (view as bug list)
Depends on:
Blocks:
 
Reported: 2011-09-18 23:54 CEST by Frédéric "LpSolit" Buclin
Modified: 2012-03-17 22:08 CET (History)
3 users (show)

See Also:
Source RPM: rpmdrake-5.27-1.mga2.src.rpm, x11-server-1.11.2-3.mga2.src.rpm
CVE:
Status comment:


Attachments
do not flush more than 3 times a second (749 bytes, patch)
2012-02-15 18:53 CET, Thierry Vignaud
Details | Diff
sample of strace of X during hang (23.58 KB, text/plain)
2012-03-12 21:54 CET, Barry Jackson
Details
A sample of strace of rpmdrake during hang (14.58 KB, text/plain)
2012-03-12 21:57 CET, Barry Jackson
Details

Description Frédéric "LpSolit" Buclin 2011-09-18 23:54:06 CEST
This happened a lot recently (several days or weeks): when launching MageiaUpdate, /etc/X11/X eats 80% of the CPU for more than a minute, leaving the system mostly unresponsive. This means MageiaUpdate is totally unresponsive, with no packages listed in its window, and no button enabled. I wanted to launch GIMP to give you a screenshot of the MageiaUpdate window, but GIMP didn't start while /etc/X11/X was using a lot of CPU. Once the CPU usage decreased, GIMP was able to start and MageiaUpdate could list updated packages. So there is something really wrong here.

In case this is useful, the command eating a lot of CPU was:

  /etc/X11/X :0 vt8 -nr -nolisten tcp -auth /var/run/xauth/A:........
Frédéric "LpSolit" Buclin 2011-09-24 17:17:32 CEST

Severity: normal => major

Comment 1 Manuel Hiebel 2011-10-04 20:17:55 CEST
maybe there is something in /var/log/Xorg.0.log

CC: (none) => thierry.vignaud

Manuel Hiebel 2011-10-30 12:49:16 CET

Source RPM: (none) => mgaonline

Comment 2 Marja Van Waes 2011-12-24 23:29:41 CET
@ Frédéric

Is this bug still valid for current cauldron?

Keywords: (none) => NEEDINFO
CC: (none) => marja11

Comment 3 Frédéric "LpSolit" Buclin 2011-12-25 11:14:51 CET
(In reply to comment #2)
> Is this bug still valid for current cauldron?

Unfortunately, yes. This bug makes me crazy. And the problem is that it's not 100% reproducible (I would say the bug happens in 50% of cases). I wonder if it freezes when something else is interacting with MageiaUpdate which prevents it to complete its task.

Keywords: NEEDINFO => (none)

Comment 4 Marja Van Waes 2011-12-25 11:59:35 CET
(In reply to comment #3)
> (In reply to comment #2)
> > Is this bug still valid for current cauldron?
> 
> Unfortunately, yes. This bug makes me crazy. And the problem is that it's not
> 100% reproducible (I would say the bug happens in 50% of cases). I wonder if it
> freezes when something else is interacting with MageiaUpdate which prevents it
> to complete its task.

(In reply to comment #0)

> In case this is useful, the command eating a lot of CPU was:
> 
>   /etc/X11/X :0 vt8 -nr -nolisten tcp -auth /var/run/xauth/A:........

so you never have a problem when logging in to a text terminal instead of graphic and updating from there?
Comment 5 Marja Van Waes 2011-12-25 12:07:38 CET
I meant booting into run level 1 and then updating
Comment 6 Marja Van Waes 2011-12-25 13:35:11 CET
However, it is interesting, too, what happens when you're in X, go to a konsole and update from there (# urpmi --auto-update)

It was never with another application that your memory was eaten?

(In reply to comment #1)
> maybe there is something in /var/log/Xorg.0.log

I saw you never replied to that question, can attach that log, or the old log, if it didn't happen again after the old log was made.

I'll try to remember to use the graphical tool to update cauldron, next time. 

The only thing I can find about " /etc/X11/X :0 vt8 -nr -nolisten tcp -auth /var/run/xauth/A... ", is a Mandriva bug report https://qa.mandriva.com/show_bug.cgi?id=59673, where someone says kdm caused it.

Would it be possible, that the update tool sometimes first tries to display the updates on a different video terminal than where you really are?

On ctrl + alt + F"what" are you when it happens, and on ctrl + alt + F"what" are you when it doesn't happen?
Comment 7 Marja Van Waes 2011-12-27 13:07:14 CET
I had too much imagination:

I just updated updated cauldron and one, using the applet.

cauldron was on vt 7: no problems
1 was on vt 8: no problems

so which vt you're on doesn't seem to make any difference
Comment 8 Marja Van Waes 2011-12-28 19:54:01 CET
@ Frédéric

Which version of x11-server src.rpm are you using?

If you're not yet using version 1.11.2-3, please try whether upgrading helps.

(this question is because of bug 2600, where one user reported upgrading from x11-server-1.10.4.mga2.src.rpm to x11-server-1.11.2-3.mga2.src.rpm solved his problem of X using too much CPU)
Comment 9 Frédéric "LpSolit" Buclin 2011-12-28 20:39:35 CET
(In reply to comment #4)
> so you never have a problem when logging in to a text terminal instead of
> graphic and updating from there?

I never tried that and didn't really plan to do this. :)


(In reply to comment #6)
> However, it is interesting, too, what happens when you're in X, go to a konsole
> and update from there (# urpmi --auto-update)

I think it always worked fine.


> It was never with another application that your memory was eaten?

The same problem exists with rpmdrake.


> > maybe there is something in /var/log/Xorg.0.log
> I saw you never replied to that question

I see nothing special in this file.


(In reply to comment #8)
> Which version of x11-server src.rpm are you using?

x11-server-xorg-1.11.2-3.mga2
Comment 10 Marja Van Waes 2011-12-28 21:52:08 CET
Because of bug 2600, and because lebarhon said that in cauldron his X was on "alt ctrl F1", in this thread https://forums.mageia.org/en/viewtopic.php?f=15&t=1609&start=50, i'd again like to know where you're X is when this happens.

Just in case it matters, anyway ;)

rpmdrake-5.27-1.mga2.src.rpm is the version you use? (it contains MageiaUpdate, too, btw)

what is the output of: lspcidrake -v | fgrep Card ?

Source RPM: mgaonline => rpmdrake-5.27-1.mga2.src.rpm, x11-server-1.11.2-3.mga2.src.rpm

Comment 11 Thierry Vignaud 2012-02-15 18:38:14 CET
What would be interesting would to log from a remote connection then run "strace -p <pid_of_Xorg>" while starting rpmdrake.
Comment 12 Thierry Vignaud 2012-02-15 18:53:59 CET
Created attachment 1564 [details]
do not flush more than 3 times a second

Also does this patch help?
as root, just run the following commands in a terminal to apply it:

cd /
patch -p0 < /where/it/was/downloadd/less-flushing.diff

we could also try to call XFlush() instead of gdk_flush() (which is more costly)
Thierry Vignaud 2012-02-15 18:54:12 CET

Keywords: (none) => NEEDINFO, PATCH

Comment 13 Frédéric "LpSolit" Buclin 2012-02-15 19:09:51 CET
Testing that now...
Comment 14 Thierry Vignaud 2012-03-02 11:53:43 CET
Ping?
Comment 15 Frédéric "LpSolit" Buclin 2012-03-02 13:02:09 CET
I wanted to wait a few days before reporting back to you, just to get better data. Since you applied your patch, the freeze time disappeared, so it seems the problem is indeed fixed. Thank you! :)
Comment 16 Thierry Vignaud 2012-03-02 13:20:38 CET
Closing then

Status: NEW => RESOLVED
Resolution: (none) => FIXED

Comment 17 Thierry Vignaud 2012-03-12 15:30:21 CET
*** Bug 3480 has been marked as a duplicate of this bug. ***

CC: (none) => zen25000

Comment 18 Barry Jackson 2012-03-12 20:11:05 CET
I have just tested this in a clean LXDE installation of i586 Cauldron Beta, fully updated.
After opening rpmdrake via mcc using all GUI from the task bar icon the problem is still there.
I booted this installation over 30 mins ago, and went almost immediately into rpmdrake to test.
It's still sat there with the cpu at 95% and no package menu displayed.
Here's the state of play :-

[baz@jackodesktop ~]$ rpm -q rpmdrake
rpmdrake-5.30-1.mga2

[baz@jackodesktop ~]$ top

top - 18:37:11 up 4 min,  1 user,  load average: 1.01, 0.85, 0.40
Tasks: 101 total,   2 running,  98 sleeping,   0 stopped,   1 zombie
Cpu(s): 95.7%us,  3.3%sy,  0.0%ni,  1.0%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1030124k total,   409268k used,   620856k free,    19292k buffers
Swap:  4095468k total,        0k used,  4095468k free,   168732k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND            
 1368 root      20   0 69124  14m 8904 R 93.6  1.4   2:37.94 X                  
 1941 root      20   0 99.3m  78m  16m S  2.0  7.8   0:10.76 rpmdrake           
 1982 baz       20   0  211m  12m 9.9m S  1.3  1.2   0:00.37 lxterminal         
   28 root      20   0     0    0    0 S  0.3  0.0   0:00.30 kworker/0:2        
  283 root      20   0     0    0    0 S  0.3  0.0   0:00.25 kworker/0:3        
  852 root      20   0  5864 1248 1052 S  0.3  0.1   0:00.05 hald-addon-inpu    
 1854 baz       20   0 51224  32m  11m S  0.3  3.2   0:01.73 net_applet         
    1 root      20   0  5372 3372 1868 S  0.0  0.3   0:00.72 systemd            
    2 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kthreadd           
    3 root      20   0     0    0    0 S  0.0  0.0   0:00.07 ksoftirqd/0        
    4 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kworker/0:0        
    5 root      20   0     0    0    0 S  0.0  0.0   0:00.21 kworker/u:0        
    6 root      RT   0     0    0    0 S  0.0  0.0   0:00.00 migration/0        
    7 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 cpuset             
    8 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 khelper            
    9 root      20   0     0    0    0 S  0.0  0.0   0:00.00 kdevtmpfs          
   10 root       0 -20     0    0    0 S  0.0  0.0   0:00.00 netns

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 19 Barry Jackson 2012-03-12 21:54:57 CET
Created attachment 1740 [details]
sample of strace of X during hang

A few seconds of strace output of X pid
Comment 20 Barry Jackson 2012-03-12 21:57:38 CET
Created attachment 1741 [details]
A sample of strace of rpmdrake during hang

A few seconds of strace out put of rpmdrake pid
Comment 21 Barry Jackson 2012-03-12 22:18:30 CET
I just discovered that collapsing and re-opening the mcc window by clicking it's taskbar item twice clears the hang and the rpmdrake left panel immediately fills.

Thierry - if there is anything else that I can supply in relation to this please ask as this really needs fixing before mga2 release.

This i586 test system seems to exhibit the problem about 50% of the time and while it's hung I can still run Firefox, top, strace etc.
Comment 22 Barry Jackson 2012-03-16 23:02:06 CET
I have just clean installed Beta 2 x86_64 full KDE and the issue is still there.
Rpmdrake is useless like this.
Increasing to high priority - but really it should be release blocker.

Priority: Normal => High

Comment 23 Marja Van Waes 2012-03-17 18:11:40 CET
Assigning to maintainer

@ Thierry

Is it OK to use the same bug report, btw, I suppose the cause can't be the same?

Keywords: NEEDINFO => (none)
Assignee: bugsquad => thierry.vignaud

Comment 24 Thierry Vignaud 2012-03-17 18:51:23 CET
No it's not OK.
Yes it's probably another issue
Comment 25 Thierry Vignaud 2012-03-17 18:51:55 CET
That specific issue is fixed.
Please do not mix different issues.
Open a new bug report.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 26 Barry Jackson 2012-03-17 21:30:55 CET
I was not aware that it is a different issue, but if you really want me to copy / paste all the above into another bug I will.
Comment 27 Barry Jackson 2012-03-17 21:36:12 CET
NO hang on - my original bug was Bug 3480 which *you* marked as a duplicate of this one. That's how I ended up here in the first place.

I already did all this twice - so I'm not doing it again.

Status: RESOLVED => REOPENED
Resolution: FIXED => (none)

Comment 28 Frédéric "LpSolit" Buclin 2012-03-17 21:41:32 CET
In that case, reopen bug 3480, not this one.

Status: REOPENED => RESOLVED
Resolution: (none) => FIXED

Comment 29 Marja Van Waes 2012-03-17 21:56:47 CET
@ Barjac

I'll clone 3480 and copy what you posted here, just give me some time
Comment 30 Marja Van Waes 2012-03-17 22:08:08 CET
(In reply to comment #29)
> @ Barjac
> 
> I'll clone 3480 and copy what you posted here, just give me some time

it is bug 5000

Note You need to log in before you can comment on or make changes to this bug.