amphp / process

An async process dispatcher for Amp.
MIT License
233 stars 30 forks source link

fix(posix): posix_kill crashes/kills other programs on null #68

Closed gerardroche closed 9 months ago

gerardroche commented 10 months ago

When $pid in posix_kill($pid, $signo) is null it kills other programs like Firefox, Terminal, even Gnome Shell. This patch adds a null check to avoid this.

Discovered via phpactor in Sublime Text: removing several folders in quick succession causes posix_kill to be called with null, for whatever reason, which causes a bunch of programs to crash.

See https://github.com/phpactor/phpactor/issues/2516

dantleech commented 9 months ago

hey @kelunik - do you think this could make sense?

kelunik commented 9 months ago

@dantleech Yes of course, thanks for the PR and investigation! Merged and tagged.

dantleech commented 9 months ago

Thankyou!