[jira] [Commented] (LUCENE-5160) NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions
[ https://issues.apache.org/jira/browse/LUCENE-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13735925#comment-13735925 ] ASF subversion and git services commented on LUCENE-5160: - Commit 1512728 from [~rcmuir] in branch 'dev/trunk' [ https://svn.apache.org/r1512728 ] LUCENE-5160: move CHANGES entry to the correct version NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions Key: LUCENE-5160 URL: https://issues.apache.org/jira/browse/LUCENE-5160 Project: Lucene - Core Issue Type: Bug Affects Versions: 5.0, 4.4 Reporter: Grant Ingersoll Assignee: Grant Ingersoll Fix For: 5.0, 4.5 Attachments: LUCENE-5160.patch Around line 190 of NIOFSDirectory, the loop to read in bytes doesn't properly handle the -1 condition that can be returned from FileChannel.read(). If it returns -1, then it will move the file pointer back and you will enter an infinite loop. SimpleFSDirectory displays the same characteristics, although I have only seen the issue on NIOFSDirectory. The code in question from NIOFSDirectory: {code} try { while (readLength 0) { final int limit; if (readLength chunkSize) { // LUCENE-1566 - work around JVM Bug by breaking // very large reads into chunks limit = readOffset + chunkSize; } else { limit = readOffset + readLength; } bb.limit(limit); int i = channel.read(bb, pos); pos += i; readOffset += i; readLength -= i; } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-5160) NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions
[ https://issues.apache.org/jira/browse/LUCENE-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13733865#comment-13733865 ] Uwe Schindler commented on LUCENE-5160: --- This is a bug, which never is hit by lucene because we never read sequentially until end of file. +1 to fix this. Theoretically to comply with MMapDirectory it should throw EOFException if it gets -1, because Lucene code should not read beyond file end. NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions Key: LUCENE-5160 URL: https://issues.apache.org/jira/browse/LUCENE-5160 Project: Lucene - Core Issue Type: Bug Affects Versions: 5.0, 4.4 Reporter: Grant Ingersoll Around line 190 of NIOFSDirectory, the loop to read in bytes doesn't properly handle the -1 condition that can be returned from FileChannel.read(). If it returns -1, then it will move the file pointer back and you will enter an infinite loop. SimpleFSDirectory displays the same characteristics, although I have only seen the issue on NIOFSDirectory. The code in question from NIOFSDirectory: {code} try { while (readLength 0) { final int limit; if (readLength chunkSize) { // LUCENE-1566 - work around JVM Bug by breaking // very large reads into chunks limit = readOffset + chunkSize; } else { limit = readOffset + readLength; } bb.limit(limit); int i = channel.read(bb, pos); pos += i; readOffset += i; readLength -= i; } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-5160) NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions
[ https://issues.apache.org/jira/browse/LUCENE-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13733912#comment-13733912 ] Uwe Schindler commented on LUCENE-5160: --- +1 to commit. Looks good. Writing a test is a bit hard. MMapDirectory is not affected as it already has a check for the length of the MappedByteBuffers. NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions Key: LUCENE-5160 URL: https://issues.apache.org/jira/browse/LUCENE-5160 Project: Lucene - Core Issue Type: Bug Affects Versions: 5.0, 4.4 Reporter: Grant Ingersoll Assignee: Grant Ingersoll Attachments: LUCENE-5160.patch Around line 190 of NIOFSDirectory, the loop to read in bytes doesn't properly handle the -1 condition that can be returned from FileChannel.read(). If it returns -1, then it will move the file pointer back and you will enter an infinite loop. SimpleFSDirectory displays the same characteristics, although I have only seen the issue on NIOFSDirectory. The code in question from NIOFSDirectory: {code} try { while (readLength 0) { final int limit; if (readLength chunkSize) { // LUCENE-1566 - work around JVM Bug by breaking // very large reads into chunks limit = readOffset + chunkSize; } else { limit = readOffset + readLength; } bb.limit(limit); int i = channel.read(bb, pos); pos += i; readOffset += i; readLength -= i; } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-5160) NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions
[ https://issues.apache.org/jira/browse/LUCENE-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13733914#comment-13733914 ] ASF subversion and git services commented on LUCENE-5160: - Commit 1512011 from [~gsingers] in branch 'dev/trunk' [ https://svn.apache.org/r1512011 ] LUCENE-5160: check for -1 return conditions in file reads NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions Key: LUCENE-5160 URL: https://issues.apache.org/jira/browse/LUCENE-5160 Project: Lucene - Core Issue Type: Bug Affects Versions: 5.0, 4.4 Reporter: Grant Ingersoll Assignee: Grant Ingersoll Attachments: LUCENE-5160.patch Around line 190 of NIOFSDirectory, the loop to read in bytes doesn't properly handle the -1 condition that can be returned from FileChannel.read(). If it returns -1, then it will move the file pointer back and you will enter an infinite loop. SimpleFSDirectory displays the same characteristics, although I have only seen the issue on NIOFSDirectory. The code in question from NIOFSDirectory: {code} try { while (readLength 0) { final int limit; if (readLength chunkSize) { // LUCENE-1566 - work around JVM Bug by breaking // very large reads into chunks limit = readOffset + chunkSize; } else { limit = readOffset + readLength; } bb.limit(limit); int i = channel.read(bb, pos); pos += i; readOffset += i; readLength -= i; } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org
[jira] [Commented] (LUCENE-5160) NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions
[ https://issues.apache.org/jira/browse/LUCENE-5160?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13733921#comment-13733921 ] ASF subversion and git services commented on LUCENE-5160: - Commit 1512016 from [~gsingers] in branch 'dev/branches/branch_4x' [ https://svn.apache.org/r1512016 ] LUCENE-5160: merge from trunk NIOFSDirectory, SimpleFSDirectory (others?) don't properly handle valid file and FileChannel read conditions Key: LUCENE-5160 URL: https://issues.apache.org/jira/browse/LUCENE-5160 Project: Lucene - Core Issue Type: Bug Affects Versions: 5.0, 4.4 Reporter: Grant Ingersoll Assignee: Grant Ingersoll Attachments: LUCENE-5160.patch Around line 190 of NIOFSDirectory, the loop to read in bytes doesn't properly handle the -1 condition that can be returned from FileChannel.read(). If it returns -1, then it will move the file pointer back and you will enter an infinite loop. SimpleFSDirectory displays the same characteristics, although I have only seen the issue on NIOFSDirectory. The code in question from NIOFSDirectory: {code} try { while (readLength 0) { final int limit; if (readLength chunkSize) { // LUCENE-1566 - work around JVM Bug by breaking // very large reads into chunks limit = readOffset + chunkSize; } else { limit = readOffset + readLength; } bb.limit(limit); int i = channel.read(bb, pos); pos += i; readOffset += i; readLength -= i; } {code} -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators For more information on JIRA, see: http://www.atlassian.com/software/jira - To unsubscribe, e-mail: dev-unsubscr...@lucene.apache.org For additional commands, e-mail: dev-h...@lucene.apache.org