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

Crash when querying an index using multiple term positions.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: core/index
    • Labels:
      None
    • Environment:

      Operating System: Linux
      Platform: PC

    • Bugzilla Id:
      35626

      Description

      file: MultipleTermPositions.java, line: 201, function: skipTo(int).

      This refers to the source that can currently be downloaded from the lucene site,
      Lucene v. 1.4.3.

      The function peek() returns null (because top() also retruned null). There is no
      check for this, as far as I can understand. The function doc() is called on a
      null-object, which results in a NullPointerException.

      I switched the specified line to this one:

      while(_termPositionsQueue.peek() != null && target >
      _termPositionsQueue.peek().doc())

      This got rid of the crash for me.

        Activity

        Hide
        lucenebugs@danielnaber.de Daniel Naber added a comment -

        Hi Hans Could you attach a small test case that triggers the bug? This way
        I can easily check if the current version of Lucene (from SVN) is also
        affected.

        Show
        lucenebugs@danielnaber.de Daniel Naber added a comment - Hi Hans Could you attach a small test case that triggers the bug? This way I can easily check if the current version of Lucene (from SVN) is also affected.
        Hide
        lucenebugs@danielnaber.de Daniel Naber added a comment -
            • Bug 35668 has been marked as a duplicate of this bug. ***
        Show
        lucenebugs@danielnaber.de Daniel Naber added a comment - Bug 35668 has been marked as a duplicate of this bug. ***
        Hide
        apache.org@scottyallen.com Scotty Allen added a comment -

        I get this same error on the latest from SVN (r219350). I may be able to put
        together a test case in a bit...

        Show
        apache.org@scottyallen.com Scotty Allen added a comment - I get this same error on the latest from SVN (r219350). I may be able to put together a test case in a bit...
        Hide
        apache.org@scottyallen.com Scotty Allen added a comment -

        Created an attachment (id=15692)
        A test case that reproduces this null point exception

        I attached a test case that reproduces this bug. I verified that the proposed
        change fixes this test case, as well.

        Show
        apache.org@scottyallen.com Scotty Allen added a comment - Created an attachment (id=15692) A test case that reproduces this null point exception I attached a test case that reproduces this bug. I verified that the proposed change fixes this test case, as well.
        Hide
        lucenebugs@danielnaber.de Daniel Naber added a comment -

        Thanks, the fix and its test case have been committed.

        Show
        lucenebugs@danielnaber.de Daniel Naber added a comment - Thanks, the fix and its test case have been committed.

          People

          • Assignee:
            java-dev@lucene.apache.org Lucene Developers
            Reporter:
            hans.hjelm@ling.su.se Hans Hjelm
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development