-
Bug
-
Resolution: Fixed
-
P4
-
None
-
b18
The new test from JDK-8293502 fails frequently, usually at high load. Fails reliably in tier2 testing for me:
$ CONF=linux-x86_64-server-fastdebug make test TEST=java/nio/file/Files/CopyProcFile.java
...
Using source file "/proc/cpuinfo"
Copied 98894 bytes from /proc/cpuinfo
config CopyProcFile.createBufferedCopy(): success
test CopyProcFile.testCopyAndTransfer(CopyProcFile$FHolder@bb8c28f): failure
java.nio.file.NoSuchFileException: bufferedCopy
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:378)
at java.base/java.nio.file.Files.isSameFile(Files.java:1538)
at java.base/java.nio.file.Files.mismatch(Files.java:1590)
at CopyProcFile.testCopyAndTransfer(CopyProcFile.java:168)
The real root cause is that test tries to copy from /proc/cpuinfo and check that copied contents are identical. The failure is obscure, because createBufferedCopy masks the initial copy check result by throwing RuntimeException, which the subsequent catch(Exception) block silently captures and deletes the bufferedCopy. Which means "config CopyProcFile.createBufferedCopy(): success" in the output above is actually misleading.
But /proc/cpuinfo output is not guaranteed to be stable, because it includes CPU frequency. Simple test on my desktop:
$ while true; do cat /proc/cpuinfo > 1; sleep 1; cat /proc/cpuinfo > 2; diff -uwb 1 2; done
--- 1 2022-09-28 13:17:50.905173889 +0200
+++ 2 2022-09-28 13:17:51.929201003 +0200
@@ -5,7 +5,7 @@
model name : AMD Ryzen Threadripper 3970X 32-Core Processor
stepping : 0
microcode : 0x8301025
-cpu MHz : 2263.655
+cpu MHz : 2200.000
cache size : 512 KB
physical id : 0
siblings : 64
$ CONF=linux-x86_64-server-fastdebug make test TEST=java/nio/file/Files/CopyProcFile.java
...
Using source file "/proc/cpuinfo"
Copied 98894 bytes from /proc/cpuinfo
config CopyProcFile.createBufferedCopy(): success
test CopyProcFile.testCopyAndTransfer(CopyProcFile$FHolder@bb8c28f): failure
java.nio.file.NoSuchFileException: bufferedCopy
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.isSameFile(UnixFileSystemProvider.java:378)
at java.base/java.nio.file.Files.isSameFile(Files.java:1538)
at java.base/java.nio.file.Files.mismatch(Files.java:1590)
at CopyProcFile.testCopyAndTransfer(CopyProcFile.java:168)
The real root cause is that test tries to copy from /proc/cpuinfo and check that copied contents are identical. The failure is obscure, because createBufferedCopy masks the initial copy check result by throwing RuntimeException, which the subsequent catch(Exception) block silently captures and deletes the bufferedCopy. Which means "config CopyProcFile.createBufferedCopy(): success" in the output above is actually misleading.
But /proc/cpuinfo output is not guaranteed to be stable, because it includes CPU frequency. Simple test on my desktop:
$ while true; do cat /proc/cpuinfo > 1; sleep 1; cat /proc/cpuinfo > 2; diff -uwb 1 2; done
--- 1 2022-09-28 13:17:50.905173889 +0200
+++ 2 2022-09-28 13:17:51.929201003 +0200
@@ -5,7 +5,7 @@
model name : AMD Ryzen Threadripper 3970X 32-Core Processor
stepping : 0
microcode : 0x8301025
-cpu MHz : 2263.655
+cpu MHz : 2200.000
cache size : 512 KB
physical id : 0
siblings : 64
- relates to
-
JDK-8293502 (fc) FileChannel::transfer methods fail to copy /proc files on Linux
-
- Resolved
-