3 ms·
What I find more ridiculous in Linux is the argument limit of processes. On a machine with 64GB of RAM I still often get "Argument list too long" when invoking
by amelius 5y ago
What I find more ridiculous in Linux is the argument limit of processes. On a machine with 64GB of RAM I still often get "Argument list too long" when invoking commands with wildcards, even if the total size of all filenames combined is much less than 1GB.
- cesarb 5y agoBut is the total size of all filenames combined much less than the stack size? The argument list is stored on the stack of the new process, and it still has to leave enough space there for the program to use. See bprm_stack_limits in fs/exec.c for details.
- josephcsible 5y agoThe situation is worse than this. There's a hard limit of 6MB for arguments and environment variables combined, no matter how big the stack is: https://lore.kernel.org/lkml/20170707185729.GA70967@beast/T/#m1a27b742141be749be06f276730756642b90d635 https://lore.kernel.org/lkml/20170707185729.GA70967@beast/T/... (which was merged as commit da029c1).
- amelius 5y agoI don't know much about Linux kernel internals, but I suppose the stack grows down in a virtual address space, where pages of the stack are allocated as needed by the kernel (?)