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.

Reply via email to