RFR: 8300088: [IMPROVE] OPEN_MAX is no longer the max limit on macOS >= 10.6 for RLIMIT_NOFILE

Jaikiran Pai jpai at openjdk.org
Thu Jan 11 05:47:26 UTC 2024


On Wed, 10 Jan 2024 21:49:23 GMT, Gerard Ziemski <gziemski at openjdk.org> wrote:

> On current macOS (> 10.6) we can use `RLIM_INFINITY` for `setrlimit(RLIMIT_NOFILE)`, even though the man page for setrlimit(2) claims otherwise.
> 
> The only wrinkle here is that some terminals (ksh) will crash with `RLIM_INFINITY`, because that value overflows `int` type, which they use internally, causing crash, so we work around that by using `INT_MAX` instead of `RLIM_INFINITY`.

Hello Gerard,

> The only wrinkle here is that some terminals (ksh) will crash with RLIM_INFINITY

A note about that - that bug has been fixed in upstream ksh last year https://github.com/ksh93/ksh/issues/591 and appears to have made it in the 1.0.6 release https://github.com/ksh93/ksh/releases/tag/v1.0.6 which was released 6 months back. Of course that doesn't mean all relevant setups/systems will be using this new ksh version and I believe it will take time for that fix to make it into recent releases (In fact, I think Apple has its own fork of ksh).

-------------

PR Comment: https://git.openjdk.org/jdk/pull/17361#issuecomment-1886326678


More information about the hotspot-runtime-dev mailing list