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

Excess CPU usage on macOS when database locks after switching user #3090

Closed
HUGHUSR opened this issue Apr 27, 2019 · 7 comments
Closed

Excess CPU usage on macOS when database locks after switching user #3090

HUGHUSR opened this issue Apr 27, 2019 · 7 comments

Comments

@HUGHUSR
Copy link

HUGHUSR commented Apr 27, 2019

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

KeePassXC-SwitchBack

KeePassXC-CPUrunaway

Possible Solution

Steps to Reproduce

  1. User "A" -- Open KDBX
  2. Switch to User "B"
  3. Not clear if it tries to close KDBX on User A immediately or when database open timer times out, but suddenly fans start running and checking CPU utilization from User B shows high KeePassXC utilization
    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
  4. Switch back to User A
  5. CPU utilization instantly drops back to 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:

  • Auto-Type
  • Browser Integration
  • SSH Agent
  • KeeShare (only unsigned sharing)
  • YubiKey
  • TouchID

Cryptographic libraries:
libgcrypt 1.8.4

@HUGHUSR HUGHUSR added the bug label Apr 27, 2019
@HUGHUSR
Copy link
Author

HUGHUSR commented Apr 27, 2019

This is different behavior than I had observed in 2.3.4 with bug #2642. I had thought the bug was fixed, as the database now appears to close on switching users, but but #2642 still shows as open.

@droidmonkey
Copy link
Member

droidmonkey commented Apr 27, 2019

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!

@droidmonkey droidmonkey changed the title CPU Runaway on Switch User Excess CPU usage on macOS when database locks after switching user Apr 27, 2019
@droidmonkey droidmonkey added this to the v2.4.2 milestone Apr 27, 2019
@HUGHUSR
Copy link
Author

HUGHUSR commented Apr 27, 2019 via email

@droidmonkey droidmonkey modified the milestones: v2.4.2, v2.5.0 May 30, 2019
@HUGHUSR
Copy link
Author

HUGHUSR commented Jul 3, 2019

I have some additional information.

  1. Screen shot in second user (anon) showing high utilization in first user (kiblerj) [ kpxc-am.png]
  2. Spin dump taken from second user [kpxc-Spindump.txt]
  3. When returning to first user, CPU utilization drops back to normal [kpxc-after-am.png]
  4. When returning to second user, CPU utilization again goes high

kpxc-am

[kpxc-Spindump.txt](https://github.com/keepassxreboot/keepassxc/files/3354056/kpxc-Spindump.txt)

kpxc-after-am

@HUGHUSR
Copy link
Author

HUGHUSR commented Jul 8, 2019

Another instance of runaway.

This is a spingdump once again.

Spindump2.txt

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.

@droidmonkey
Copy link
Member

Based on your spindump it is clearly not KeePassXC code that is causing this. Most likely this is an issue in Qt.

@phoerious phoerious removed this from the v2.5.0 milestone Oct 26, 2019
@droidmonkey
Copy link
Member

Not seeing this anymore with the latest version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants