pibakery icon indicating copy to clipboard operation
pibakery copied to clipboard

Memory Leak and Stack Loop Overflow

Open altimmons opened this issue 3 years ago • 2 comments

You have a loop somewhere running wild, Creating hundreds of instances of Electron, ConsoleHost, CScriptHost. The parameters for the CLI that are in the Script Host is cscript //nologo "C:\Program Files (x86)\PiBakery\resources\app\node_modules\drivelist\scripts\win32.bat?.wsf"

Whatever runs appears to be on a 3 minute timed loop.

Perhaps you mean for it to return a value, but its just spawning a new process each time.

That is a chart of free CPU, Basically the inverted view of CPU Load, on my rather beefy system.

Before I realized what was causing system latency, I found more than 450 instances of Electron, ConsoleHost and CScriptHost, and much of the work being done by WMI Provider Host (WmiPrvSE.exe) process trying to maybe clean up the stack or something?

This happened - or rather I noticed it after I wrote to a card. I am not sure if it started earlier. Perhaps I removed it before the check process could complete, and then the loop got out of control.

altimmons avatar Dec 06 '21 17:12 altimmons

Command line of the consoole host is : C:\Windows\system32\cmd.exe /c "C:\Program Files (x86)\PiBakery\resources\app\node_modules\drivelist-scanner\node_modules\drivelist\scripts\win32.bat"

Restarting the program, it looks like you run a new process every 10 seconds or so, as one set of cmd.exe and cscript.exe open and close each tic.

There just seems to be a state where this process will not exit, and spawn processes out of control.

Maybe check the exit conditions for the the win32.bat file, or perhaps find another way to Poll drives?

altimmons avatar Dec 06 '21 17:12 altimmons

Also, I get a Connecting to server error

but then it attempts to download anyway.

altimmons avatar Dec 06 '21 17:12 altimmons