WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED FIXED
261093
[GTK] Race condition when reading the display number from Xvfb
https://bugs.webkit.org/show_bug.cgi?id=261093
Summary
[GTK] Race condition when reading the display number from Xvfb
Carlos Alberto Lopez Perez
Reported
2023-09-03 17:33:25 PDT
The Xvfb driver for running layout tests with the GTK port starts the Xvfb server passing the parameter `-displayfd $fd` and then waits for Xvfb to write there the display number and closes the $fd pipe. The problem is that the Xvfb program does not write the number in an atomic way. It first writes the number itself and then it writes later the \n character. See: os/connection.c-void os/connection.c-NotifyParentProcess(void) os/connection.c-{ os/connection.c-#if !defined(WIN32) os/connection.c: if (displayfd >= 0) { os/connection.c: if (write(displayfd, display, strlen(display)) != strlen(display)) os/connection.c: FatalError("Cannot write display number to fd %d\n", displayfd); os/connection.c: if (write(displayfd, "\n", 1) != 1) os/connection.c: FatalError("Cannot write display number to fd %d\n", displayfd); os/connection.c: close(displayfd); os/connection.c: displayfd = -1; os/connection.c- } So it happens that we end in a race condition sometimes where we read the number from the first write and then we close the displayfd descriptor before Xvfb had wrote the \n character and that causes Xvfb to crash or to exit with an error. Example: Fatal server error: (EE) Cannot write display number to fd 13 (EE) Xvfb crashed [pid=18829] This issue is causing sometimes unexpected crashes on the layout tests
Attachments
Add attachment
proposed patch, testcase, etc.
Carlos Alberto Lopez Perez
Comment 1
2023-09-03 18:19:23 PDT
Pull request:
https://github.com/WebKit/WebKit/pull/17393
EWS
Comment 2
2023-09-20 02:19:09 PDT
Committed
268189@main
(413b2a19f079): <
https://commits.webkit.org/268189@main
> Reviewed commits have been landed. Closing PR #17393 and removing active labels.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug