davidferguson / pibakery

The blocks based, easy to use setup tool for Raspberry Pi
http://www.PiBakery.org
GNU General Public License v3.0
1.48k stars 146 forks source link

Memory Leak and Stack Loop Overflow #196

Open altimmons opened 2 years ago

altimmons commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Also, I get a Connecting to server error

but then it attempts to download anyway.