Open agnivade opened 2 years ago
Hi, any progress on this? We still receive sentry crashes for this.
This happens to me too sometimes, I will look into this as I thought it was just me.
I stopped using the min property of the disjunction query, and then this error stopped.
however, it's started happening again.
So again I am looking into it.
We are seeing several crash reports, either equal to the one reported here, or very similar, using Bleve 2.3.8. Some end up crashing in zapx, others in RoaringBitmap:
runtime.boundsError: runtime error: index out of range [4] with length 0
File "github.com/RoaringBitmap/roaring@v1.3.0/roaringarray.go", line 347, in (*roaringArray).getKeyAtIndex
File "github.com/RoaringBitmap/roaring@v1.3.0/roaring.go", line 1382, in AndNot
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 224, in (*PostingsList).iterator
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 155, in (*PostingsList).Iterator
File "github.com/blevesearch/bleve/v2@v2.3.8/index/scorch/snapshot_index.go", line 582, in (*IndexSnapshot).TermFieldReader
File "github.com/blevesearch/bleve/v2@v2.3.8/index/scorch/snapshot_index_tfr.go", line 149, in (*IndexSnapshotTermFieldReader).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_term.go", line 106, in (*TermSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 253, in (*ConjunctionSearcher).advanceChild
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 200, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 218, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 165, in (*BooleanSearcher).advanceNextMust
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 316, in (*BooleanSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 396, in (*BooleanSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 253, in (*ConjunctionSearcher).advanceChild
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 200, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 165, in (*BooleanSearcher).advanceNextMust
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 316, in (*BooleanSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/collector/topn.go", line 205, in (*TopNCollector).Collect
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 551, in (*indexImpl).SearchInContext
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 369, in (*indexImpl).Search
runtime.errorString: runtime error: invalid memory address or nil pointer dereference
File "github.com/RoaringBitmap/roaring@v1.3.0/roaring.go", line 810, in (*Bitmap).GetCardinality
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 243, in (*PostingsList).Count
File "github.com/blevesearch/bleve/v2@v2.3.8/index/scorch/snapshot_index_tfr.go", line 194, in (*IndexSnapshotTermFieldReader).Count
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_term.go", line 77, in (*TermSearcher).Count
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/ordered_searchers_list.go", line 30, in OrderedSearcherList.Less
File "sort/zsortinterface.go", line 12, in insertionSort
File "sort/zsortinterface.go", line 73, in pdqsort
File "sort/sort.go", line 48, in Sort
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 56, in NewConjunctionSearcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/conjunction.go", line 79, in (*ConjunctionQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/match.go", line 169, in (*MatchQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/conjunction.go", line 59, in (*ConjunctionQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/boolean.go", line 133, in (*BooleanQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/conjunction.go", line 59, in (*ConjunctionQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/search/query/boolean.go", line 133, in (*BooleanQuery).Searcher
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 485, in (*indexImpl).SearchInContext
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 369, in (*indexImpl).Search
runtime.errorString: runtime error: integer divide by zero
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 644, in (*PostingsIterator).nextDocNumAtOrAfter
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 537, in (*PostingsIterator).nextAtOrAfter
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 526, in (*PostingsIterator).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/index/scorch/snapshot_index_tfr.go", line 88, in (*IndexSnapshotTermFieldReader).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_term.go", line 89, in (*TermSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 218, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 218, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 246, in (*ConjunctionSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 356, in (*BooleanSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 253, in (*ConjunctionSearcher).advanceChild
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 190, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 165, in (*BooleanSearcher).advanceNextMust
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 316, in (*BooleanSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/collector/topn.go", line 226, in (*TopNCollector).Collect
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 551, in (*indexImpl).SearchInContext
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 369, in (*indexImpl).Search
These come from Sentry, so I don't have much more data, hope it's somewhat useful.
I still get the same issue in Couchbase. I have talked to the team about this and gave them an application to reproduce it, and they did reproduce it. But not sure what's come of it since then (almost a year ago).
We received another crash, bleve -> zapx -> RoaringBitmap, this time in AndCardinality
:
runtime.errorString: runtime error: invalid memory address or nil pointer dereference
github.com/RoaringBitmap/roaring@v1.6.0/roaring.go in (*Bitmap).AndCardinality at line 996
github.com/blevesearch/zapx/v15@v15.3.13/posting.go in (*PostingsList).Count at line 245
github.com/blevesearch/bleve/v2@v2.3.10/index/scorch/snapshot_index_tfr.go in (*IndexSnapshotTermFieldReader).Count at line 194
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_term.go in newTermSearcherFromReader at line 64
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_term.go in NewTermSearcherBytes at line 54
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_term.go in NewTermSearcher at line 45
github.com/blevesearch/bleve/v2@v2.3.10/search/query/term.go in (*TermQuery).Searcher at line 62
github.com/blevesearch/bleve/v2@v2.3.10/search/query/conjunction.go in (*ConjunctionQuery).Searcher at line 60
github.com/blevesearch/bleve/v2@v2.3.10/search/query/match.go in (*MatchQuery).Searcher at line 169
github.com/blevesearch/bleve/v2@v2.3.10/search/query/conjunction.go in (*ConjunctionQuery).Searcher at line 60
github.com/blevesearch/bleve/v2@v2.3.10/search/query/boolean.go in (*BooleanQuery).Searcher at line 134
github.com/blevesearch/bleve/v2@v2.3.10/search/query/conjunction.go in (*ConjunctionQuery).Searcher at line 60
github.com/blevesearch/bleve/v2@v2.3.10/search/query/boolean.go in (*BooleanQuery).Searcher at line 134
github.com/blevesearch/bleve/v2@v2.3.10/index_impl.go in (*indexImpl).SearchInContext at line 499
github.com/blevesearch/bleve/v2@v2.3.10/index_impl.go in (*indexImpl).Search at line 371
We've received a couple more of these. The first:
runtime.errorString: runtime error: integer divide by zero
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 644, in (*PostingsIterator).nextDocNumAtOrAfter
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 537, in (*PostingsIterator).nextAtOrAfter
File "github.com/blevesearch/zapx/v15@v15.3.11/posting.go", line 526, in (*PostingsIterator).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/index/scorch/snapshot_index_tfr.go", line 88, in (*IndexSnapshotTermFieldReader).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_term.go", line 89, in (*TermSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 218, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 218, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 246, in (*ConjunctionSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 356, in (*BooleanSearcher).Advance
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 253, in (*ConjunctionSearcher).advanceChild
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_conjunction.go", line 190, in (*ConjunctionSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 165, in (*BooleanSearcher).advanceNextMust
File "github.com/blevesearch/bleve/v2@v2.3.8/search/searcher/search_boolean.go", line 316, in (*BooleanSearcher).Next
File "github.com/blevesearch/bleve/v2@v2.3.8/search/collector/topn.go", line 226, in (*TopNCollector).Collect
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 551, in (*indexImpl).SearchInContext
File "github.com/blevesearch/bleve/v2@v2.3.8/index_impl.go", line 369, in (*indexImpl).Search
The second:
runtime error: integer divide by zero
github.com/blevesearch/zapx/v15@v15.3.13/posting.go in (*PostingsIterator).nextDocNumAtOrAfterClean at line 747
github.com/blevesearch/zapx/v15@v15.3.13/posting.go in (*PostingsIterator).nextDocNumAtOrAfter at line 632
github.com/blevesearch/zapx/v15@v15.3.13/posting.go in (*PostingsIterator).nextAtOrAfter at line 537
github.com/blevesearch/zapx/v15@v15.3.13/posting.go in (*PostingsIterator).Advance at line 532
github.com/blevesearch/bleve/v2@v2.3.10/index/scorch/snapshot_index_tfr.go in (*IndexSnapshotTermFieldReader).Advance at line 169
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_term.go in (*TermSearcher).Advance at line 109
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_conjunction.go in (*ConjunctionSearcher).advanceChild at line 253
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_conjunction.go in (*ConjunctionSearcher).Next at line 200
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_conjunction.go in (*ConjunctionSearcher).Next at line 218
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_boolean.go in (*BooleanSearcher).advanceNextMust at line 165
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_boolean.go in (*BooleanSearcher).Next at line 316
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_boolean.go in (*BooleanSearcher).Advance at line 396
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_conjunction.go in (*ConjunctionSearcher).advanceChild at line 253
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_conjunction.go in (*ConjunctionSearcher).Next at line 190
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_boolean.go in (*BooleanSearcher).advanceNextMust at line 165
github.com/blevesearch/bleve/v2@v2.3.10/search/searcher/search_boolean.go in (*BooleanSearcher).Next at line 316
github.com/blevesearch/bleve/v2@v2.3.10/search/collector/topn.go in (*TopNCollector).Collect at line 228
github.com/blevesearch/bleve/v2@v2.3.10/index_impl.go in (*indexImpl).SearchInContext at line 580
github.com/blevesearch/bleve/v2@v2.3.10/index_impl.go in (*indexImpl).Search at line 371
Hope that helps?
Sorry to bother you with more issues. We have another Sentry crash, this time in the roaring bitmap library, but it gets called from the zap library.
Looking at the exact line of error, it's here: https://github.com/RoaringBitmap/roaring/blob/e6471ed95f1d549fe1b284310217906a9d62035e/roaring.go#L667. This seems a race condition, or somehow a nil container was passed.