FS#46709 - [linux] System freezes at shutdown or reboot

Attached to Project: Arch Linux
Opened by Dusan Kazik (prescott) - Wednesday, 14 October 2015, 07:48 GMT
Last edited by Jan de Groot (JGC) - Tuesday, 03 October 2017, 11:41 GMT
Task Type Bug Report
Category System
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture x86_64
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

When i try to shutdown or reboot PC, it freezes - i get black screen(monitor goes to sleep mode) but PC is still running. I must reboot or shut it down with hard way.
I am using Gnome 3.18.1 a kernel 4.2.3-1

How can i debug this issue for you?
This task depends upon

Closed by  Jan de Groot (JGC)
Tuesday, 03 October 2017, 11:41 GMT
Reason for closing:  Fixed
Comment by jb (jb.1234abcd) - Wednesday, 14 October 2015, 14:04 GMT
When your screen gets black, can you restore it to normal brightness and see whatever is on your screen by pressing any key or switching tty's (Ctrl + Alt + F?) or change hardware brightness with Fn + F UP/Down keys ?
Comment by Dusan Kazik (prescott) - Wednesday, 14 October 2015, 16:37 GMT
no way. i cant do and see nothing.
Comment by jb (jb.1234abcd) - Wednesday, 14 October 2015, 16:44 GMT
Is your PC from Lenovo by chance ? Intel GPU ?

You should attach an output from dmesg and journalctl for at least the last two boots to capture the shutdown logs.
Comment by Dusan Kazik (prescott) - Wednesday, 14 October 2015, 16:49 GMT
No i dont have lenovo.i have desktop pc. Mainboard Gigabyte GA-H81M-HD3 and intel core i3. And yes, i am using haswell integrated intel graphics.
Comment by jb (jb.1234abcd) - Wednesday, 14 October 2015, 17:01 GMT
Have you tried to shutdown from a text tty, instead of your Gnome DE ?
For example, Ctrl + Alt + F2 to switch to a free tty.
Log in, su or sudo to act as a root user.
# sync; shutdown now
Comment by Dusan Kazik (prescott) - Wednesday, 14 October 2015, 17:15 GMT
Tried another tty. I get this:

https://drive.google.com/file/d/0B7IVEEF2578rWUJRdy1wdkRYSDA/view?usp=docslist_api

After countdown, pc is shutted down
Comment by jb (jb.1234abcd) - Wednesday, 14 October 2015, 18:09 GMT
Regarding the tty messages on your pic:
drm:check_crtc_state ERROR ...
this looks like a DRM, possibly KMS problem when you switch from X to tty - so, a kernel bug. There are plenty of them reported.
You can ignore it for now, I guess.

Regarding your shutdown freeze from within Gnome:
I do not use that DE, so I can not help you to debug it.

The only thing I can suggest is:
- make sure that your system is up to date
Make sure you have net connection established, then from an X terminal or tty
# pacman -Syu
- Then make a *clean* shutown from a tty (!):
# sync; shutdown now
- start your PC again
- You will be in Gnome.
Shutdown from Gnome to capture any error logs if possible.
If you get stuck (freeze) again, switch to a tty and
# sync; shutdown now
Restart and see 'journalctl' to get some clue what messages might have been logged
prior to and during the botched shutdown.
Attach log outputs as requested in my previous post.
Comment by Dusan Kazik (prescott) - Thursday, 15 October 2015, 04:39 GMT Comment by jb (jb.1234abcd) - Thursday, 15 October 2015, 07:46 GMT
journalctl does not look too good - somewhat disorderly. At least in comparison to what I see on my laptop.

---------------------

It looks like you install packages from AUR repo.
It is risky to use Manjaro package manager on Arch.
If you are curious what Manjaro does, I would suggest you install it separately from Arch or inside VirtualBox and play.

pamac - simple pacman gui for Manjaro Linux
This package service causes a dump - systemd does not like it !

okt 14 20:19:41 dusan.pc systemd[1]: Started Pamac.
okt 14 20:19:41 dusan.pc dbus[346]: [system] Successfully activated service 'org.manjaro.pamac'
okt 14 20:19:41 dusan.pc systemd[1]: Starting Pamac...
okt 14 20:19:41 dusan.pc dbus[346]: [system] Activating via systemd: service name='org.manjaro.pamac' unit='pamac.service'
...
okt 14 20:19:40 dusan.pc systemd-coredump[1223]: Process 687 (pamac-daemon) of user 0 dumped core.
okt 14 20:19:40 dusan.pc systemd[1]: pamac.service: Failed with result 'core-dump'.
okt 14 20:19:40 dusan.pc systemd[1]: pamac.service: Unit entered failed state.
okt 14 20:19:40 dusan.pc gnome-session[417]: ** (pamac-tray:617): CRITICAL **: file /pkg/src/pamac-2.4.2/src/tray.vala.c: line 1396: unexpected error: GDBus.Error:org.freedesktop.DBus.E
okt 14 20:19:40 dusan.pc systemd[1]: pamac.service: Main process exited, code=dumped, status=11/SEGV
okt 14 20:19:40 dusan.pc kernel: traps: pamac-daemon[687] general protection ip:7f6590e54e2e sp:7ffe180ae690 error:0 in libalpm.so.9.0.1[7f6590e3c000+31000]
...
okt 14 20:19:34 dusan.pc kernel: Linux version 4.2.3-1-ARCH (builduser@tobias) (gcc version 5.2.0 (GCC) ) #1 SMP PREEMPT Sat Oct 3 18:52:50 CEST 2015

---------------------

You did not say how you try to shutdown or reboot.
As I said I do not have Gnome 3 DE, just guessing what it allows.
Have you tried it these ways ?
1. after starting your PC, do not log in to Gnome.
From GDM screen try shutdown or reboot buttons.
2. after starting your PC, log in to Gnome.
From Gnome menu try shutdown or reboot buttons.
3. after starting your PC, log in to Gnome.
Try shutdown or reboot with systemd-native commands from X terminal.
https://wiki.archlinux.org/index.php/Allow_users_to_shutdown
Does it make any difference ?

---------------------

It would be good to see output from:
$ coredumpctl

---------------------

Search Google for:
arch linux gnome shutdown freeze

---------------------

I usually abstain from giving users advice on what DE they should use.
Judging by the amount of Gnome error logs in journalctl and problems reported
on Internet, I would suggest XFCE or LXDE. I use them and they almost never
stand in my way of whatever I do daily.
Comment by Dusan Kazik (prescott) - Thursday, 15 October 2015, 10:44 GMT
It will be good to inform Pamac developers about this issue?
Comment by jb (jb.1234abcd) - Thursday, 15 October 2015, 11:29 GMT
It would be enogh to inform Arch AUR repo devs, who obtained pamac from manjaro and modified it for Arch.
But that means they are now responsible for handling it and any possible bugs in Arch (they would then pass any common bugs to manjaro devs).
https://aur.archlinux.org/packages/pamac-aur/
You can add any comments (include error log messages we found) on this web page.
Comment by Dusan Kazik (prescott) - Thursday, 15 October 2015, 20:28 GMT
Note 1: Removing Pamac from system doesnt fix this issue, so it cant be Pamac related

Note 2: I am shutting down/rebooting system clasiccaly via Gnome's main menu(Top right corner)

Note 3: When i tryto shut down or reboot system in GDM menu(before login), it works fine. PC is shutted down immediatelly.
Comment by jb (jb.1234abcd) - Friday, 16 October 2015, 04:52 GMT
OK. So you know how to do the shutdown cleanly, i.e. after logout from Gnome, which makes sense.

Why the shutdown from inside Gnome menu does not work ? As I said, I am not familiar with Gnome 3. But perhaps the Arch devs this
bug report has been assigned to can help you. Gnome 3 is well integrated with systemd.

Otherwise you are on your own and can search for clues on the Internet:
https://wiki.archlinux.org/index.php/GNOME
https://wiki.archlinux.org/index.php/GDM

https://wiki.archlinux.org/index.php/Systemd
Shutdown/reboot takes terribly long
If the shutdown process takes a very long time (or seems to freeze) most likely a service not exiting is to blame. systemd waits some time for each service to exit before trying to kill it. To find out if you are affected, see this article.
Comment by Dusan Kazik (prescott) - Friday, 16 October 2015, 07:34 GMT
It looks like update of systemd to v227 from testing repository fixes this issue.
For now shutdown/reboot works well again.
Thanks for your patience.
Comment by Dusan Kazik (prescott) - Friday, 16 October 2015, 20:03 GMT
Issue is back after few restarts...can be informed systemd developers about this issue?
Comment by jb (jb.1234abcd) - Friday, 16 October 2015, 20:59 GMT
I would say yes, but Arch systemd package bug report - I see Tom Gundersen is the Arch package maintainer (he is also upstream systemd dev).
systemd package is already in prod status - I just updated my system with it.
You said to have used the test version of it and you have had mixed results.
See what prod version does to your machine. That way you will have more data points to report.

Btw, is your machine an NFS client ?
There is this bug report:
https://bugs.archlinux.org/task/46393?string=46393
Comment by Dusan Kazik (prescott) - Friday, 16 October 2015, 21:00 GMT
No i dont have NFS client
Comment by jb (jb.1234abcd) - Friday, 16 October 2015, 21:18 GMT
Just wondering - have you ever done these entries on your machine ?
As root user:
# find /boot -iname "*.pac*"
# find /etc -iname "*.pac*"
Comment by Dusan Kazik (prescott) - Monday, 19 October 2015, 16:42 GMT
results:

[root@dusan dusan]# find /boot -iname "*.pac*"
[root@dusan dusan]# find /etc -iname "*.pac*"
/etc/lightdm/lightdm-webkit2-greeter.conf.pacsave
/etc/lightdm/Xsession.pacsave
/etc/lightdm/lightdm.conf.pacsave
/etc/pamac.conf.pacsave
/etc/profile.pacnew
/etc/pacman.d/mirrorlist.pacnew
/etc/dbus-1/system.d/org.freedesktop.PackageKit.conf
/etc/makepkg.conf.pacnew
Comment by jb (jb.1234abcd) - Monday, 19 October 2015, 17:21 GMT
https://wiki.archlinux.org/index.php/Pacman/Pacnew_and_Pacsave
They have to be reconciled:
*.pacnew for certain
*.pacsave if package was removed, but later upgraded or reinstalled
The diff command will help.
Comment by Dusan Kazik (prescott) - Monday, 19 October 2015, 17:22 GMT
sorry i dont understeand you, what i have to do
Comment by jb (jb.1234abcd) - Monday, 19 October 2015, 17:36 GMT
For example:
# diff /etc/makepkg.conf.pacnew /etc/makepkg.conf
Based on the outcome you may have to add manually your old *custom* changes to the newest file,
or just 'mv' the newest file to the old file if there were no *custom* changes or no differences.
When you finish all files, reboot you system to make sure they take effect.

Play a little with 'diff file1.txt file2.txt', files that differ by one or more lines just to see how the command output is formatted to tell you where the differences are located in each file.
Comment by Dusan Kazik (prescott) - Tuesday, 20 October 2015, 08:37 GMT
Now i get two jobs, that are waiting to stop:
1.)Session c1 of user
2.)User manager for UID 1000
Comment by jb (jb.1234abcd) - Tuesday, 20 October 2015, 09:34 GMT
https://bbs.archlinux.org/viewtopic.php?id=171766

This would confirm your debug observations.
It refers to systemd bug report, which is active.
I would suggest you add your problem description to it, with relevant
journalctl log snapshot and packages/versions involved (systemd, kernel).

-----------------
Btw, something else to consider (you may check it out quickly in BIOS SETUP
and if configurable, test the shutdown):
Somebody reported a similar problem and a solution.
In SETUP (BIOS) disable usb 3.0 pre-os option.
Comment by Marat Kagarmanov (corvinusz) - Sunday, 03 April 2016, 23:08 GMT

Loading...