Commit 2128df3
committed
Retry _read() on EINTR, instead of losing pipe contents.
By not retrying, EINTR behaved like EOF. In other words, EINTR had
consequences like the write side (kid side) closing the pipe early.
Symptoms depended on the _read() caller. When $pipe_reader conflated
EINTR with pipe closure, symptoms were application-specific. When
_spawn reading the internal "sync pipe" conflated EINTR with pipe
closure, the parent would fail to report exec failure. Add a test for
the loss of exec failure report. The $pipe_reader problem is much
tougher to test, because $pipe_reader only tries read() if select()
found data available. Hence, the signal needs to arrive in the narrow
window after read() enters the kernel, before read() returns
already-available data. The issue report reproduced that on macOS only.
Fixes #1761 parent 85ed0b9 commit 2128df3
2 files changed
+34
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1545 | 1545 | | |
1546 | 1546 | | |
1547 | 1547 | | |
1548 | | - | |
1549 | | - | |
| 1548 | + | |
| 1549 | + | |
| 1550 | + | |
| 1551 | + | |
| 1552 | + | |
1550 | 1553 | | |
1551 | 1554 | | |
1552 | 1555 | | |
| |||
1567 | 1570 | | |
1568 | 1571 | | |
1569 | 1572 | | |
| 1573 | + | |
| 1574 | + | |
| 1575 | + | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
1570 | 1580 | | |
1571 | 1581 | | |
1572 | 1582 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
0 commit comments