Lucene - Core
  1. Lucene - Core
  2. LUCENE-4298

Infinite recursion in MultiFields.getTermDocsEnum(IndexReader r, Bits liveDocs, String field, BytesRef term)

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 4.0-BETA
    • Fix Version/s: 4.0, 6.0
    • Component/s: core/index
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      The function calls itself:

      public static DocsEnum getTermDocsEnum(IndexReader r, Bits liveDocs, String field, BytesRef term) throws IOException

      { return getTermDocsEnum(r, liveDocs, field, term); }

      The more conservative approach is to pass DocsEnum.FLAG_FREQS as last parameter so we can call the getTermDocsEnum(IndexReader r, Bits liveDocs, String field, BytesRef term, int flags).

      1. LUCENE-4298.patch
        2 kB
        Robert Muir
      2. LUCENE-4298.patch
        0.7 kB
        Alberto Paro

        Activity

        Hide
        Alberto Paro added a comment -

        Fix for infinite recursion.

        Show
        Alberto Paro added a comment - Fix for infinite recursion.
        Hide
        Robert Muir added a comment -

        Thanks Alberto: I see the problem, that the method is completely untested!

        https://builds.apache.org/job/Lucene-trunk/2016/clover-report/org/apache/lucene/index/MultiFields.html

        Nothing really uses this: e.g. SlowCompositeReaderWrapper just pulls from the MultiTermsEnum.

        So we should add a test for this sugar method.

        Show
        Robert Muir added a comment - Thanks Alberto: I see the problem, that the method is completely untested! https://builds.apache.org/job/Lucene-trunk/2016/clover-report/org/apache/lucene/index/MultiFields.html Nothing really uses this: e.g. SlowCompositeReaderWrapper just pulls from the MultiTermsEnum. So we should add a test for this sugar method.
        Hide
        Robert Muir added a comment -

        Updated Alberto's patch with a test.

        Show
        Robert Muir added a comment - Updated Alberto's patch with a test.
        Hide
        Robert Muir added a comment -

        Thanks Alberto!

        Show
        Robert Muir added a comment - Thanks Alberto!
        Hide
        Uwe Schindler added a comment -

        Closed after release.

        Show
        Uwe Schindler added a comment - Closed after release.

          People

          • Assignee:
            Unassigned
            Reporter:
            Alberto Paro
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 1h
              1h
              Remaining:
              Remaining Estimate - 1h
              1h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development