-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Excess CPU usage on macOS when database locks after switching user #3090
Comments
I replicate CPU usage, but for me it is less than 5%. I also notice that the database does NOT lock when switching users. This is on macOS 10.14.3. The CPU usage should certainly be 0%. This needs investigating. Good report! |
A little clarification and some more details...
Assume: USER-A -- Original User who opens a KDBX file, then with
KeePassXC open, does a switch user via AppleScript
USER-B -- Second User who is switched to from USER-A. USER-B then
opens a different KDBX file
There appears to be two use-cases here:
1) At some point after the switch user from USER-A to USER-B occurs
(time varies; no pattern identified thus far), USER-A's KeePassXC CPU
utilization starts to increase until it is consuming >50% of CPU. When
switching back to USER-A from USER-B, USER-A's KDBX database is now
LOCKED whereas it had been unlocked before switch. After switching
back to USER-A, CPU utilization drops to normal background
utilization. Conjecture: USER-A's KeePassXC is trying to lock the
database but can't get control of the UI to make the required change,
driving the CPU utilization up, but as soon as the switch back to
USER-A occurs, the database locks and CPU utilization returns to
normal. If I had to venture a guess here, sometimes the lock DB
timeout timer expires when USER-A is not the active user, and other
times, it does not; why this difference would be the question I would
have.
2) After switching to USER-B, no attempt to lock USER-A's KDBX file
occurs, and there is no increase in CPU utilization. Returning to
USER-A the KDBX file is still unlocked.
I have not figured out a reproducible way to create Use-Case #1. It
just seems to happen at random and only started after upgrading to
2.4.1.
Also, just for what it is worth, I use the following AppleScript to do
a SwitchUser: do shell script "/System/Library/CoreServices/Menu\
Extras/User.menu/Contents/Resources/CGSession -suspend"
II simply invoke it from the AppleScripts icon on the menu bar. Don't
know if that makes any difference here.
On 4/27/2019 at 11:45 AM, "Jonathan White" wrote:
I cannot replicate the excessive CPU usage, but I also notice that
the database does NOT lock when switching users. This is on macOS
10.14.3.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I have some additional information.
|
Another instance of runaway. This is a spingdump once again. I tried sampling the process, but it ran for over 20 minutes and then froze my system. I had to sleep the box, then I was able to kill the sampling, then the KeePassXC process. |
Based on your spindump it is clearly not KeePassXC code that is causing this. Most likely this is an issue in Qt. |
Not seeing this anymore with the latest version |
When do a switch-user, if KeePassXC has an open database on the user who is being switched out, you get a CPU runaway on that user -- apparently when it tries to lock the database on the switch (a previous bug I reported) but doesn't have access to the UI (or, so is my guess).
Expected Behavior
Database on switched-away-from user to be locked but not kill the CPU.
Current Behavior
See screen shots.
setup: original user (user switched away from): kiblerj
current user: anon
KeePassXC-CPUrunaway.png -- Shows runaway CPU usage.
switch back to kiblerj and cpu immediately drops no nominal:
KeePassXC-SwitchBack.png
Possible Solution
Steps to Reproduce
3a. Don't know if relevant, but also have a KDBX file open on User B at the same time, However, User B KeePassXC CPU utilization normal
Context
I am running KeePassXC from /Volume/FlashDrive/Applications -- that is, I have it installed on a flashdrive instead of on my Mac (I travel too much internationally, and don't want any visibility that I have a password database).
Debug Info
KeePassXC - Version 2.4.1
Revision: 7bafe65
Qt 5.12.2
Debugging mode is disabled.
Operating system: macOS Sierra (10.12)
CPU architecture: x86_64
Kernel: darwin 16.7.0
Enabled extensions:
Cryptographic libraries:
libgcrypt 1.8.4
The text was updated successfully, but these errors were encountered: