Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8236825

Reading output from "hdiutil attach" using ProcessBuilder/Process might hang

    Details

    • Type: Bug
    • Status: Open
    • Priority: P3
    • Resolution: Unresolved
    • Affects Version/s: 11, 14, 15
    • Fix Version/s: tbd
    • Component/s: core-libs
    • Labels:
      None
    • Environment:

      OS X

    • Subcomponent:
    • Understanding:
      Cause Known
    • OS:
      os_x

      Description

      This issue was discovered while working on JDK-8235738. We did workaround for this issue by waiting for process termination before reading output. So, far this issue is only reproducible when executing "hdiutil attach test.dmg -verbose -mountroot test" command. I was able to reproduce it with JDK 11 and 14 using provided repro case.

      How to reproduce this issue:
      1) Download attach DMG image (JDK-8236282.dmg).
      2) Run attach jar file (source code also provided) with following arguments:
      java -jar JavaApplication.jar false 1
      Problem is that execution time takes long time (~16 seconds) and if repeated in the loop for many times it might hang for longer time. Second argument is how many times execute attach/detach loop.
      Execution time: 16814 ms

      Running:
      java -jar JavaApplication.jar true 1
      Execution time: 986 ms
      In this case we will wait for process to exit before reading output.

      JDK-8236282.dmg was generated using following command:
      hdiutil create -srcfolder dmg -volname JDK-8236282 -ov JDK-8236282.dmg -fs HFS+ -format UDRW
      where dmg source folder contains empty test.txt file.

        Attachments

        1. Executor.java
          4 kB
        2. JavaApplication.jar
          11 kB
        3. JavaApplication.java
          2 kB
        4. JDK-8236282.dmg
          993 kB

          Issue Links

            Activity

              People

              • Assignee:
                rriggs Roger Riggs
                Reporter:
                almatvee Alexander Matveev
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated: