Skip to content

index out of range panic #142

@KaniuBillows

Description

@KaniuBillows

Unable to reproduce through unit test for the time being, but it does exist in my application. I write a batch of documents to bluge through Batch, then query them and delete them. Then write new documents, keep looping. My program seems to crash randomly.

panic: runtime error: index out of range [559] with length 4

goroutine 13220 [running]:
github.com/blugelabs/bluge/index.(*segmentMerge).ProcessSegmentNow(0xc01e152330, 0xc001cf5108?, 0xc01a97c120, 0xc013d49cd8?)
	/root/go/pkg/mod/github.com/seafileltd/[email protected]/index/merge.go:272 +0x11c
github.com/blugelabs/bluge/index.(*Writer).introduceMerge(0xc002086480, 0xc01e152330, 0x66)
	/root/go/pkg/mod/github.com/seafileltd/[email protected]/index/introducer.go:261 +0x1e5
github.com/blugelabs/bluge/index.(*Writer).introducerLoop(0xc002086480, 0xc001c85800, 0xc001c858c0, 0xc001c85980, 0xc00bf50300, 0xc000482f98?)
	/root/go/pkg/mod/github.com/seafileltd/[email protected]/index/introducer.go:61 +0x24f
created by github.com/blugelabs/bluge/index.OpenWriter in goroutine 13055
	/root/go/pkg/mod/github.com/seafileltd/[email protected]/index/writer.go:127 +0x6b8

After reading the code, I found that this is related to cleaning up the old document when merging the segments, but I passed the unit test and failed to reproduce it. I really don't understand why it is accessed out of bounds, which may be related to the maintenance of bitmap?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions