<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Alan,<br>
<br>
Reordering <code>preClose()</code> in AIX resolves the customer issue. We have validated the fix, and the customer has confirmed it as well.<br>
<br>
Thanks<br>
Shruthi</div>
<div id="appendonsend"></div>
<div style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Alan Bateman <alan.bateman@oracle.com><br>
<b>Sent:</b> Thursday, February 13, 2025 10:20 PM<br>
<b>To:</b> Shruthi . <Shruthi.Shruthi1@ibm.com>; net-dev@openjdk.org <net-dev@openjdk.org><br>
<b>Cc:</b> Syed Moinudeen <smoinud1@in.ibm.com><br>
<b>Subject:</b> [EXTERNAL] Re: Suggestion needed to port the fix to JDK17 and JDK11</font>
<div> </div>
</div>
<div>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; height:0px; max-height:0px; opacity:0; overflow:hidden">
On 12/02/2025 06: 13, Shruthi . wrote: We discussed the issue with AIX OS team to get their input as this issue is happening only in AIX platform. Update from AIX OS dev team: A thread gets stuck in dup2() while duplicating a file descriptor</div>
<div style="display:none!important; display:none; visibility:hidden; font-size:1px; color:#ffffff; line-height:1px; max-height:0px; opacity:0; overflow:hidden">
</div>
<style>
<!--
#x_pfptBannerl0kf06w
        {display:block!important;
        visibility:visible!important;
        opacity:1!important;
        background-color:#D0D8DC!important;
        max-width:none!important;
        max-height:none!important}
-->
</style>On 12/02/2025 06:13, Shruthi
 . wrote:<br>
<blockquote type="cite"><style type="text/css" style="display:none">
<!--
p
        {margin-top:0;
        margin-bottom:0}
-->
</style>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
We discussed the issue with AIX OS team to get their input as this issue is happening only in AIX platform. Update from AIX OS dev team: A thread gets stuck in dup2() while duplicating a file descriptor that is already being used by two other threads (one for
 reading, one for writing). The writer thread does not write or close the FIFO, causing the reader to wait indefinitely, which blocks dup2(). Also he is saying that we cannot change OS side as it may break or change its existing behavior which other existing
 applications may be depending on.</div>
<div class="x_elementToProof" style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
Can we apply the previously proposed fix at java level(reordering the <code style="font-family:Aptos,Aptos_EmbeddedFont,Aptos_MSFontService,Calibri,Helvetica,sans-serif">
preClose</code><code>()</code> method) while adding an AIX-specific check to ensure it doesn’t affect other platforms? Or do you have any alternative suggestions?<br>
<br>
<span style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace">            if (!tryClose()) {</span></div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                long th = thread;</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                if (th != 0) {</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                    if (!AIX.isAIX)</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                        nd.preClose(fd);</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                    NativeThread.signal(th);</div>
<div class="x_elementToProof" style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                    if (AIX.isAIX)</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                        nd.preClose(fd);</div>
<div style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
                }</div>
<div class="x_elementToProof" style="font-family:"Aptos Mono",Aptos_EmbeddedFont,Aptos_MSFontService,monospace; font-size:12pt; color:rgb(0,0,0)">
            }</div>
</blockquote>
<br>
Are you sure this really fixes the issue on AIX? It means a reader or writer may be signalled before the syscall, is the signal missed or are you saying that it queues up on AIX? If it missed then the close will block in dup2 as before.<br>
<br>
-Alan<br>
</div>
</body>
</html>