Bug 236528 - [run-webkit-tests] Do not try and read from /dev/null
Summary: [run-webkit-tests] Do not try and read from /dev/null
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Jonathan Bedard
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-02-11 14:46 PST by Jonathan Bedard
Modified: 2022-02-12 18:05 PST (History)
8 users (show)

See Also:


Attachments
Patch (3.11 KB, patch)
2022-02-11 14:51 PST, Jonathan Bedard
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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/