Bug 280366
Summary: | Race condition leading to failure in readPIDFromPeer() due to interrupted system call and subsequent crash | ||
---|---|---|---|
Product: | WebKit | Reporter: | Povilas Kanapickas <povilas> |
Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | Normal | CC: | webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Other | ||
Hardware: | PC | ||
OS: | Linux |
Povilas Kanapickas
readPIDFromPeer() contains a recvmsg() call which does not protect against EINTR being returned.
This problem has been observed in a automated end-to-end test setup involving Playwright and WPE Webkit, so it will be hard to reproduce outside the environment where the errors occurred. However, the following has been observed in strace:
[pid 23174] 20:38:42.188600 execve("/root/.cache/ms-playwright/webkit-2070/minibrowser-wpe/bin/WPEWebProcess", ["/root/.cache/ms-playwright/webki"..., "11", "17", "19"], 0x55d8d855d420 /* 53 vars */ <unfinished ...>
<...>
[pid 23174] 20:39:09.918082 +++ exited with 0 +++
<...>
[pid 23157] 20:39:09.918396 <... recvmsg resumed>{msg_namelen=0}, 0) = -1 EINTR (Interrupted system call)
<...>
[pid 23157] 20:39:09.918776 --- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_EXITED, si_pid=23174, si_uid=0, si_status=0, si_utime=0, si_stime=0} ---
<...>
[pid 23157] 20:39:09.923932 write(2, "\n** (MiniBrowser:23157): ERROR *"..., 126 <unfinished ...>
Which later leads to the following error message:
(MiniBrowser:23842): ERROR **: 20:39:09.919: readPIDFromPeer: Failed to read pid from PID socket: Interrupted system call
The browser then crashes.
Given that the child process exited with non-erroneous exit code zero, it is reasonable to expect that readPIDFromPeer() should handle this order of events.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Povilas Kanapickas
Pull request: https://github.com/WebKit/WebKit/pull/34268
EWS
Committed 284274@main (57a73ac7aa73): <https://commits.webkit.org/284274@main>
Reviewed commits have been landed. Closing PR #34268 and removing active labels.
Radar WebKit Bug Importer
<rdar://problem/136741794>