4 ms·
Can we also switch to unlimited/dynamic command line length? I'm tired of "argument list too long" on my 96GB system.
by amelius 1y ago
Can we also switch to unlimited/dynamic command line length?
I'm tired of "argument list too long" on my 96GB system.
- loloquwowndueo 1y agoEver heard of xargs?
- amelius 1y agoSure. But it's not the same thing (instead of invoking the command once it invokes a command multiple times) and a workaround at best. And ergonomics are not great. Especially if you first type the command without xargs, and then find out the argument list is too long and you'll have to reformulate it but now with xargs.
- jcelerier 1y agoHow does that help with a GCC command line?
- tomsmeding 1y agoYou may already know this, but GCC supports option files: see "@file" at the bottom of this page https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html https://gcc.gnu.org/onlinedocs/gcc/Overall-Options.html . This does not detract from the point that having to use this is inconvenient, but it's there as a workaround.
- styanax 1y agoThe ARGS_MAX (`getconf ARGS_MAX`) is defined at the OS level (glibc maybe? haven't looked); xargs will also be subject to it's limitation like all other processes. One can use: xargs --show-limits --no-run-if-empty </dev/null ...to see a nicely formatted output include the -2048 POSIX recommendation on a separate line.
- jeroenhd 1y agoYou can recompile your kernel to work around the 100k-ish command line length limit: https://stackoverflow.com/questions/33051108/how-to-get-around-the-linux-too-many-arguments-limit https://stackoverflow.com/questions/33051108/how-to-get-arou... However, that sounds like solving the wrong end of the problem to me. I don't really know what a 4k JPEG worth of command line arguments is even supposed to be used for.
- tomrod 1y agoA huge security manifold to encourage adoption then sell white hat services on top?
- dataflow 1y ago> I don't really know what a 4k JPEG worth of command line arguments is even supposed to be used for. I didn't either, until I learned about compiler command line flags. But also: the nice thing about conmand line flags is they aren't persisted anywhere (normally). That's good for security.
- eightys3v3n 1y agoThere were ways for other users on the system to see running process command line flags I thought. This isn't so good for security.
- dataflow 1y agoThat depends on your threat model.
- Ghoelian 1y agoPretty sure `.bash_history` includes arguments as well.
- dataflow 1y agoThat's only if you're launching from an interactive Bash? We're talking about subprocess launches in general.
- jart 1y agoJust increase your RLIMIT_STACK value. It can easily be tuned down e.g. `ulimit -s 4000` for a 4mb stack. But to make it bigger you might have to change a file like /etc/security/limits.conf and then log out and back in.
- amelius 1y agoI mean, yes, that is possible. But we had fixed maximum string lengths in the COBOL era. It is time to stop wasting time on this silly problem and fix it once and for all.
- fpoling 1y agoThere is always a limit. An explicit value versus implicit depending on memory size of the system have a big advantage that it will be hit sufficiently often so any security vulnerabilities will surface much earlier. Plus it forces to use saner interfaces to pass big data chunks to a utility. For that reason I would even prefer for the limit to be much lower on Linux so the commands will stop to assume that the user can always pass all the settings on the command line.
- amelius 1y agoWould you advocate to put a hard limit on Python lists too?
- Eavolution 1y agoThere is already a hard limit, the amount of memory before the OOM killer is triggered.
- 9dev 1y agoSo why can't the limit for shell args be the amount of memory before the OOM killer is triggered as well?
- justincormack 1y agoYou can redefine MAX_ARG_STRLEN and recompile the kernel. Or use a machine with a larger page size, as its defined as 32 pages, eg RHEL provides a 64k pagesize Arm kernel. But using a pipe to move things between processes not the command buffer is easier...
- GoblinSlayer 1y agoPack it in Electron and send an http post json request to it.
- arccy 1y agowhat does 96GB have to do with anything? is that the size of your boot disk?
- dataflow 1y agoIt's their RAM. The point is they have sufficient RAM.
- perlgeek 1y agoSame for path lengths. Some build systems (eg Debian + python + dh-virtualenv) like to produce very long paths, and I'd be inclined to just let them.