On Fri, 25 Jul 2025 23:09:48 GMT, Chris Plummer <cjplum...@openjdk.org> wrote:
> Fix gcc warning about double close. forkedChildProcess() calls > closeDescriptors(), which always closes STDERR_FILENO + 1 and STDERR_FILENO + > 2. However, if it fails at some point after that, then forkedChildProcess() > will attempt to close these same two files again. Fixed by making > forkedChildProcess() no longer attempt to close these two files. > > I first verified the warning by configuring with > --with-extra-cflags=-fanalyzer, and then verified the fix by doing the same. > > Tested by running jdi nsk test. I'll add some more CI testing. This pull request has now been integrated. Changeset: d5d311f0 Author: Chris Plummer <cjplum...@openjdk.org> URL: https://git.openjdk.org/jdk/commit/d5d311f026f69c56a409d856f5e11cdff0526c6c Stats: 9 lines in 1 file changed: 5 ins; 0 del; 4 mod 8361873: [GCC static analyzer] exec_md.c forkedChildProcess potential double 'close' of file descriptor '3' Reviewed-by: jpai, stuefe, mbaesken ------------- PR: https://git.openjdk.org/jdk/pull/26487