Bug 236528

Summary: [run-webkit-tests] Do not try and read from /dev/null
Product: WebKit Reporter: Jonathan Bedard <jbedard>
Component: Tools / TestsAssignee: Jonathan Bedard <jbedard>
Status: RESOLVED FIXED    
Severity: Normal CC: ap, ashvayka, dewei_zhu, ews-watchlist, glenn, slewis, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=230513
Attachments:
Description Flags
Patch none

Description Jonathan Bedard 2022-02-11 14:46:59 PST
We should not try to read from /dev/null. While some distributions define this behavior well, Darwin, notably, does not. Use PIPE instead.
Comment 1 Radar WebKit Bug Importer 2022-02-11 14:48:13 PST
<rdar://problem/88836868>
Comment 2 Jonathan Bedard 2022-02-11 14:50:01 PST
Stumbled into this when investigating https://bugs.webkit.org/show_bug.cgi?id=230513. This change isn't implicated in that bug, but we should still fix this.
Comment 3 Jonathan Bedard 2022-02-11 14:51:53 PST
Created attachment 451749 [details]
Patch
Comment 4 Alexey Proskuryakov 2022-02-11 16:09:48 PST
Comment on attachment 451749 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=451749&action=review

> Tools/ChangeLog:9
> +        While writing to /dev/null is well defined, reading from it is not. Do not

I didn't know this. What is the source of this information?

That said, the patch removes more code than it adds, and webkitpy tests pass, so it's good.
Comment 5 Jonathan Bedard 2022-02-11 16:45:42 PST
Man page for 'null':

NAME
     null – the null device

DESCRIPTION
     The null device accepts and reads data as any ordinary (and willing) file - but throws it away. The length of the null
     device is always zero.

FILES
     /dev/null

HISTORY
     A null device appeared in Version 7 AT&T UNIX.


Notably, says nothing about what happens if you try and read from this file.
Comment 6 EWS 2022-02-12 17:19:59 PST
Committed r289703 (247188@main): <https://commits.webkit.org/247188@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 451749 [details].
Comment 7 Alexey Proskuryakov 2022-02-12 18:05:54 PST
Reading from /dev/null is standardized, https://pubs.opengroup.org/onlinepubs/9699919799/