ctc-oss / omega-edit

Open source library for building editors that can handle massive files, and multiple viewports.
https://ctc-oss.github.io/omega-edit/
Apache License 2.0
8 stars 6 forks source link

`stopProcessUsingPID(...)` returns `false` when OE server stops #957

Closed stricklandrbls closed 2 weeks ago

stricklandrbls commented 4 months ago

The API function stopProcessUsingPID(...) is resolving false when the PID is in fact stopped.

Example Screenshots

Omega Edit PID (from Data Editor server info) Screenshot_20240619_123335

VSCode Notification of Failure Screenshot_20240619_123603

I confirmed that there was no actual process running with that PID by using ps.

Breakpoint on Function Usage Showing false Return Screenshot_20240619_125012 Here, I'm awaiting the promise resolution and logging the output to the console. This can be seen in the lower lefthand corner of the screenshot.

scholarsmate commented 2 weeks ago

Spawning scripts in Windows has changed in a breaking way due to a high severity CVE that has been repaired in recent versions of Node.js:

https://nodejs.org/en/blog/vulnerability/april-2024-security-releases-2#command-injection-via-args-parameter-of-child_processspawn-without-shell-option-enabled-on-windows-cve-2024-27980---high

And here is more details on how to fix it:

https://nodejs.org/api/child_process.html#spawning-bat-and-cmd-files-on-windows