Bug in GNU make if -j used with very high values

Dianne Skoll <[email protected]>
Newsgroups gmane.comp.gnu.make.bugs
Message-ID <[email protected]>
Hi,

On Debian GNU/Linux 12 with default settings, the command:

   make -j 70000

hangs.

That's because make tries to fill a pipe with 70,000 '+' characters to act
as a counting semaphore to limit the number of spawned processes, but
the default capacity of a pipe is 64K.

I recommend initially opening the pipe in non-blocking mode, and after
writing each '+' check for a failure return of EAGAIN/EWOULDBLOCK, and
quit with an error message if you get that.  If all the '+' writes
succeed, then put the pipe in blocking mode so it works as a counting
semaphore.

Yes, I realize this is a ridiculous edge-case, but I think it's still
technically a bug.

Regards,

Dianne.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.