RFR: 8300088: [IMPROVE] OPEN_MAX is no longer the max limit on macOS >= 10.6 for RLIMIT_NOFILE [v2]
Gerard Ziemski
gziemski at openjdk.org
Thu Jan 11 17:17:24 UTC 2024
On Thu, 11 Jan 2024 17:08:47 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`.
>
> Gerard Ziemski has updated the pull request incrementally with one additional commit since the last revision:
>
> ksh bug affects all BSD platforms
> 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 [ksh93/ksh#591](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).
Thank you for the note - good to hear that it has been fixed in new ksh, however, the workaround will need to stick for a long while now I think.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/17361#issuecomment-1887608048
More information about the hotspot-runtime-dev
mailing list