Bug 263792
| Summary: | run-jsc may kill the whole process group on some unix platforms | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Asumu Takikawa <asumu> |
| Component: | JavaScriptCore | Assignee: | Nobody <webkit-unassigned> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
Asumu Takikawa
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 | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Asumu Takikawa
Pull request: https://github.com/WebKit/WebKit/pull/19654
Asumu Takikawa
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
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
<rdar://problem/117689912>