bug-parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

"Command line too long" error when PATH is unset


From: Felix Abecassis
Subject: "Command line too long" error when PATH is unset
Date: Wed, 24 Jan 2024 19:30:59 -0800

Hello,

Using GNU Parallel 20221122.

In a bash script, I ended up calling something equivalent to the command below and it yielded a confusing error message:

$ env -u PATH -u HOME parallel -k echo ::: A B C
parallel: Warning: $HOME not set. Using /tmp.
parallel: Error: Command line too long (6 >= -1338) at input 0: A

After looking at the source code, it looks like there might be two different things at play here.
First of all, the fact that this statement yields a negative value for small values of "minimal_command_line_length": https://git.savannah.gnu.org/cgit/parallel.git/tree/src/parallel#n4912

And second, the fact that if PATH is unset, it won't find the "echo" binary here: https://git.savannah.gnu.org/cgit/parallel.git/tree/src/parallel#n13714
And thus instead of measuring the maximum command-line size, it seems it is measuring the maximum filename size? As hinted by what strace shows:
[pid 372756] newfstatat(AT_FDCWD, "ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc", 0x7ffcd0c03a10, 0) = -1 ENAMETOOLONG (File name too long)

Thank you

reply via email to

[Prev in Thread] Current Thread [Next in Thread]