[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug classpath/24412] java.nio.channels.FileChannel#tryLock() fails to t
From: |
vadimn at redhat dot com |
Subject: |
[Bug classpath/24412] java.nio.channels.FileChannel#tryLock() fails to throw an OverlappingFileLockException |
Date: |
17 Oct 2005 19:37:11 -0000 |
------- Comment #2 from vadimn at redhat dot com 2005-10-17 19:37 -------
Although I didn't try the test program on the most recent version of
Classpath, I believe the issue is still present.
OverlappingFileLockException is thrown from neither .java, nor .c
code:
|$ find classpath/ -type f | xargs grep -l OverlappingFileLockException
|classpath/ChangeLog-2004
|classpath/ChangeLog-2003
|classpath/java/nio/channels/CVS/Entries
|classpath/java/nio/channels/FileChannel.java
|classpath/java/nio/channels/OverlappingFileLockException.java
Sun's stacktrace seems to suggest that they check for lock overlaps in
sun.nio.ch.FileChannelImpl#checkList. This is probably due to the
fact the following fcntl call succeeds on Linux if called multiple
times within the same process:
fcntl(fd,
F_SETLK,
{type=F_WRLCK,
whence=SEEK_SET,
start=0,
len=9223372036854775807})
Hence the need to implement overlap detection manually rather than
rely on the underlying C library.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24412