JDK-8052403 : [TEST_BUG] java/util/logging/CheckZombieLockTest.java fails with NoSuchFileException
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-07-29
  • Updated: 2016-06-13
  • Resolved: 2014-08-19
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u40Fixed 9 b28Fixed
Related Reports
Duplicate :  
Relates :  
Description
from the log file of the run:

----------System.out:(1/39)----------
Writable dir is: /var/tmp/writable-dir
----------System.err:(46/2922)----------
java.nio.file.NoSuchFileException: /var/tmp/writable-dir/a437b1a7-7138-468e-8fb8-4fe4e097c13e.lck
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102)
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107)
	at sun.nio.fs.UnixFileSystemProvider.newFileChannel(UnixFileSystemProvider.java:177)
	at java.nio.channels.FileChannel.open(FileChannel.java:287)
	at java.nio.channels.FileChannel.open(FileChannel.java:335)
	at CheckZombieLockTest.setup(CheckZombieLockTest.java:318)
	at CheckZombieLockTest.main(CheckZombieLockTest.java:69)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)
java.io.IOException: No such file or directory
	at java.io.UnixFileSystem.createFileExclusively(Native Method)
	at java.io.File.createNewFile(File.java:1012)
	at CheckZombieLockTest.createFile(CheckZombieLockTest.java:348)
	at CheckZombieLockTest.checkWritable(CheckZombieLockTest.java:122)
	at CheckZombieLockTest.runTests(CheckZombieLockTest.java:96)
	at CheckZombieLockTest.main(CheckZombieLockTest.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)
WARNING: unable to delete/cleanup writable test directory: /var/tmp/writable-dir
java.io.IOException: Can't create /var/tmp/writable-dir/test.txt
	Unable to run test
	at CheckZombieLockTest.checkWritable(CheckZombieLockTest.java:123)
	at CheckZombieLockTest.runTests(CheckZombieLockTest.java:96)
	at CheckZombieLockTest.main(CheckZombieLockTest.java:77)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:484)
	at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94)
	at java.lang.Thread.run(Thread.java:745)

JavaTest Message: Test threw exception: java.io.IOException: Can't create /var/tmp/writable-dir/test.txt
	Unable to run test
JavaTest Message: shutting down test

STATUS:Failed.`main' threw exception: java.io.IOException: Can't create /var/tmp/writable-dir/test.txt Unable to run test

ILW=MLH=P4
Comments
The test failed in our Nightly testing today, could be the same cause: WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir\\log.log WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir java.lang.RuntimeException: Test failed: should have been able to create FileHandler for %t/writable-dir/log.log in writable directory. at CheckZombieLockTest.createFileHandler(CheckZombieLockTest.java:139) Failure page: http://aurora.ru.oracle.com/functional/faces/RunDetails.xhtml?names=560346.JAVASE.NIGHTLY.VM.Comp_Baseline-NonTiered.2014-08-14-156 Log: http://scaaa008.us.oracle.com:9502/runs%2F560346.JAVASE.NIGHTLY.VM.Comp_Baseline-NonTiered.2014-08-14-156/results/workDir/java/util/logging/CheckZombieLockTest.jtr RULE java/util/logging/CheckZombieLockTest.java Exception java.lang.RuntimeException: Test failed: should have been able to create FileHandler for %t/writable-dir/log.log in writable directory. RULE java/util/logging/CheckZombieLockTest.java Exception java.nio.file.AccessDeniedException: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck
15-08-2014

My analysis is that there are probably two tests running concurrently: CheckZombieLockTest.java and CheckLockLocationTest.java. I suspect that CheckZombieLockTest finds the writable-dir created by CheckLockLocationTest, but CheckLockLocationTest deletes it just before CheckZombieLockTest attempts to test whether file locking is supported - which would account for the NoSuchFileException thrown by FileChannel.open(... CREATE_NEW) (it's probably because the directory in which the file should have been created is no longer there). I'm going to change CheckZombieLockTest.java so that it uses a different name than CheckLockLocationTest.java for its writable-dir. Hopefully it should make these failures go away.
13-08-2014

http://cr.openjdk.java.net/~dfuchs/webrev_8052403/
13-08-2014

I was able to reproduce the test failure on my machine with the following command: jtreg -verbose:all -jdk $MYJDK -conc:12 jdk/test/java/util/logging/Check* This lets me think that the issue is indeed caused by the two Check* tests running concurrently. Changing them to use different writable dirs should then fix the issue.
13-08-2014

Maybe related? ----------System.err:(31/2137)*---------- java.io.IOException: Result too large at java.io.WinNTFileSystem.createFileExclusively(Native Method) at java.io.File.createNewFile(File.java:1012) at CheckZombieLockTest.createFile(CheckZombieLockTest.java:348) at CheckZombieLockTest.testFileHandlerClose(CheckZombieLockTest.java:161) at CheckZombieLockTest.runTests(CheckZombieLockTest.java:98) at CheckZombieLockTest.main(CheckZombieLockTest.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:484) at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94) at java.lang.Thread.run(Thread.java:745) WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir\\log.log WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck WARNING: unable to delete/cleanup writable test directory: C:\\Cygwin\\tmp\\writable-dir java.io.IOException: Can't create fake lock file: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck at CheckZombieLockTest.testFileHandlerClose(CheckZombieLockTest.java:162) at CheckZombieLockTest.runTests(CheckZombieLockTest.java:98) at CheckZombieLockTest.main(CheckZombieLockTest.java:77) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:484) at com.sun.javatest.regtest.MainWrapper$MainThread.run(MainWrapper.java:94) at java.lang.Thread.run(Thread.java:745) JavaTest Message: Test threw exception: java.io.IOException: Can't create fake lock file: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck JavaTest Message: shutting down test STATUS:Failed.`main' threw exception: java.io.IOException: Can't create fake lock file: C:\\Cygwin\\tmp\\writable-dir\\log.log.lck
06-08-2014