Maselkov / GW2RPC

Discord Rich Presence addon for Guild Wars 2
https://gw2rpc.info
GNU General Public License v3.0
46 stars 12 forks source link

Iterating over the process list while trying to find the game may randomly crash the application #10

Closed soulweaver91 closed 2 years ago

soulweaver91 commented 3 years ago

GW2RPC crashed while I was sleeping, hours after the last time GW2 had been running. The log file showed this:

2020-12-04 07:01:48,671:CRITICAL:root: GW2RPC has crashed
Traceback (most recent call last):
  File "site-packages\psutil\_pswindows.py", line 636, in wrapper
  File "site-packages\psutil\_pswindows.py", line 702, in exe
ProcessLookupError: [Errno 3] No such process

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "gw2rpc\gw2rpc.py", line 373, in main_loop
  File "gw2rpc\gw2rpc.py", line 353, in update_gw2_process
  File "site-packages\psutil\__init__.py", line 661, in name
  File "site-packages\psutil\_pswindows.py", line 636, in wrapper
  File "site-packages\psutil\_pswindows.py", line 688, in name
  File "site-packages\psutil\_pswindows.py", line 641, in wrapper
psutil.NoSuchProcess: psutil.NoSuchProcess process no longer exists (pid=23148)

Looking at the relevant lines on this application's side, my guess is that one of the processes in the given process list exited right at the same time as GW2RPC was iterating over them. Just catching that exception somewhere as well might be enough if that is the case.

Maselkov commented 3 years ago

Seems like your observation is correct, will fix soon

n1tr0-5urf3r commented 2 years ago

Maybe fixed in dd80967dd66f50774cb2fac2c8470bf35ada0edf, needs some testing

n1tr0-5urf3r commented 2 years ago

Should be fixed with Version 2.2