Return-Path: X-Original-To: apmail-lucene-dev-archive@www.apache.org Delivered-To: apmail-lucene-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2940E9E90 for ; Tue, 5 Jun 2012 22:06:42 +0000 (UTC) Received: (qmail 5523 invoked by uid 500); 5 Jun 2012 22:06:40 -0000 Delivered-To: apmail-lucene-dev-archive@lucene.apache.org Received: (qmail 5445 invoked by uid 500); 5 Jun 2012 22:06:40 -0000 Mailing-List: contact dev-help@lucene.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@lucene.apache.org Delivered-To: mailing list dev@lucene.apache.org Received: (qmail 5399 invoked by uid 99); 5 Jun 2012 22:06:40 -0000 Received: from issues-vm.apache.org (HELO issues-vm) (140.211.11.160) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 05 Jun 2012 22:06:40 +0000 Received: from isssues-vm.apache.org (localhost [127.0.0.1]) by issues-vm (Postfix) with ESMTP id 802AC140BEF for ; Tue, 5 Jun 2012 22:06:40 +0000 (UTC) Date: Tue, 5 Jun 2012 22:06:40 +0000 (UTC) From: "Jack Krupansky (JIRA)" To: dev@lucene.apache.org Message-ID: <1003455655.41633.1338934000527.JavaMail.jiratomcat@issues-vm> In-Reply-To: <733617280.41000.1338923723162.JavaMail.jiratomcat@issues-vm> Subject: [jira] [Commented] (LUCENE-4114) Large docID / docvalue size combination produces arithmetic overflow MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/LUCENE-4114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13289772#comment-13289772 ] Jack Krupansky commented on LUCENE-4114: ---------------------------------------- There may be a similar bug at line 345: return data.fillSlice(bytesRef, docID * size, size); And at line 340 in Lucene40StoredFieldsReader: indexStream.seek(HEADER_LENGTH_IDX + docID * 8L); > Large docID / docvalue size combination produces arithmetic overflow > -------------------------------------------------------------------- > > Key: LUCENE-4114 > URL: https://issues.apache.org/jira/browse/LUCENE-4114 > Project: Lucene - Java > Issue Type: Bug > Components: core/codecs > Affects Versions: 4.0, 5.0 > Environment: Ubuntu 10.04 > Sun Java 6 b26 > MultiIndex over six directoryindices with ~80M documents each. > Reporter: Walt Elder > Fix For: 4.0, 5.0 > > Original Estimate: 2h > Remaining Estimate: 2h > > My test case has run across an arithmetic bug in FixedStraightBytesImpl - specifically in the @Override on position(int). The combination of size=32 and docID = 70M produces a negative integer and causes a stacktrace in MMapDirectory.seek(long) which I will post below. I would imagine that this hasn't been hit before because most index shards have less than 70M documents. > That is to say, when asking for the docvalue in a FixedStraightBytes field where the size of values are 32 and the docID can be sufficiently high, an arithmetic overflow occurs in line 359 of FixedStraightBytesImpl.java, causing the method to return a negative value when operating on the first (0th) shard with a baseOffset of 0. This produces an IllegalArgumentException: > Caused by: java.lang.IllegalArgumentException: Seeking to negative position: MMapIndexInput(_7_5_dv.dat in path="/.../_7_dv.cfs" slice=5:2562955684) > at org.apache.lucene.store.MMapDirectory$MMapIndexInput.seek(MMapDirectory.java:396) > at org.apache.lucene.codecs.lucene40.values.FixedStraightBytesImpl$DirectFixedStraightSource.position(FixedStraightBytesImpl.java:359) > at org.apache.lucene.codecs.lucene40.values.DirectSource.getBytes(DirectSource.java:60) > at org.apache.lucene.codecs.lucene40.values.FixedStraightBytesImpl$DirectFixedStraightSource.getBytes(FixedStraightBytesImpl.java:349) > ... -- This message is automatically generated by JIRA. If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org For additional commands, e-mail: dev-help@lucene.apache.org