chiark / gitweb /
dot/profile: Reduce the default ulimit a smidge.
authorMark Wooding <mdw@distorted.org.uk>
Wed, 26 Aug 2020 12:11:42 +0000 (13:11 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Wed, 26 Aug 2020 12:11:42 +0000 (13:11 +0100)
The dash(1) shell has an awful bug on 32-bit systems.  Although the
limit is presented to the shell as a number of kilobytes, it's presented
to the setrlimit(2) syscall as a number of /bytes/.  It seems that
dash(1) performs this calculation using 32-bit integers on 32-bit
platforms, and, with the chosen default of 4194304, ends up with zero,
and nothing can start up.

Reduce the limit by a kilobyte to avoid frying dash(1)'s brain.

dot/profile

index fd50a4671df68b519c518e4f0cf925462ec6fda5..3884f67d88dadfe791801cc0baee6398b9b50fae 100644 (file)
@@ -113,7 +113,7 @@ done
 ## need a lot of memory for a legitimate reason than for it to be a memory
 ## leak or some other bug that's going to cause swap death for no good
 ## reason.
-ulimit -Sv $(mdw-conf memory-limit 4194304)
+ulimit -Sv $(mdw-conf memory-limit 4194303)
 
 ## Establish a temporary directory.
 case ${TMPDIR+t} in