Bug 1432699 - gnome-shell freezes when running dnf updates
Summary: gnome-shell freezes when running dnf updates
Keywords:
Status: CLOSED WORKSFORME
Alias: None
Product: Fedora
Classification: Fedora
Component: mutter
Version: 25
Hardware: x86_64
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Owen Taylor
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-03-16 00:17 UTC by Devin Henderson
Modified: 2017-06-27 23:35 UTC (History)
16 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-06-27 23:35:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
gdb stacktrace of gnome-shell process after hang from running dnf update (46.58 KB, text/plain)
2017-04-01 07:26 UTC, Deron Meranda
no flags Details
Stacktrace during hang (1) (17.08 KB, text/plain)
2017-04-02 20:20 UTC, Andrew Gunnerson
no flags Details
Stacktrace during hang (2) (16.09 KB, text/plain)
2017-04-02 20:20 UTC, Andrew Gunnerson
no flags Details
Patch to fix typo causing infinite loop (976 bytes, patch)
2017-04-02 21:39 UTC, Andrew Gunnerson
no flags Details | Diff

Description Devin Henderson 2017-03-16 00:17:45 UTC
For the last several days, gnome-shell freezes while dnf is running updates. Sounds that are playing continue to play but the screen freezes and the mouse & keyboard stop working. Switching to a tty works. From there I can see that dnf continues and does finish but gnome-shell is using 100% of 1 cpu and never recovers. Switching back to gnome from there shows a blank screen with a mouse cursor that doesn't move.

I'm using the nvidia proprietary graphics driver, by the way, installed from the installer at http://www.nvidia.com/object/unix.html. I've tried both 375.39 and 378.13.

I've looked at my IRC logs from #fedora on Freenode and there have been at least 2 different people in the last 24 hours reporting the exact same problem, <DamienCassou> and <quesada>. I'll try to get them to join this bug so they can chime in. I suspect this is pretty wide spread.

Here is my fpaste --sysinfo:
https://paste.fedoraproject.org/paste/GqaW4kE4EAjvGKMdijnMol5M1UNdIGYhyRLivL9gydE=

Comment 1 Devin Henderson 2017-03-16 00:24:51 UTC
The fpaste link isn't working. Bugzilla is cutting off the last character. This one should work:

https://paste.fedoraproject.org/paste/GqaW4kE4EAjvGKMdijnMol5M1UNdIGYhyRLivL9gydE=/raw

Comment 2 com 2017-03-16 00:25:38 UTC
I already commented on another bug of gnome-shell (#1419498) where you commented on and linked to this bug, and I can confirm this behaviour here as well.
However, I am not using the nVidia proprietary drivers with my nVidia graphics card. I am using the current version of Wayland.

Comment 3 Devin Henderson 2017-03-16 00:42:53 UTC
As I mentioned in bug #1419498 for me the freeze sometimes coincides with segfault messages about gnome-software like this one:

Mar 13 18:24:55 blackdev systemd-coredump[10743]: Process 10493 (gnome-software) of user 1000 dumped core.
Mar 13 18:24:55 blackdev systemd-coredump[10743]: Core Dumping has been disabled for process 10493 (gnome-software).
Mar 13 18:24:55 blackdev kernel: gnome-software[10493]: segfault at 7f5150079738 ip 00007f527b0d1016 sp 00007fffd5008e30 error 4 in libc-2.24.so[7f527b050000+1bd000]

However, when the freeze happened today there were no such messages, and no messages at all that were out of the ordinary. So I'm not sure if the segfaulting is even related.

Comment 4 Devin Henderson 2017-03-16 00:50:03 UTC
I should also mention that I've gotten this freeze under 2 different conditions-- while running dnf updates or while launch the gnome-software app. Not while installing updates in gnome-software, but just when launching it.

However, it doesn't always happen when I do this. Sometimes `dnf update` finishes without gnome freezing and sometimes gnome-software launches without causing the freeze.

Comment 5 Toms Trasūns 2017-03-16 10:14:51 UTC
It has happened for me too in ~last two days:
Once, updating using gnome-terminal,
And today updating using a different tty.
I can't confirm nor deny this behaviour when using gnome-software.

I'm using Negativo17 Nvidia proprietary driver, kernel version: 4.9.13-201.fc25.x86_64

My fpase --sysinfo:
https://da.gd/M9I5y

Comment 6 Dawid Zych 2017-03-16 10:18:24 UTC
I'm also having this issue. Gnome-shell freezes after `dnf upgrade`. Launching gnome-software does not make shell freeze on my system.
Here's my fpaste --sysinfo
https://paste.fedoraproject.org/paste/yXkaDOipBbIVjKPG~iJ6V15M1UNdIGYhyRLivL9gydE=

Comment 7 Eric Work 2017-03-18 20:03:18 UTC
My experience is the exact same as Toms in comment #5.  I've had it freeze both on screen and using a tty.  I'm also using the negativo17 nvidia driver.  I've had the problem occur maybe 5 or 6 times in the past week.

Comment 8 Dawid Zych 2017-03-21 09:17:07 UTC
Today my system didn't freeze after upgrade for the first time in about two weeks! I think that yesterday's dnf update may have fixed that.

Comment 9 Toms Trasūns 2017-03-21 09:37:17 UTC
Neither my system froze during the last update (I think it was one or two days ago, when it did not freeze for the first time, and yesterday's update of sole egl-wayland package did not freeze anything either).

Comment 10 Devin Henderson 2017-03-21 23:13:52 UTC
It happened to me again today. It has been intermittent for me from the beginning, happening roughly every other time I run dnf updates. Its been a couple days since it happened but it happened again today when I updated VirtualBox to 5.1.18 via

dnf update http://download.virtualbox.org/virtualbox/5.1.18/VirtualBox-5.1-5.1.18_114002_fedora25-1.x86_64.rpm

BTW, here is the reddit thread about this: https://redd.it/5zlc1x

There are some logs linked on that page. If there are specific logs that I can provide please let me know. I've looked in journalctl several times when the freeze happens and aside from the segfault mentioned above I've never seen anything that to me looked related.

Comment 11 Devin Henderson 2017-03-23 17:05:52 UTC
So this is really interesting-- just now when I ran `dnf distro-sync` like I always do, while installing packages the system froze for about 1 second and it looked like the gnome freeze was happening again but this time it recovered after a second or two and in journalctl I notice that gdm seems to have restarted itself?

Here are the logs:

https://paste.fedoraproject.org/paste/~0fR6q2NrdQueNTP0LWcp15M1UNdIGYhyRLivL9gydE=/raw

Comment 12 Eric Work 2017-03-23 17:20:59 UTC
I had gnome-shell freeze and jump to 100% cpu usage as usual when the bug is triggered, but it actually happened when I wasn't doing any updates, just browsing the web and doing some programming.  I'm assuming PackageKit or some other package manger related service kicked off in the background?  As others have reported it usually happens for me when I'm running dnf, just this one time though it happened when I wasn't running dnf.

Comment 13 Toms Trasūns 2017-03-23 17:44:51 UTC
Today I had a full system freeze again just after 'dnf update' was completed in tty3. But this time everything froze completely, I could not change tty's, the cursor looked frozen, it did not accept my inputs and I did a hard reset. The system seemed unresponsive, although I don't know, maybe it would have recovered if I would have waited a little longer as mentioned by Devin (Comment 11).

Here's my log file:
https://paste.fedoraproject.org/paste/~zbWZbEp5KhVvyJIxCzvIF5M1UNdIGYhyRLivL9gydE=

Comment 14 Eric Work 2017-03-23 17:49:21 UTC
Looking at the logs people have posted nothing ever seems to stand out.  I tried to attach gdb to gnome-shell and see what it was doing but it's in some javascript function (the interpreter).  Does anyone know how to debug the javascript code in gnome-shell?  Obviously you can't use looking glass since it's dead basically.

Comment 15 Andrew Gunnerson 2017-03-26 18:05:44 UTC
I'm running into the same issue as well. It sometimes happens when using gnome-software or running "dnf update".

My logs: https://da.gd/1tKB

"journalctl _COMM=gnome-shell --since today": https://da.gd/ShXpo

Comment 16 Guillaume Bernard 2017-03-27 10:54:05 UTC
I'm also affected on both my computers, including one laptop. On the laptop, i have a NVidia Graphic card that i don't use (nouveau disabled). They both use Intel Graphics Integrated.

It does not only happen when running upgrade for me, but also for installation and removals. I noticed the same behavior when launching GNOME Software from the notification area, clicking on a notification telling me that i need more codecs.

I don't notice any specific error excluding extensions in the logs.

Comment 17 Deron Meranda 2017-03-29 08:18:03 UTC
I also had gnome-shell hang with 100% CPU immediately after running a dnf update; the system was otherwise idle.  It could have possibly hung during the update, but I didn't attempt any interaction until after the dnf update command appeared to complete in the shell output.  I was doing a dnf update of the evolution package only, so no gnome, X, kernel, etc packages should have been involved.

Killing the gnome-shell process in a console (via ssh) lets systemd restart it and then the session continued normally without any apparent side-effect, other than minimized windows become un-minimized.

I'm running under X, not Wayland, and also am using the standard Fedora driver for AMD Radeon (not NVidia nor proprietary).

Comment 18 Devin Henderson 2017-03-30 20:45:21 UTC
More people with the same problem: https://redd.it/61z5jn

Comment 19 Deron Meranda 2017-03-31 06:10:11 UTC
It definitely seems repeatable: gnome-shell hanged again using 100% cpu while in the middle of doing a "dnf update" on the LibreOffice packages.  This was after the packages were downloaded and it was in the middle of applying the update transaction (Upgrading step).  Although the text output of dnf abruptly stopped, the dnf command itself did complete and gnome-shell was still in a hung state.  Killing the gnome-shell process restores everything to full operation; as the parent process (gnome-session-binary) relaunches a new gnome-shell.

I did see the following messages in journalctl at roughly the same time, though I don't know if they are applicable or not, as process 2413 (gnome-software) was not the one that hanged.

Mar 31 01:39:30 HOSTNAME gnome-software-service.desktop[2413]: 05:39:30:0794 As  failed to rescan: No valid root node specified
Mar 31 01:39:30 HOSTNAME gnome-software-service.desktop[2413]: 05:39:30:0794 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-impress.desktop file: cannot process file of type application/x-desktop
Mar 31 01:39:31 HOSTNAME gnome-software-service.desktop[2413]: 05:39:31:0432 As  failed to rescan: No valid root node specified
Mar 31 01:39:31 HOSTNAME gnome-software-service.desktop[2413]: 05:39:31:0434 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-writer.desktop file: cannot process file of type application/x-desktop
Mar 31 01:39:31 HOSTNAME gnome-software-service.desktop[2413]: 05:39:31:0676 As  failed to rescan: No valid root node specified
Mar 31 01:39:31 HOSTNAME gnome-software-service.desktop[2413]: 05:39:31:0678 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-draw.desktop file: cannot process file of type application/x-desktop
Mar 31 01:39:32 HOSTNAME gnome-software-service.desktop[2413]: 05:39:32:0973 As  failed to rescan: No valid root node specified
Mar 31 01:39:32 HOSTNAME gnome-software-service.desktop[2413]: 05:39:32:0974 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-calc.desktop file: cannot process file of type application/x-desktop
Mar 31 01:39:33 HOSTNAME gnome-software-service.desktop[2413]: 05:39:33:0183 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-math.desktop file: cannot process file of type application/x-desktop
Mar 31 01:39:33 HOSTNAME gnome-software-service.desktop[2413]: 05:39:33:0345 As  failed to rescan: Failed to parse /usr/share/applications/libreoffice-xsltfilter.desktop file: cannot process file of type application/x-desktop

Comment 20 Deron Meranda 2017-03-31 06:23:59 UTC
I just got it to hang again.  This time I ran the "dnf update" from a remote ssh login; so the dnf command process was not part of the same user login session.  The graphical session was completely idle.

Again, at the moment gnome-session hung the following similar logs appeared in the journalctl output:

Mar 31 02:15:14 HOSTNAME gnome-software-service.desktop[2413]: 06:15:14:0261 As  failed to rescan: No valid root node specified
Mar 31 02:15:14 HOSTNAME gnome-software-service.desktop[2413]: 06:15:14:0262 As  failed to rescan: Failed to parse /usr/share/applications/firefox.desktop file: cannot process file of type application/x-desktop

Comment 21 Deron Meranda 2017-04-01 05:34:32 UTC
After source code diving I think the journalctl warnings I reported above that were coming from gnome-software process about failing to rescan are probably unrelated to this hang problem.  So this gnome-shell hanging problem is still a mystery.

FYI the gnome-software process, specifically it's flatpak plugin, maintains an inotify(7) watch on the directory /usr/share/applications, among others. When the directory contents change, as a "dnf upgrade" of any GUI application will likely do, then gnome-software will attempt to refresh all the application metadata. This would include things like icons, application titles, etc.

That rescanning process basically looks for XML files in the AppStream format and processes those using the libappstream-glib package's API.  However not all files in that directory are XML, many are in an X-Desktop format rather than AppStream.  And those warning messages that get logged are just noisy complaints about files that libappstream-glib doesn't understand.

See also bug https://bugzilla.redhat.com/show_bug.cgi?id=1329999

Comment 22 Deron Meranda 2017-04-01 07:26:13 UTC
Created attachment 1268038 [details]
gdb stacktrace of gnome-shell process after hang from running dnf update

The gdb output is annotated at various times with lines starting with "###" to indicate the state of the system at that point in time.

Comment 23 Deron Meranda 2017-04-01 07:35:10 UTC
I captured a stack trace of the gnome-shell process in a "hung" state (using 100% cpu) and attached it.

This hang was triggered by a "dnf update gnome-documents gnome-documents-libs".

I don't know for sure, but it seems circumstantially that dnf only causes a hang if it is updating a graphical program.  For example doing "dnf update tzdata" or other non-graphical components complete as expected without causing gnome-shell to hang.

Comment 24 Deron Meranda 2017-04-01 20:09:09 UTC
FYI, I've lost the ability to reproduce this bug after rebooting; though I could reproduce it easily at will prior to that.  I wonder if some sequence of recent updates had a weird interaction if you remained logged in during the update process?

Comment 25 Andrew Gunnerson 2017-04-02 19:38:22 UTC
So this might not actually be caused by dnf or gnome-software. I can recreate the issue at will by running:

    sudo touch --no-create /usr/share/icons/hicolor

(which, of course, is in the post-install and post-uninstall scriptlets for many packages)

Any ideas why this might be causing gnome-shell to hang?

Comment 26 Andrew Gunnerson 2017-04-02 20:20:06 UTC
Created attachment 1268271 [details]
Stacktrace during hang (1)

Comment 27 Andrew Gunnerson 2017-04-02 20:20:39 UTC
Created attachment 1268272 [details]
Stacktrace during hang (2)

Comment 28 Andrew Gunnerson 2017-04-02 20:22:13 UTC
I installed all the debuginfo packages for gnome-shell and made it hang twice. The stacktraces from gdb are attached to this bug report.

Comment 29 Andrew Gunnerson 2017-04-02 21:39:38 UTC
Created attachment 1268284 [details]
Patch to fix typo causing infinite loop

Comment 30 Andrew Gunnerson 2017-04-02 21:40:28 UTC
I believe I have found out the cause of the issue. In update_style_contexts() in mutter, there's a typo in a while loop that causes an infinite loop if the theme has multiple variants. It tries to loop through a linked list, but never moves beyond the first item.

After fixing this, I'm not running into the issue anymore.

I've attached the patch to this bug report. A copr for testing has also been published here: https://copr.fedorainfracloud.org/coprs/chenxiaolong/rhbz1432699-fix/

Comment 31 Robert Aston 2017-04-06 10:04:30 UTC
I too am running into this problem.  Gnome-shell goes to 100% during the cleanup phase while dnf is updating one or more packages.  By using ssh to login into the machine from another, I can restart the window manager bu typing in "kill -1 <gnome-shell PID>".

Comment 32 Robert Aston 2017-04-06 12:10:10 UTC
I see that the latest SRPM for mutter in Fedora 26 Alpha, "mutter-3.24.0" still has the error Andrew Gunnerson pointed out on 2017-04-02 at 17:40.

Comment 33 Robert Aston 2017-04-06 12:28:44 UTC
I just checked the source code at "github.com/GNOME/mutter".  I see the loop variable in "src/ui/frames.c" has been corrected.  Hopefully this fix will get into fc25 and fc26 soon.  PLEASE!!!

Comment 34 Devin Henderson 2017-04-06 17:53:03 UTC
I changed this bug report to be against mutter. Hopefully the right people will see this now.

Andrew Gunnerson, thank you SO much for working on this and finding a fix!! Lots of people will be very, very happy to have this resolved.

I will tryout your copr repo as soon as I have some time and verify that it solves this for me which I'm sure it will. Thanks again!!

Comment 35 Devin Henderson 2017-04-12 23:16:20 UTC
There is currently a new version of the mutter package in updates-testing. Version 3.22.4-1.fc25:

https://bodhi.fedoraproject.org/updates/FEDORA-2017-9012909495

There is no mention of it containing a fix for this bug. Does anyone know if it does?

Comment 36 Devin Henderson 2017-04-12 23:32:40 UTC
So I looked in mutter-3.22.4-1.fc25 and sure enough the patch (variants->next changed to variant->next) seems to be there! So this update should fix the problem. It would probably be best if we all grab this latest package, test it, and submit positive karma if it does work so that it will hit the stable repo asap.

You should be able to update to this version by running:

sudo dnf update mutter --enablerepo=updates-testing --ref

Submit karma here:

https://bodhi.fedoraproject.org/updates/FEDORA-2017-9012909495

Comment 37 Deron Meranda 2017-06-27 23:25:13 UTC
I believe this has been fixed for quite a while and can be closed.  The beta patch mentioned in comment 36 fixed the issue for me, and since the subsequent  official release of mutter-3.22.4-1.fc25 or later I have never seen this bug reappear.

Comment 38 Devin Henderson 2017-06-27 23:35:02 UTC
I haven't seen the issue since the aforementioned mutter update either. I'll go ahead and close this.

Thanks everyone!


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