On Fri, 29 Aug 2025 09:00:57 GMT, Stefan Karlsson <stef...@openjdk.org> wrote:

>> test/jdk/java/lang/ProcessBuilder/FDLeakTest/libFDLeaker.c line 54:
>> 
>>> 52:   if (ret != 0) {
>>> 53:     return JNI_ERR;
>>> 54:   }
>> 
>> Hmm, if the JVM already has opened > 100 fds at this point, we get difficult 
>> to understand errors. Any future open etc call will fail.
>> 
>> What I would do is to check, after the call to fopen() at line 39, check for 
>> errno==EMFILE. If that is true, write out a clear error message along the 
>> lines of "more than 100 files open?" (since that in itself would be worth to 
>> investigate; this little test should not open > 100 files, but who knows).
>
> OK. I've added error logging for both setting the limit and opening the file. 
> I didn't check specifically for EMFILE, but I hope that's fine?

I also verified that if I set the limit to 3 I do get the "Too many open files" 
error message.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/26979#discussion_r2309608800

Reply via email to