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: [email protected]
For additional commands, e-mail: [email protected]