News for hackers. Stuff that matters.
Re:Debian switches to 64-bit time for everything by amelius on Monday July 28, 2025 @08:50AM (#44710349)
Would you advocate to put a hard limit on Python lists too?
Re:Debian switches to 64-bit time for everything by Eavolution on Monday July 28, 2025 @08:58AM (#44710409)
There is already a hard limit, the amount of memory before the OOM killer is triggered.
Re:Debian switches to 64-bit time for everything by 9dev on Monday July 28, 2025 @09:06AM (#44710489)
So why can't the limit for shell args be the amount of memory before the OOM killer is triggered as well?
Re:Debian switches to 64-bit time for everything by jart on Monday July 28, 2025 @10:02AM (#44710974)
It can. Just set RLIMIT_STACK to something huge. Distros set it at 8mb by default. Take it up with them if you want the default to change for everyone.
Re:Debian switches to 64-bit time for everything by amelius on Monday July 28, 2025 @12:45PM (#44712619)
I mean we wouldn't even need to have this discussion if the limit was at the memory limit.

Imagine having this discussion for every array in a modern system ...

Re:Debian switches to 64-bit time for everything by 9dev on Monday July 28, 2025 @04:24PM (#44715160)
I think I, and the parent commenter, are just pointing out how arbitrary the limit is. It can't hurt to question stuff like this every once in a while.
Re:Debian switches to 64-bit time for everything by jart on Monday July 28, 2025 @09:12PM (#44717829)
There's always a limit. People only complain when it actually limits them. Most open source people have never needed to glob tens of thousands of files. If you want to feel better, POSIX says the minimum permissible ARG_MAX is 4096, and with Windows ARG_MAX is only 32767 characters.
Re:Debian switches to 64-bit time for everything by fpoling on Monday July 28, 2025 @12:44PM (#44712606)
On a few occasions I wished that Python by default limited the max length of its lists to, say, 100 million elements to avoid bad bugs that consume memory and trigger swapping for few minutes before been killed by OOM. Allocating such amount of memory as plain Python list, not a specialized data structure like numpy array, is way more likely indicate a bug then a real need.
Re:Debian switches to 64-bit time for everything by jart on Monday July 28, 2025 @09:17PM (#44717860)
It's important to understand that functions like execve(), which are used to spawn processes, are upstream dependencies of dynamic memory functions like malloc(). It's hairy to have low-level functions in your system depend on other functions that are higher level than them. For instance I've been in situations where malloc() failed and the LLVM libcxx abort handler depends on malloc(). POSIX also defines execve() as being asynchronous signal safe, which means it isn't allowed to do things like acquire a mutex (which is necessary to allocate unbounded dynamic memory).