lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Trejkaz <>
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

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

In BinaryDocValuesImpl :

    return new BinaryDocValues()
        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) {
        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?


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message