Skip to content
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

Fix logind crash if shutdown is called from a non-tty #2887

Merged
merged 2 commits into from
Mar 25, 2016

Conversation

martinpitt
Copy link
Contributor

It's possible that sd_bus_creds_get_tty() fails and thus scheduled_shutdown_tty is NULL in method_schedule_shutdown().

Fix logind_wall_tty_filter() to get along with that, by showing the message on all TTYs, instead of crashing in strcmp() (see https://launchpadlibrarian.net/245662649/Stacktrace.txt for the stack trace, unfortunately not symbolic)

I tried to reproduce this with something like nohup shutdown +10 -r foo and similar, but didn't manage to get the crash yet. But this is real, https://launchpad.net/bugs/1553040 piles up quite some duplicates.

The second commit just fixes a typo, easier to just add that here than a second PR just for that.

@zonque
Copy link
Member

zonque commented Mar 23, 2016

The boot-smoke tests choked on this one for i386. @martinpitt any idea?

@zonque zonque added the login label Mar 23, 2016
@martinpitt
Copy link
Contributor Author

This seems to happen rarely indeed; I've seen it before, but I haven't found out what causes this. Can you re-run this? (The other two arches were fine)

It's possible that sd_bus_creds_get_tty() fails and thus
scheduled_shutdown_tty is NULL in method_schedule_shutdown().

Fix logind_wall_tty_filter() to get along with that, by showing the message on
all TTYs, instead of crashing in strcmp().

https://launchpad.net/bugs/1553040
@keszybz
Copy link
Member

keszybz commented Mar 25, 2016

m->scheduled_shutdown_tty can be NULL. Fix looks correct.

@keszybz keszybz merged commit 09541e4 into systemd:master Mar 25, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

None yet

3 participants