New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Arch Linux] Shutting down a VM hangs while consuming CPU #2702

Closed
ptitdoc opened this Issue Mar 14, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@ptitdoc

ptitdoc commented Mar 14, 2017

Qubes OS version (e.g., R3.2):

R3.2

Affected TemplateVMs (e.g., fedora-23, if applicable):

archlinux


Expected behavior:

Shutting down the VM should be fast and quiet

Actual behavior:

Shutting down the VM hangs for about 1 minute with a Process running at 100% (25% CPU consumption).

Steps to reproduce the behavior:

Conditions to reproduce the behavior are unknown, but affected users are observing this each time their archlinux appvm shutdown.

General notes:

It seems to hangs until the user session timeout.
[ *] A stop job is running for Session 1 of user user (8s / 1min 30s)


Related issues:

N/A

@ptitdoc

This comment has been minimized.

Show comment
Hide comment
@ptitdoc

ptitdoc Mar 14, 2017

In my case, the problem can be solved by setting kernel.core_pattern=core
As referenced here:
systemd/systemd#1615

@benjarobin has done a very good job at explaining the two failures in a series of comments.
(See #2691 (comment) and following).

Both cases are linked with the application reacting badly to the SIGTERM sent to to them when the system goes down.

In the first case, the application crashes, but a bug with coredumps makes the system wait forever on the coredump service that can not start during shutdown. See #2993 for an attempt at fixing it.
In the second case, the application ignores (or misses) the SIGTERM signal and continues running, unaware of the shutdown.
As systemd cannot tell this situation from a service requiring more time to exit cleanly, it must wait untill the hard limit of 90s before killing the process with SIGKILL. Fixing the application is the way to go. For conky I have submitted brndnmtthws/conky#233.

Of course, this does not explain why so many programs started to fail with systemd versions around 229-3. I think one explanation might be that systemd started to send SIGHUP on top of SIGTERM (as outlined in https://bbs.archlinux.org/viewtopic.php?pid=1617469#p1617469).

ptitdoc commented Mar 14, 2017

In my case, the problem can be solved by setting kernel.core_pattern=core
As referenced here:
systemd/systemd#1615

@benjarobin has done a very good job at explaining the two failures in a series of comments.
(See #2691 (comment) and following).

Both cases are linked with the application reacting badly to the SIGTERM sent to to them when the system goes down.

In the first case, the application crashes, but a bug with coredumps makes the system wait forever on the coredump service that can not start during shutdown. See #2993 for an attempt at fixing it.
In the second case, the application ignores (or misses) the SIGTERM signal and continues running, unaware of the shutdown.
As systemd cannot tell this situation from a service requiring more time to exit cleanly, it must wait untill the hard limit of 90s before killing the process with SIGKILL. Fixing the application is the way to go. For conky I have submitted brndnmtthws/conky#233.

Of course, this does not explain why so many programs started to fail with systemd versions around 229-3. I think one explanation might be that systemd started to send SIGHUP on top of SIGTERM (as outlined in https://bbs.archlinux.org/viewtopic.php?pid=1617469#p1617469).

@ptitdoc

This comment has been minimized.

Show comment
Hide comment
@ptitdoc

ptitdoc Mar 14, 2017

Coredump by default is set to |/bin/false. This apparently cause coredump hanging because an application crashes when systemd tries to kill it.
I don't know how to identify the application crashing during shutdown.

ptitdoc commented Mar 14, 2017

Coredump by default is set to |/bin/false. This apparently cause coredump hanging because an application crashes when systemd tries to kill it.
I don't know how to identify the application crashing during shutdown.

@adrelanos

This comment has been minimized.

Show comment
Hide comment
@adrelanos

adrelanos Mar 14, 2017

Member
Member

adrelanos commented Mar 14, 2017

@ptitdoc

This comment has been minimized.

Show comment
Hide comment
@ptitdoc

ptitdoc Sep 14, 2017

I tested updating to qubes-vm-core 3.2.18 and qubes-vm-gui 3.2.17 and I cannot observe this issue anymore.

ptitdoc commented Sep 14, 2017

I tested updating to qubes-vm-core 3.2.18 and qubes-vm-gui 3.2.17 and I cannot observe this issue anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment