You are not logged in.

#1 2013-06-19 21:12:00

cris9288
Member
Registered: 2013-01-07
Posts: 347

logging out causes slim to consume 100% CPU

I have i3 and Openbox on my machine. When I try to logout using their native "exit" commands, SLIM hangs and my CPU usage shoots to 100%. Sending SIGTERM with htop doesn't work, but SIGABRT is able to kill the process. Also, after killing SLIM, I am unable to login to my desktop. I can enter my username and pw, but after pressing enter it just reprompts me for my credentials. The only thing to do is to reboot. slim.log doesn't say anything interesting other than pam_end() : System error. Does anyone else have this problem. Any help is appreciated.

Offline

#2 2013-06-19 21:27:48

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: logging out causes slim to consume 100% CPU

Slim runs as a systemd service, right?  So I wonder of there is anything of interest in the logs.  Maybe increasing log levels temporarily and then triggering this crazyness again might show something useful.

As a side note, I feel like I should mention that slim has not been without issue of late.  It seems like lately things might have smoothed themselves out, but for a while, recently, these threads were jam packed with all kinds of issues with slim and systemd (or maybe just slim in itself, I don't know).

Offline

#3 2013-06-19 21:46:12

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: logging out causes slim to consume 100% CPU

Yes it does. A temporary fix was to replace i3's exit command with sudo systemctl restart slim.service in its config file. That always seems to work. I had to configure sudo to not require a password for that command though. I checked journalctl, and the only error i see is

 pam_loginuid(slim:session): set_loginuid failed

I guess using systemctl to logout makes more sense, but I'm not sure if that's the most appropriate way to do it.

EDIT: That error may or may not have anything to do with my issue. Sending SIGKILL instead of SIGABRT allows me to kill SLIM and login again after starting it with systemd. Stilll don't see anything of interest in the logs after trying to log out.

Last edited by cris9288 (2013-06-19 21:48:21)

Offline

#4 2013-06-19 21:52:45

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: logging out causes slim to consume 100% CPU

Yeah, I don't think that is the "appropriate" way to do it.  But hey, if it works, I can't see a reason not to use it until you find a better alternative.  Unfotunately, I don't know very much about pam, so I can't really say whether or not that would be related. 

Did you try to increase logging levels and see if more info arises?

Offline

#5 2013-06-19 21:52:55

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,810
Website

Re: logging out causes slim to consume 100% CPU

WonderWoofy wrote:

It seems like lately things might have smoothed themselves out

Maybe most people just gave up on slim!

OT, do you provide any kind of status info to i3's stdin?

Several display managers (including slim) completely break standard streams - and broken I/O streams often lead to a cpu maxing out.

If this could be the issue, you should look into killing the status process at the end of xinitrc.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#6 2013-06-19 22:13:54

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: logging out causes slim to consume 100% CPU

Trilby wrote:
WonderWoofy wrote:

It seems like lately things might have smoothed themselves out

Maybe most people just gave up on slim!

OT, do you provide any kind of status info to i3's stdin?

Several display managers (including slim) completely break standard streams - and broken I/O streams often lead to a cpu maxing out.

If this could be the issue, you should look into killing the status process at the end of xinitrc.


yeah, I use conky and i3bar. Is that what you're referring to? How would I kill a process at the end of xinitrc? My last line is exec i3 - doesn't this mean that the xinitrc script is replaced with i3? Should I maybe add a custom logout command to slim.conf that kills conky/i3bar?

Offline

#7 2013-06-19 22:28:38

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,810
Website

Re: logging out causes slim to consume 100% CPU

how / where is the conky i3bar stuff?  Pardon my ignorance on the specifics of i3 - I only used it for a short while.

The exec may replace the xinit process, but still anything launch from xinitrc inherits the standard streams from xinit - and once the display manager has broken these, the child processes are then inheriting broken streams.

If you share your xinitrc I can see if this is a potential issue - as there are many ways it can happen.  But most are variations on a single theme: Process A has it's output piped to B's input, then A exits, but B is still trying to read.  In a "normal" xinitrc, B would then be left reading from a terminal, but with some display managers, there is no stdin, so B tries reading from ... nowhere?  This is essentially like the code:

while read line; do echo $line; done </dev/zero  ## do NOT use this code ... unless you (and your CPU) are really bored

It will just eat CPU cycles doing nothing.

EDIT: simple test: do you have the same problem if you remove any status processes from xinitrc, and have *only* `exec i3`?

Last edited by Trilby (2013-06-19 22:39:41)


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#8 2013-06-19 23:07:15

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: logging out causes slim to consume 100% CPU

well, I only have exec i3 in xinitrc. i3 starts i3bar, which makes a call to conky. I used the example in the i3 docs to get colors to work with conky. This is what my conky script looks like...

 #!/bin/bash

# Send the header so that i3bar knows we want to use JSON:
echo '{"version":1}'

# Begin the endless array.
echo '['

# We send an empty first array of blocks to make the loop simpler:
echo '[],'

# Now send blocks with information forever:
exec conky -q -c $HOME/.conkyrc

The thing is, the same things happens when I try and exit Openbox and I'm only running tint2. I will try and run i3 without any status processes and see if my problem persists. On a side note, i've installed lightdm and it doesn't any issues when I log out of openbox or i3, though there is a bunch of extra crap that has to run in the background.

Offline

#9 2013-06-19 23:17:55

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: logging out causes slim to consume 100% CPU

So I ran i3 and openbox without any status programs and tried logging out to slim. One small detail that I forgot to mention before is that the first logout always works, but the second one always fails. Anyways, even without conky/i3bar and tint2, the problem persists. I'll keep looking through the logs and will post back here if I find anything interesting.

Last edited by cris9288 (2013-06-19 23:19:04)

Offline

#10 2013-06-19 23:49:27

geno.nullfree
Member
From: en_US
Registered: 2013-05-29
Posts: 17

Re: logging out causes slim to consume 100% CPU

well, im not having the exact same issue, but i have noticed that when i log out of awesome to slim on my netbook, the first time works fine, but the second time drops me to tty1 and systemctl says slim.service died. i dont get the cpu to 100% though. i never really thought to look into slim dying, i usually dont log out, just reboot, so it didnt really bother me. when it drops me to tty1 i just do a systemctl start slim and it comes right back.
i know that's not a solution or anything...sorry for not helping, just thought it was interesting and possibly related.

Offline

#11 2013-06-20 00:18:33

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,810
Website

Re: logging out causes slim to consume 100% CPU

Thanks for the info Cris, it would seem my suspicion was incorrect and broken streams is not likely the issue.  Sorry if it was a misdirection, but I've seen similar-looking issues from this before.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

#12 2013-06-20 03:15:02

cris9288
Member
Registered: 2013-01-07
Posts: 347

Re: logging out causes slim to consume 100% CPU

No worries. I really never log out, but lately I've been using openbox because netbeans doesn't work well in i3. In the meantime, i'll continue logging out by restarting slim via systemctl. I'll probably file a bug report though.

Offline

#13 2013-06-20 03:18:49

Trilby
Forum Moderator
From: Massachusetts, USA
Registered: 2011-11-29
Posts: 13,810
Website

Re: logging out causes slim to consume 100% CPU

Not to derail the thread - perhaps start a new one if this is something you want to pursue and can't find info:  but the netbeans issue is likely a common issue with Java apps in some tiling WMs - while I don't use awesome, the awesomewm wiki to has a great page for "fixing" tempermental java programs that apply to many lightweight WMs.


InterrobangSlider
• How's my coding? See this page.
• How's my moderating? Feel free to email any concerns, complaints, or objections.

Offline

Board footer

Powered by FluxBB