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 -volnameJDK-8236282 -ov JDK-8236282.dmg -fs HFS+ -format UDRW
where dmg source folder contains empty test.txt file.
How to reproduce this issue:
1) Download attach DMG image (
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.
hdiutil create -srcfolder dmg -volname
where dmg source folder contains empty test.txt file.
- blocks
-
JDK-8236282 [macos] Find permanent solution to macOS test timeout problem JDK-8235738
- Resolved
- relates to
-
JDK-8169565 (process) Blocking reads from java.lang.Process output streams sometime deadlocks
- Open
-
JDK-8227414 gc/arguments test subprocesses sometimes take a long time to complete
- Closed
-
JDK-8235738 [macos] tools/jpackage tests timeout on macOS
- Resolved