RFR: 8361873: [GCC static analyzer] exec_md.c forkedChildProcess potential double 'close' of file descriptor '3' [v3]
Jaikiran Pai
jpai at openjdk.org
Mon Jul 28 16:25:53 UTC 2025
On Mon, 28 Jul 2025 16:18:44 GMT, Chris Plummer <cjplummer at 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.
>
> Chris Plummer has updated the pull request incrementally with one additional commit since the last revision:
>
> Update comment
Thank you Chris for the update. This looks good to me.
-------------
Marked as reviewed by jpai (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/26487#pullrequestreview-3063650779
More information about the serviceability-dev
mailing list