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

AutomatonQuery.hashCode is not thread safe

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.7.1, 4.8, 6.0
    • Component/s: None
    • Labels:
      None
    • Lucene Fields:
      New

      Description

      This hashCode is implemented based on #states and #transitions.

      These methods use getNumberedStates() though, which may oversize itself during construction and then "size down" when its done. But numberedStates is prematurely set (before its "ready"), which can cause a hashCode call from another thread to see a corrupt state... causing things like NPEs from null states and other strangeness. I don't think we should set this variable until its "finished".

        Attachments

        1. LUCENE-5532.patch
          9 kB
          Robert Muir
        2. LUCENE-5532.patch
          9 kB
          Robert Muir

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              rcmuir Robert Muir
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: