JDK-8148972 : java/util/logging/CheckZombieLockTest.java fails with "Unexpected lock files found"
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.util.logging
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-02-03
  • Updated: 2018-09-11
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.
Other
tbdUnresolved
Related Reports
Relates :  
Relates :  
Relates :  
Description
The test fails with the following exception:

----------System.err:(18/1196)----------
WARNING: unable to delete/cleanup writable test directory: /tmp/writable-lockfile-dir
java.lang.RuntimeException: Unexpected lock files found: []
	/tmp/writable-lockfile-dir/log.log.lck should not have been reused
	at CheckZombieLockTest.testFileHandlerReuse(CheckZombieLockTest.java:257)
	at CheckZombieLockTest.runTests(CheckZombieLockTest.java:105)
	at CheckZombieLockTest.main(CheckZombieLockTest.java:78)
	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:520)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:92)
	at java.lang.Thread.run(Thread.java:804)

Comments
There have been more recent sighting: http://spbef16.ru.oracle.com:9502/runs/01545/1545217.RBT/1545217.RBT-1710/results/workDir/java/util/logging/CheckZombieLockTest.jtr This might be an issue with a reference garbage collected too early - I will need to take a look. Possibly FileChannel fc at line 244 should be kept & closed in the finally clause, and a reachability fence should be added for handler2.
04-08-2016

Please keep me in the loop if you see this test failing again. I'll have a look, but the warning: WARNING: unable to delete/cleanup writable test directory: /tmp/writable-lockfile-dir is not supposed to happen, and if the temporary dir cannot be cleaned then it's no wonder that the test fails. So the real question is why this directory could not be removed. Causes might be: 1. user has not rights to write in /tmp 2. a previous run of the test was made with super-user privileges, and interrupted violently (kill -9) leaving a directory belonging to root that the next user could not remove. 3. test is run concurrently (two users running the test on the same machine) One possibility to reduce the possible occurrences of such a failure if caused by 1. or 2. would be to try to assign rwx mode to all after creating the directory in the test, making sure that possible left over can be deleted at the next run. If the failure is caused by 3. then nothing will help. This test is *not* designed to run concurrently.
04-02-2016