NullPointerException when calling sizeInBytes and setHasVectors concurrently.
-----------------------------------------------------------------------------
Key: LUCENE-3066
URL: https://issues.apache.org/jira/browse/LUCENE-3066
Project: Lucene - Java
Issue Type: Bug
Affects Versions: 3.1
Environment: java 1.6.0_24
Ubuntu 10.10
Reporter: Adrian Nistor
Attachments: Test.java
Hi,
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
exception.
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?
Thanks!
Adrian
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]