[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Bug in GNU make if -j used with very high values
From: |
Dianne Skoll |
Subject: |
Bug in GNU make if -j used with very high values |
Date: |
Wed, 18 Dec 2024 15:29:09 -0500 |
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.
- Bug in GNU make if -j used with very high values,
Dianne Skoll <=