RESOLVED FIXED 263792
run-jsc may kill the whole process group on some unix platforms
https://bugs.webkit.org/show_bug.cgi?id=263792
Summary run-jsc may kill the whole process group on some unix platforms
Asumu Takikawa
Reported 2023-10-27 11:39:09 PDT
There are two related issues with the `run-jsc` script on some unix systems (Linux specifically, but possibly on others). When running `run-jsc` without any port flags on Linux, it fails to find the JSC executable. This is confusing but can be easily fixed by adding `prohibitUnknownPort()` in the script, which will tell the user to supply the right flags. The second problem is that when there is an error such as the previous one, `run-jsc` will try to propagate the signal received by calling Perl's `system` with `kill`. On Linux systems it's possible that this will call `/usr/bin/kill` which has different behavior on unknown signals, and specifically will kill the entire process group. This can lead to a situation where running `run-jsc` will just kill the whole terminal session. This can be fixed by using the Perl `kill` instead, which is probably more portable. I'll attach a proposed patch later.
Attachments
Asumu Takikawa
Comment 1 2023-10-27 13:49:24 PDT
Asumu Takikawa
Comment 2 2023-10-27 13:53:58 PDT
Note: I thought originally this was only a problem on Linux, but you can reproduce bad behavior on MacOS as well but not as dire. Example on Mac with zsh: ``` % run-jsc --jsc-only Running 1 time(s): DYLD_FRAMEWORK_PATH=/Users/asumu/WebKit/WebKitBuild/JSCOnly/Release/bin /Users/asumu/WebKit/WebKitBuild/JSCOnly/Release/bin/jsc --useDollarVM=1 Can't exec "/Users/asumu/WebKit/WebKitBuild/JSCOnly/Release/bin/jsc": No such file or directory at /Users/asumu/WebKit/Tools/Scripts/run-jsc line 70. kill: 14012: Invalid argument jsc exited with non-zero status: 255 ``` The `kill` command errors with "invalid argument" because the jsc-only port is not available.
EWS
Comment 3 2023-10-30 09:19:27 PDT
Committed 269947@main (03f59460b133): <https://commits.webkit.org/269947@main> Reviewed commits have been landed. Closing PR #19654 and removing active labels.
Radar WebKit Bug Importer
Comment 4 2023-10-30 09:20:20 PDT
Note You need to log in before you can comment on or make changes to this bug.