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

Increased CPU usage after certain amount of time #1789

Closed
1 task
Friskygote opened this issue Aug 5, 2024 · 3 comments
Closed
1 task

Increased CPU usage after certain amount of time #1789

Friskygote opened this issue Aug 5, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@Friskygote
Copy link

Friskygote commented Aug 5, 2024

Describe the bug

Nheko uses 100% of CPU (one thread maxed out so it's just one core not all of them thankfully)

To Reproduce

  1. Open Nheko
  2. Use PC and Nheko as per usual
  3. After unknown amount of time the CPU usage ramps up

What happened?

I've been trying to track down the issue of Nheko suddenly hyperfocusing on something and using up all of CPU resources it can with a single thread. I weren't able to point to any specific action that triggers the issue. While the bug is reproducible quite consistently after around 30 minutes to two hours from starting Nheko, I can't reproduce it on demand as I don't know what exact action is triggering the behavior. From my observations however it seems like it's either not in buggy state or in buggy state with 100% usage and there is no in-between state.

When in bugged state Nheko is still usable so the bug is seemingly not blocking anything, graphical part of the interface works, images load, videos load. Haven't noticed any functionality being unusable.

Here is what I believe is relevant to the issue:

  1. When stracing nheko during bugged state, one thing in particular immediately catches my eye - a never ending stream of epool_wait calls. The same does not happen when nheko is not in a bugged state. I've attached screenshots from htop showing them as well as list of opened files with corresponding file descriptor.

Here is what I believe is not relevant to the issue but I decide to include it in report anyways just in case I'm wrong:

  1. Exiting Nheko results in this being logged, this is always printed, no matter if Nheko ever enters bugged state or not:
    [2024-08-05 18:21:15.104] [net] [error] sync error: (connection: Operation was aborted by an application callback, parser: [json.exception.parse_error.101] parse error at line 1, column 1: syntax error while parsing value - unexpected end of input; expected '[', '{', or a literal [while parsing error]: )
  2. Last line in log file when nheko is running is seemingly cut in the middle as if the stream ended when program was writing to it (for example [2024-08-05 23:43:43.314] [crypto] and nothing after that) after Nheko is closed, that line is completed along with addition of other logs.
  3. --debug did not yield any useful information that would help in pinning this issue to its root cause.

Operating system is EndeavourOS (basically Arch Linux) and Nheko is installed from official repository.

Expected behavior

Nheko using regular amount of resources as needed for tasks its performing.

Screenshots

strace result for CPU intensive thread
File Descriptor number 16

Version

0.12.0

Operating system

Linux

Installation method

Some repository (AUR, homebrew, distribution repository, PPA, etc)

Qt version

No response

C++ compiler

No response

Desktop Environment

KDE Plasma

Did you use profiles?

  • Profiles used?

Relevant log output

(logs ommited for privacy reasons, on request I'm willing to process them to redact private information)

Backtrace

No response

@Friskygote Friskygote added the bug Something isn't working label Aug 5, 2024
@Friskygote
Copy link
Author

Friskygote commented Aug 5, 2024

For a test, I've renamed .cache/nheko directory to test whether cache files could be corrupted or otherwise involved in this issue. I'll update this comment once I come to a conclusion on this.
EDIT: The issue still occurs after basically regenerating .cache/nheko folder.

@deepbluev7
Copy link
Member

What curl version do you have? 8.9.0 was buggy and would lead to high CPU usage of Nheko after a while.

@Friskygote
Copy link
Author

Hey, thank you for quick response! I indeed had 8.9.0 version of curl installed. I've now updated it to 8.9.1 that was released in official repos fairly recently and will close the issue at the end of the day if I don't encounter the issue again. Again, thank you for letting me know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants