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

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

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • tbd
    • 11, 14, 15
    • core-libs
    • None
    • OS X

      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.

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

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

              Created:
              Updated:
              Resolved: