Skip to content

zapx: Code indexer crashes gitea on i386/x86 with "panic: unaligned 64-bit atomic operation" #23617

Closed
@sebastianertz

Description

@sebastianertz

Description

On an i386 system gitea 1.18.5 runs perfectly.
Version 1.19.0 crashes when indexing code.
#22279 #23274 #22481 (comment)

zapx v15.3.9 fixes the problem
blevesearch/zapx@67addef

Gitea Version

1.19.0

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

panic: unaligned 64-bit atomic operation

goroutine 1508 [running]:
runtime/internal/atomic.panicUnaligned()
	/usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x2d
runtime/internal/atomic.Xadd64(0x127aa03c, 0x4a)
	/usr/local/go/src/runtime/internal/atomic/atomic_386.s:125 +0x11
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).incrementBytesWritten(...)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/contentcoder.go:114
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).flushContents(0x127aa000)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/contentcoder.go:143 +0x2fe
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).Close(...)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/contentcoder.go:110
github.com/blevesearch/zapx/v15.(*interim).writeDicts(0x110bf0e0)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/new.go:803 +0x150f
github.com/blevesearch/zapx/v15.(*interim).convert(0x110bf0e0)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/new.go:277 +0x2ff
github.com/blevesearch/zapx/v15.(*ZapPlugin).newWithChunkMode(0xd839e74, {0x116be100, 0x10, 0x10}, 0x402)
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/new.go:72 +0x18b
github.com/blevesearch/zapx/v15.(*ZapPlugin).New(0xd839e74, {0x116be100, 0x10, 0x10})
	/go/pkg/mod/github.com/blevesearch/zapx/[email protected]/new.go:47 +0x43
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).Batch(0xed76c00, 0xf952380)
	/go/pkg/mod/github.com/blevesearch/bleve/[email protected]/index/scorch/scorch.go:412 +0x5fe
github.com/blevesearch/bleve/v2.(*indexImpl).Batch(0x12076460, 0xf98eb80)
	/go/pkg/mod/github.com/blevesearch/bleve/[email protected]/index_impl.go:310 +0xa0
code.gitea.io/gitea/modules/indexer/bleve.(*FlushingBatch).Flush(0x126edd5c)
	/source/modules/indexer/bleve/batch.go:52 +0x32
code.gitea.io/gitea/modules/indexer/bleve.(*FlushingBatch).flushIfFull(0x11c49d5c)
	/source/modules/indexer/bleve/batch.go:47 +0x5a
code.gitea.io/gitea/modules/indexer/bleve.(*FlushingBatch).Index(0x11c49d5c, {0x11381ed8, 0x13}, {0xa4ab980, 0x113b1ac0})
	/source/modules/indexer/bleve/batch.go:34 +0x6c
code.gitea.io/gitea/modules/indexer/code.(*BleveIndexer).addUpdate(0xfe7ff10, {0xbecb1cc, 0xed69970}, {0xbec9fd0, 0x104791a0}, 0x1047a990, {0xf1bfc00, 0x28}, {{0x1047eb10, 0x10}, ...}, ...)
	/source/modules/indexer/code/bleve.go:231 +0x606
code.gitea.io/gitea/modules/indexer/code.(*BleveIndexer).Index(0xfe7ff10, {0xbecb1cc, 0xed69970}, 0x1018bb00, {0xf1bfc00, 0x28}, 0x10580600)
	/source/modules/indexer/code/bleve.go:300 +0x3f4
code.gitea.io/gitea/modules/indexer/code.(*wrappedIndexer).Index(0xfb3ab70, {0xbecb1cc, 0xed69970}, 0x1018bb00, {0xf1bfc00, 0x28}, 0x10580600)
	/source/modules/indexer/code/wrapped.go:84 +0x7d
code.gitea.io/gitea/modules/indexer/code.index({0xbecb1cc, 0xed69970}, {0xbece788, 0xfb3ab70}, 0x8d)
	/source/modules/indexer/code/indexer.go:106 +0x148
code.gitea.io/gitea/modules/indexer/code.Init.func2({0xf9faa00, 0x14, 0x14})
	/source/modules/indexer/code/indexer.go:156 +0x1e2
code.gitea.io/gitea/modules/queue.NewByteFIFOUniqueQueue.func1({0xf9faa00, 0x14, 0x14})
	/source/modules/queue/queue_bytefifo.go:398 +0x3e
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0x12074180, {0xbecb2cc, 0xf98e300})
	/source/modules/queue/workerpool.go:593 +0xa04
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1()
	/source/modules/queue/workerpool.go:311 +0x5d
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
	/source/modules/queue/workerpool.go:309 +0x25

Git Version

No response

Operating System

No response

How are you running Gitea?

Self hosted, binary from https://dl.gitea.org/gitea/1.19.0/

Database

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    type/bugtype/upstreamThis is an issue in one of Gitea's dependencies and should be reported there

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions