Bug 194816

Summary: test262-runner ends with SIGPIPE signal
Product: WebKit Reporter: Diego Pino <dpino>
Component: Tools / TestsAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aperez, cgarcia, commit-queue, ews-feeder, keith_miller, lforschler, mcatanzaro, msaboff, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

Description Diego Pino 2019-02-19 05:31:34 PST
In certain environments when running `test262-runner` the program ends abruptly with a SIGPIPE signal. Example:

```
$ Tools/Scripts/test262-runner --release

Settings:
Test262 Dir: JSTests/test262
JSC: WebKitBuild/Release/bin/jsc
Child Processes: 256
DYLD_FRAMEWORK_PATH: /home/slave/webkitgtk/gtk-linux-64-release/build/WebKitBuild/Release/bin
Config file: JSTests/test262/config.yaml
Expectations file: JSTests/test262/expectations.yaml
---

$ echo $?
141
```

This is inconvenient because `test262-runner` ends without printing out tests summary results.

By certain environments I mean the issue always happens in one specific host, while I have no issues in a different host.
Comment 1 Diego Pino 2019-02-19 05:41:03 PST
Created attachment 362382 [details]
Patch
Comment 2 Diego Pino 2019-02-19 05:54:01 PST
Explanation of the patch.

I debugged the issue using 'Carp::Trace'. I captured SIGPIPE signals and printed out a trace. I got the following output:

```
Test262::Runner::main [3]
        scalar - new stash
        /home/slave/webkitgtk/gtk-linux-64-release/build/Tools/Scripts/test262/Runner.pm line 122
Test262::Runner::(eval) [2]
        scalar - no new stash
        /home/slave/webkitgtk/gtk-linux-64-release/build/Tools/Scripts/test262/Runner.pm line 416
Test262::Runner::__ANON__ [1]
        scalar - new stash
        /home/slave/webkitgtk/gtk-linux-64-release/build/Tools/Scripts/test262/Runner.pm line 416
```

This pattern occurred several times in the output.

IIRC, a SIGPIPE happens when attempting to write on a closed pipe. In the case of the suspecting line (416), I think what is happening if that child is trying to write on a closed socket (the parent was closed right before that loop). In any case, it seems to me this block of code is redundant, so I removed it.

After applying the patch, `test262-runner --release` runs just fine (exit status is 0).
Comment 3 Diego Pino 2019-11-28 00:44:56 PST
Created attachment 384441 [details]
Patch
Comment 4 Diego Pino 2019-11-28 03:27:00 PST
Comment on attachment 384441 [details]
Patch

Carlos López reviewed the patch and granted r+ on private conversation.
Comment 5 EWS 2019-11-28 03:27:30 PST
Comment on attachment 384441 [details]
Patch

Rejecting attachment 384441 [details] from review queue.

dpino@igalia.com does not have reviewer permissions according to https://trac.webkit.org/browser/trunk/Tools/Scripts/webkitpy/common/config/contributors.json.

- If you do not have reviewer rights please read http://webkit.org/coding/contributing.html for instructions on how to use bugzilla flags.

- If you have reviewer rights please correct the error in Tools/Scripts/webkitpy/common/config/contributors.json by adding yourself to the file (no review needed).  The commit-queue restarts itself every 2 hours.  After restart the commit-queue will correctly respect your reviewer rights.
Comment 6 WebKit Commit Bot 2019-11-28 08:54:20 PST
Comment on attachment 384441 [details]
Patch

Clearing flags on attachment: 384441

Committed r252930: <https://trac.webkit.org/changeset/252930>
Comment 7 WebKit Commit Bot 2019-11-28 08:54:21 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2019-11-28 08:55:16 PST
<rdar://problem/57521420>