lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <trej...@trypticon.org>
Subject Weird corruption symptom, not making sense
Date Mon, 16 Jan 2017 22:27:27 GMT
I have this thing where our UninvertingReader is getting an
ArrayIndexOutOfBoundsException in production. I'm sure the index is
corrupt, but I tried investigating the code and it still seems a bit
odd.

Caused by: java.lang.ArrayIndexOutOfBoundsException: -48116
at org.apache.lucene.util.PagedBytes$Reader.fill(PagedBytes.java:118)
at OurFieldCacheImpl.BinaryDocValuesImpl.get(SourceFile:844)

In BinaryDocValuesImpl :

    return new BinaryDocValues()
    {
        @Override
        public BytesRef get(int docID)
        {
            int pointer = (int) docToOffset.get(docID);
            if (pointer == 0) {
                term.length = 0;
            } else {
                bytes.fill(term, pointer);
            }
            return term;
        }
    };

So "pointer" is the negative value presumably? Implying that somehow a
negative value got into the docToOffset mappings.
The value it's putting in comes from:

    long pointer = bytes.copyUsingLengthPrefix(term);
    postingsEnum = termsEnum.postings(postingsEnum, PostingsEnum.NONE);
    while (true) {
        int docID = postingsEnum.nextDoc();
        if (docID == DocIdSetIterator.NO_MORE_DOCS) {
            break;
        }
        docToOffset.set(docID, pointer);
    }

So it seems like bytes.copyUsingLengthPrefix can return a negative
value? But I looked in PagedBytes and couldn't see an obvious way to
get a negative value.

Is it possible some kind of overflow is happening here?

TX

---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message