Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 655912 - x11-misc/sddm-0.17.0 does not close cleanly on receiving SIGTERM
Summary: x11-misc/sddm-0.17.0 does not close cleanly on receiving SIGTERM
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: LxQt maintainers
URL: https://github.com/sddm/sddm/issues/1031
Whiteboard:
Keywords:
Depends on: 658238
Blocks:
  Show dependency tree
 
Reported: 2018-05-16 19:08 UTC by Michele Alzetta
Modified: 2018-06-16 15:23 UTC (History)
5 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (emerge.info,6.33 KB, text/plain)
2018-05-16 19:08 UTC, Michele Alzetta
Details
user patch (655912.patch,533 bytes, patch)
2018-06-04 08:41 UTC, Giuseppe Vitillaro
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Alzetta 2018-05-16 19:08:33 UTC
Created attachment 531868 [details]
emerge --info

"rc-service xdm stop" sends SIGTERM to sddm, as evident on logfile. 
However, X does not shut down, and desktop keeps working normally. 

"rc-service xdm status" outputs "stopped"

"rc-service xdm start" at this point generates an unusable state which requires hard shutdown.
Comment 1 Michele Alzetta 2018-05-16 19:11:38 UTC
Versions: 

sddm-0.17.0-r2 
xorg-server-1.19.5-r2 
xorg-drivers-1.19 

sddm.log:

[16:12:12.825] (II) DAEMON: Initializing... 
[16:12:12.834] (II) DAEMON: Starting... 
[16:12:12.835] (II) DAEMON: No session manager found 
[16:12:12.835] (II) DAEMON: Adding new display on vt 7 ... 
[16:12:12.841] (II) DAEMON: Loading theme configuration from "" 
[16:12:12.841] (II) DAEMON: Display server starting... 
[16:12:12.841] (II) DAEMON: Running: /usr/bin/X -nolisten tcp -auth /var/run/sddm/{b885a94d-4534-4e13-a89f-ba35e437db3f} -background none -noreset -displayfd 18 -seat seat0 vt7 
[16:12:13.240] (II) DAEMON: Setting default cursor 
[16:12:13.250] (II) DAEMON: Running display setup script "/usr/share/sddm/scripts/Xsetup" 
[16:12:13.254] (II) DAEMON: Display server started. 
[16:12:13.254] (II) DAEMON: Socket server starting... 
[16:12:13.254] (II) DAEMON: Socket server started. 
[16:12:13.255] (II) DAEMON: Loading theme configuration from "/usr/share/sddm/themes/maldives/theme.conf" 
[16:12:13.256] (II) DAEMON: Greeter starting... 
[16:12:13.257] (II) DAEMON: Adding cookie to "/var/run/sddm/{b885a94d-4534-4e13-a89f-ba35e437db3f}" 
[16:12:13.271] (II) HELPER: [PAM] Starting... 
[16:12:13.271] (II) HELPER: [PAM] Authenticating... 
[16:12:13.271] (II) HELPER: [PAM] returning. 
[16:12:13.769] (II) DAEMON: Greeter session started successfully 
[16:12:13.999] (II) DAEMON: Message received from greeter: Connect 
[16:12:30.864] (II) DAEMON: Message received from greeter: Login 
[16:12:30.864] (II) DAEMON: Reading from "/usr/share/xsessions/plasma.desktop" 
[16:12:30.864] (II) DAEMON: Reading from "/usr/share/xsessions/plasma.desktop" 
[16:12:30.864] (II) DAEMON: Session "/usr/share/xsessions/plasma.desktop" selected, command: "/usr/bin/startkde" 
[16:12:30.903] (II) HELPER: [PAM] Starting... 
[16:12:30.903] (II) HELPER: [PAM] Authenticating... 
[16:12:30.908] (II) HELPER: [PAM] Preparing to converse... 
[16:12:30.908] (II) HELPER: [PAM] Conversation with 1 messages 
[16:12:31.082] (II) HELPER: [PAM] returning. 
[16:12:31.085] (II) DAEMON: Authenticated successfully 
[16:12:31.116] (II) HELPER: [PAM] Closing session 
[16:12:31.598] (II) HELPER: [PAM] Ended. 
[16:12:31.601] (II) DAEMON: Auth: sddm-helper exited successfully 
[16:12:31.601] (II) DAEMON: Greeter stopped. 
[16:12:31.656] (II) HELPER: Starting: "/usr/share/sddm/scripts/Xsession \"/usr/bin/startkde\"" 
[16:12:31.712] (II) HELPER: Adding cookie to "/home/mike/.Xauthority" 
[16:12:31.739] (II) DAEMON: Session started 

and, after rc-service xdm stop, this gets logged:

[16:20:46.809] (WW) DAEMON: Signal received: SIGTERM
Comment 2 Michele Alzetta 2018-05-17 06:37:56 UTC
Downgraded to sddm-0.15.0 and the bug is not present.

As an unaware user with sddm-0.17.0 can end up with a frozen system (by switching to console, shutting down xdm service because it isn't needed, not notice that actually X is still active and then restarting xdm service) I suggest sddm-0.17.0 be masked until the bug is fixed.
Comment 3 Michele Alzetta 2018-05-19 06:18:07 UTC
Opened issue on https://github.com/sddm/sddm/issues
Comment 4 Petr Pisar 2018-05-28 19:55:35 UTC
The sigtermed process terminates. Therefore openrc signals successful stop. But X server as well as sddm-helper do not. Sending SIGTERM to sddm-helper helps. I think sddm does not forward SIGTERM to sddm-helper.
Comment 5 Giuseppe Vitillaro 2018-06-02 08:50:40 UTC
Same problem here, same versions: 0.17.0-r2 0.17.0-r3.

I had to downgrade to 0.15.0 to have a version of sddm which gracefully stop X at /etc/init.d/xdm stop.
Comment 6 Giuseppe Vitillaro 2018-06-02 17:56:36 UTC
I'm pretty sure 0.17.0-r1 didn't show the problem.

I've it installed now in at least two systems and "xdm stop" gracefully kill sddm and X.
Comment 7 Michele Alzetta 2018-06-02 21:03:29 UTC
If it's true that -r1 didn't have the bug, it should be an ebuild bug.

diff *1.ebuild *2.ebuild
44a45,46
>       # TODO: not yet upstream
>       "${FILESDIR}/${P}-switchtogreeter.patch" # bugs 644718, 649888

diff *1.ebuild *3.ebuild
44a45,47
>       "${FILESDIR}/${P}-logind-race.patch" # bug 656286
>       # TODO: not yet upstream
>       "${FILESDIR}/${P}-switchtogreeter.patch" # bugs 644718, 649888

I think the culprit should be in the switchtogreeter.patch
Comment 8 Giuseppe Vitillaro 2018-06-02 22:18:47 UTC
(In reply to Michele Alzetta from comment #7)
> If it's true that -r1 didn't have the bug, it should be an ebuild bug.
> 
> diff *1.ebuild *2.ebuild
> 44a45,46
> >       # TODO: not yet upstream
> >       "${FILESDIR}/${P}-switchtogreeter.patch" # bugs 644718, 649888
> 
> diff *1.ebuild *3.ebuild
> 44a45,47
> >       "${FILESDIR}/${P}-logind-race.patch" # bug 656286
> >       # TODO: not yet upstream
> >       "${FILESDIR}/${P}-switchtogreeter.patch" # bugs 644718, 649888
> 
> I think the culprit should be in the switchtogreeter.patch

Yep, here is the lion.

I don't know what the "switchtogreeter.patch" try to fix, but for sure it breaks the sddm termination sequence.

I've 0.17.0-r1 in my local portage now and r2/r3 masked. Without this patch sddm starts and stop correctly.

I tested again the r1 from home and I'm definitely positive about the fact r1 stop nicely.
Comment 9 Andreas Sturmlechner gentoo-dev 2018-06-02 22:20:34 UTC
(In reply to Giuseppe Vitillaro from comment #8)
> I don't know what the "switchtogreeter.patch" try to fix, but for sure it
> breaks the sddm termination sequence.
Bug numbers are right next to it.
Comment 10 Giuseppe Vitillaro 2018-06-02 22:23:28 UTC
It looks my english is too rough to express "irony" :-)

Read "I don't know" as "I don't care" :-)
Comment 11 Alexander Miller 2018-06-03 17:01:57 UTC
Looks like I accidentally dropped the parent constructor call in the switchtogreeter.patch. The line reading
+        explicit SeatManager(QObject *parent = 0) {}
should obviously have been
+        explicit SeatManager(QObject *parent = 0) : QObject(parent) {}

I don't know wheter that fixes the shutdown problems, but the patch needs to be updated accordingly. I'll make some tests later today.
Comment 12 Andreas Sturmlechner gentoo-dev 2018-06-03 18:56:10 UTC
Thanks Alexander for checking back. See also comments on https://github.com/sddm/sddm/pull/1010
Comment 13 Michele Alzetta 2018-06-03 19:43:51 UTC
Correcting this line in the patch fixed the problem on my system.
Comment 14 Michele Alzetta 2018-06-03 19:44:04 UTC
Correcting this line in the patch fixed the problem on my system.
Comment 15 Alexander Miller 2018-06-03 22:08:53 UTC
I had some time to test it and I can reproduce the problem with the first revision of the patch and confirm that the corrected patch fixes it again.

> See also comments on https://github.com/sddm/sddm/pull/1010
So they already spotted the missing constuctor call. Too bad I didn't see that comment.
(Regarding the other comment, I know 2 phase initialization is ugly, but the order is simply wrong otherwise. Redesigning the classes to avoid that is out of scope for the fix, that's a job for the maintainers.)

Thanks Andreas for updating your PR with the corrected revision.
Comment 16 Giuseppe Vitillaro 2018-06-04 08:41:27 UTC
Created attachment 534728 [details, diff]
user patch

This user patch, applied to sddm-0.17.0-r3 works correctly in my environment.

Thanks for the effort. Appreaciated!
Comment 17 Larry the Git Cow gentoo-dev 2018-06-06 10:14:12 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=12842ffb4b5a4ca1490724bb2d6646e49a4832d0

commit 12842ffb4b5a4ca1490724bb2d6646e49a4832d0
Author:     Andreas Sturmlechner <asturm@gentoo.org>
AuthorDate: 2018-06-06 10:12:11 +0000
Commit:     Andreas Sturmlechner <asturm@gentoo.org>
CommitDate: 2018-06-06 10:12:11 +0000

    x11-misc/sddm: Fix switchtogreeter patch, add consolekit fix
    
    Bug: https://bugs.gentoo.org/647254
    Bug: https://bugs.gentoo.org/655912
    Package-Manager: Portage-2.3.40, Repoman-2.3.9

 x11-misc/sddm/files/sddm-0.17.0-consolekit.patch   | 22 ++++++
 .../files/sddm-0.17.0-switchtogreeter-r1.patch     | 54 ++++++++++++++
 x11-misc/sddm/sddm-0.17.0-r4.ebuild                | 84 ++++++++++++++++++++++
 3 files changed, 160 insertions(+)