JustArchiNET / ArchiSteamFarm

C# application with primary purpose of farming Steam cards from multiple accounts simultaneously.
Apache License 2.0
11.09k stars 1.04k forks source link

Find out why ASF has CPU infinite loop on terminal detach #3051

Closed JustArchi closed 11 months ago

JustArchi commented 11 months ago

Checklist

ASF version

Latest stable release

ASF variant

linux-x64

Bug description

Issue https://github.com/JustArchiNET/ArchiSteamFarm/issues/3050 highlighted a problem where background ASF process on Linux after restart and detaching console runs into 100% CPU utilization. I've reproduced it myself so the issue seems global enough.

Expected behavior

ASF should run in the background normally.

Actual behavior

There is a thread taking 100% CPU allocation, we should find out if it's anything related to us we can fix, or whether this is .NET issue.

Steps to reproduce

Possible reason/solution

No response

Can you help us with this bug report?

Yes, I can code the solution myself and send a pull request

Full log.txt recorded during reproducing the problem

Not relevant

Global ASF.json config file

No response

BotName.json config of all affected bot instances

No response

Additional info

No response

JustArchi commented 11 months ago

After investigation: Linux terminal for some unknown to me reason sends 0 all the time as console input, this causes our interactive console listener to go into loop, because it now has work of reading 0 input infinitely. ASF logic works correctly, but why the hell something like that happens is unknown to me as of now, will need to code some workaround for that.

JustArchi commented 11 months ago

@andreldmonteiro I've found the root culprit and managed to code a workaround for that, big thanks for report! This should no longer happen starting from ASF V5.4.12.6.