> The program could read this -1 to (for example) uint16_t and interpret as
65535 and fail to notice the parent is not giving any fd.
File descriptors have been of int type since Unix was designed (at least)
and -1 is documented as the invalid descriptor. E.g. the open() system call
and every othe
On Tue, Feb 9, 2021 at 5:31 AM Edward Welbourne wrote:
> Rather than removing the jobserver-auth data, you could amend the
> MAKEFLAGS to includ jobserver-auth data with plainly invalid fds,
i like jobserver-auth data with plainly invalid fds, because it lets
older binaries fail on parsing jobse
Paul Smith (8 February 2021 20:38) wrote:
> There is a loss of debugging information if we make this change: today
> make can detect if it was invoked in a way that _should_ expect to
> receive a jobserver context, but _didn't_ receive that context. That
> is, if make sees that jobserver-auth is s
On Mon, Feb 8, 2021 at 2:38 PM Paul Smith wrote:
>
> On Mon, 2021-02-08 at 10:43 +, Edward Welbourne wrote:
> > Sounds to me like that's a bug: when the descriptors are closed, the
> > part of MAKEFLAGS that claims they're make's jobserver file
> > descriptors should be removed, since that's w
On Mon, 2021-02-08 at 10:43 +, Edward Welbourne wrote:
> Sounds to me like that's a bug: when the descriptors are closed, the
> part of MAKEFLAGS that claims they're make's jobserver file
> descriptors should be removed, since that's when the claim stops
> being true.
I believe there have been
On Mon, Feb 8, 2021 at 12:36 PM Edward Welbourne wrote:
> Sounds to me like that's a bug: when the descriptors are closed, the
> part of MAKEFLAGS that claims they're make's jobserver file descriptors
> should be removed, since that's when the claim stops being true.
make uses posix_spawn by defa
On Mon, Feb 8, 2021 at 12:51 PM Dmitry Goncharov
wrote:
>
> On Mon, Feb 8, 2021 at 12:36 PM Edward Welbourne
> wrote:
> > Sounds to me like that's a bug: when the descriptors are closed, the
> > part of MAKEFLAGS that claims they're make's jobserver file descriptors
> > should be removed, since
Hi Sam,
Thanks for a delightfully illuminating analysis.
I hope you enjoyed the sleuthing, even if it did cost you a month !
> The TLDR of the above: make reads the job server's file descriptors
> from the MAKEFLAGS environment variable, then checks here if they
> actually exist. If they don't ex
I've been chasing down non-deterministic, random build fails. make
randomly blows up with
write error: stdout
A lot of stracing, experimentation, and pains, determined that this is
due to a sequence of the following events:
1) how make uses the job server file descriptor
2) an intentional leak