Uploaded image for project: 'Lucene - Core'
  1. Lucene - Core
  2. LUCENE-3567

NPE from SegmentTermDocs.<init> from SegmentReader.termDocs

Details

    • New

    Description

      Occasionally NetBeans IDE users receive an NPE from Lucene 3.0.3 inside Maven Indexer (currently 4.1.2) code:

      java.lang.NullPointerException
      	at org.apache.lucene.index.SegmentTermDocs.<init>(SegmentTermDocs.java:52)
      	at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:963)
      	at org.apache.lucene.index.IndexReader.termDocs(IndexReader.java:813)
      	at org.apache.lucene.index.SegmentReader.termDocs(SegmentReader.java:956)
      	at org.apache.lucene.search.TermQuery$TermWeight.scorer(TermQuery.java:74)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:210)
      	at org.apache.lucene.search.IndexSearcher.search(IndexSearcher.java:170)
      	at org.apache.lucene.search.Searcher.search(Searcher.java:98)
      	at org.apache.lucene.search.Searcher.search(Searcher.java:108)
      	at org.apache.maven.index.DefaultIndexerEngine.getOldDocument(DefaultIndexerEngine.java:158)
              ....
      

      Working backwards, parent.core.getTermsReader() is null, which means SegmentReaders.CoreReaders.decRef was called, which means SegmentReader.doClose was called, which means IndexReader.doClose was called, which I suppose means something called IndexReader.decRef prematurely. But plenty of things can call IndexReader.decRef and it is not clear how to track down the root cause.

      Note that SegmentReader.termDocs first calls ensureOpen(), which is presumably supposed to ensure that decRef had not been called too many times; perhaps this assertion did not work?

      Downstream bug, for reference: https://netbeans.org/bugzilla/show_bug.cgi?id=201057

      Attachments

        Activity

          People

            Unassigned Unassigned
            jglick@netbeans.org Jesse Glick
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: