Re: gmake and ccache conspiring together in creating gremlins

2021-02-09 Thread David Boyce
> 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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-09 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-09 Thread Edward Welbourne
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-08 Thread Sam Varshavchik
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-08 Thread Paul Smith
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-08 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-08 Thread Dmitry Goncharov via Bug reports and discussion for GNU make
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

Re: gmake and ccache conspiring together in creating gremlins

2021-02-08 Thread Edward Welbourne
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