-
Notifications
You must be signed in to change notification settings - Fork 404
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
i3lock raise_loop process does not exit #46
Comments
I’ve renamed this to a more accurate description. The forked process which raises the window should exit when the main process exits. Steps to reproduce would be appreciated. |
I've encountered the problem again. According to the debug log i3lock is watching window |
That’s really peculiar. On my machine, |
I have encountered this problem last night as well. My screen was unlocked, but there was still a running i3lock process that I had to kill. It definitely doesn't happen very often, in fact, it's the first time it happened for me. My i3lock call is
Running this call under the above valgrind doesn't really show anything, just a few minor things in cairo. |
I'm seeing this on multiple systems. Unfortunately, I don't have steps to reproduce, but I have some additional info that may (or may not) be helpful. On one system, I see an extra process or two every couple of days. On the other system, I get several extra processes per day, even if I haven't unlocked the system. For example, I last unlocked/relocked that system yesterday. At that time, I killed all i3lock processes. I haven't unlocked that system since, but running ps via ssh I can see that there are 7 i3lock processes now running. From the times in ps -ef, the largest interval between processes is several hours, the shortest is 30 minutes. If I let that system go for a couple of weeks without killing those stray processes, I'll eventually not be able to open any more X programs ("maximum number of clients reached"), which is what originally tipped me off to this problem. |
@bblough Could you run i3lock under xtrace (see https://xtrace.alioth.debian.org/) and provide the xtrace logfile of a run where the problem occurs? |
Interestingly, I haven't been able to reproduce the problem under xtrace. I'll have to experiment some more. |
Same thing happened here. Unfortunately I can't help with more details on how to reproduce the bug. My i3lock call is
I'm using Ubuntu 14.04.4, i3 version 4.12 and i3lock: version 2.7 |
tcatm, did you verify that it was the same thread/pid? I also experience this from time to time, but I haven't found any way to consistently reproduce it, which is to be expected if it is memory clobbering I guess. I think I'll try to reduce this to a smaller test case that can be run quickly in a loop. |
It seems like «[i3lock-debug] X11 Error received! sequence 0x1, error_code = 3» is printed (only) when this bug is triggered. I can also trigger it pretty consistently while running under valgrind. |
Error 3 is BadWindow, and since it happens more often when running under valgrind slowing everything down, I suspect xcb_change_window_attributes is called before the window is ready, somehow? |
This fixes it:
|
We need to ensure that the window handle is usable before returning so it can be used immediately. Fixes i3#46
We need to ensure that the window handle is usable before returning so it can be used immediately. Fixes i3#46
We need to ensure that the window handle is valid, i. e. the window is actually created and accessible, before returning. This is necessary because we immediately fork after returning, and the child process opens its own X11 connection and expects the window handle to be valid. Fixes i3#46
We need to ensure that the window handle is valid, i. e. the window is actually created and accessible, before returning. This is necessary because we immediately fork after returning, and the child process opens its own X11 connection and expects the window handle to be valid. Fixes #46
In
raise_loop
i3lock is waiting for events on its window. On a few occasions this has caused i3lock to not exit on my system after unlocking. At best, this causes stray processes and at worst it prevents locking the screen when external scripts check whether the previous i3lock run terminated.By analysing the running i3lock process using gdb I have found the window it is waiting for doesn't exist anymore (Obvisouly, this is expected as my session is unlocked). I'm going to run i3lock with
--debug
from now on so I get a better idea of what's going on.I can't reproduce this yet.
The text was updated successfully, but these errors were encountered: