amphp / process

An async process dispatcher for Amp.
MIT License
229 stars 32 forks source link

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

Closed gerardroche closed 7 months ago

gerardroche commented 8 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 7 months ago

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

kelunik commented 7 months ago

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

dantleech commented 7 months ago

Thankyou!