<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    On 12/02/2025 06:13, Shruthi . wrote:<br>
    <blockquote type="cite" cite="mid:SJ0PR15MB4663E34342AC2F9AC8A876AACCFC2@SJ0PR15MB4663.namprd15.prod.outlook.com">
      
      <style type="text/css" style="display:none;">P {margin-top:0;margin-bottom:0;}</style>
      <div class="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="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="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="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>
  </body>
</html>