JDK-6338434 : (fc) File locks not unitary on Unix
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.nio
  • Affected Version: 1.4.0
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: solaris
  • CPU: generic
  • Submitted: 2005-10-18
  • Updated: 2010-04-02
  • Resolved: 2005-11-29
Related Reports
Duplicate :  
Description
If you lock a byte range, call it L1, and then lock another partly-overlapping
byte range, L2, and, finally, unlock L2, the kernel will release the lock on
the subrange of L1 that was overlapped by L2, thereby allowing other programs
to access that subrange in violation of L1.

Reproducible on Solaris and Linux with the attached program; should not be
reproducible on Windows.

Implementing non-overlapping file locks would solve this problem.

Comments
EVALUATION The overlapping lock check was implemented in b63 so we can close this bug.
29-11-2005

EVALUATION If the file lock implementation is updated to perform the specified JVM-wide overlap check then this issue will go away.
20-10-2005