lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrian Nistor (JIRA)" <>
Subject [jira] [Created] (LUCENE-3066) NullPointerException when calling sizeInBytes and setHasVectors concurrently.
Date Tue, 03 May 2011 20:50:03 GMT
NullPointerException when calling sizeInBytes and setHasVectors concurrently.

                 Key: LUCENE-3066
             Project: Lucene - Java
          Issue Type: Bug
    Affects Versions: 3.1
         Environment: java 1.6.0_24 
Ubuntu 10.10
            Reporter: Adrian Nistor


I am encountering a NullPointerException when using 
org.apache.lucene.index.SegmentInfo. It appears in version 3.1.0 and also in 
revision 1099085 (May 3rd 2011).

The NullPointerException is thrown by SegmentInfo.sizeInBytes(false) when 
calling SegmentInfo.sizeInBytes(false) and SegmentInfo.setHasVectors(true) in 
parallel. When these methods are called sequentially, they do not throw any 

I have attached a test that exposes this problem. If you set ExposeBug = true,
the methods are called concurrently and you get the NullPointerException. If you
set  ExposeBug = false, the methods are called sequentially, and there is no
exception. Note that, in the sequential version, the methods are called many
times (just like in the parallel version), and in different orders (just like
in the parallel version).

The concurrent test (ExposeBug = true) always throws NullPointerException 
under heavy load (ManyIterations = 100000000). Under small load (e.g., if you
set ManyIterations = 10), the NullPointerException will not manifest. I suppose
you need a certain thread interleaving for the NullPointerException to happen,
and thus you need the heavy load.

Is this a bug? Is there a patch for it?



This message is automatically generated by JIRA.
For more information on JIRA, see:

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

View raw message