Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

panic: unaligned 64-bit atomic operation when opening pull requests or issues #22481

Closed
watsom27 opened this issue Jan 17, 2023 · 3 comments
Closed
Labels
Milestone

Comments

@watsom27
Copy link

Description

After upgrading to v1.18 recently gitea now crashes when opening issues or pull requests.

This results in a This site cant be reached screen in Chrome, and webhooks not being sent as expected (and probably more stuff behind the scenes)

Gitea Version

v1.18

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

https://gist.github.com/watsom27/96a8b44f12e07ed65b911c4ce2be522e

Screenshots

No response

Git Version

No response

Operating System

Linux

How are you running Gitea?

Running from a linux binary on an Ubuntu t2.micro EC2 instance.

The binary is started as a linux service, so auto-restarts when this crash happens

Database

MySQL

@zeripath
Copy link
Contributor

We need to update:

gitea/go.mod

Line 276 in 9edf80f

replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix

to

 replace github.com/blevesearch/zapx/v15 v15.3.6 => github.com/zeripath/zapx/v15 v15.3.6-alignment-fix-2

and then go mod tidy etc. to update the go.sum

@zeripath zeripath added this to the 1.18.1 milestone Jan 17, 2023
zeripath pushed a commit that referenced this issue Jan 17, 2023
@zeripath
Copy link
Contributor

Fixed by #22485

@eladyn
Copy link
Contributor

eladyn commented Mar 21, 2023

Not sure if I should open a new issue (feel free to create one from this comment). This has started happening to me on 1.19, where it should've been fixed already?

gitea panics with unaligned 64-bit atomic operation
router: completed POST /some-org/some-repo/issues/new for [::1]:39284, 303 See Other in 672.8ms @ repo/issue.go:1080(repo.NewIssuePost)
panic: unaligned 64-bit atomic operation
goroutine 1895 [running]:runtime/internal/atomic.panicUnaligned()
        /usr/local/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Xadd64(0xc1fb93c, 0x13)
        /usr/local/go/src/runtime/internal/atomic/atomic_arm.s:258 +0x14
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).incrementBytesWritten(...)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/contentcoder.go:114
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).flushContents(0xc1fb900)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/contentcoder.go:143 +0x330
github.com/blevesearch/zapx/v15.(*chunkedContentCoder).Close(...)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/contentcoder.go:110
github.com/blevesearch/zapx/v15.(*interim).writeDicts(0xbfd00f0)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/new.go:803 +0x1264
github.com/blevesearch/zapx/v15.(*interim).convert(0xbfd00f0)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/new.go:277 +0x34c
github.com/blevesearch/zapx/v15.(*ZapPlugin).newWithChunkMode(0x5811bac, {0x93ced70, 0x1, 0x1}, 0x402)
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/new.go:72 +0x1b4
github.com/blevesearch/zapx/v15.(*ZapPlugin).New(0x5811bac, {0x93ced70, 0x1, 0x1})
        /go/pkg/mod/github.com/blevesearch/zapx/v15@v15.3.8/new.go:47 +0x40
github.com/blevesearch/bleve/v2/index/scorch.(*Scorch).Batch(0x71cb800, 0xbd60780)
        /go/pkg/mod/github.com/blevesearch/bleve/v2@v2.3.6/index/scorch/scorch.go:412 +0x5b0
github.com/blevesearch/bleve/v2.(*indexImpl).Batch(0x94d28c0, 0x8a5f320)
        /go/pkg/mod/github.com/blevesearch/bleve/v2@v2.3.6/index_impl.go:310 +0xa8
code.gitea.io/gitea/modules/indexer/bleve.(*FlushingBatch).Flush(0x83f3da8)
        /source/modules/indexer/bleve/batch.go:52 +0x30
code.gitea.io/gitea/modules/indexer/issues.(*BleveIndexer).Index(0x8aea020, {0x93cec58, 0x1, 0x1})
        /source/modules/indexer/issues/bleve.go:226 +0x188
code.gitea.io/gitea/modules/indexer/issues.InitIssueIndexer.func1({0xa5643c0, 0x1, 0x14})
        /source/modules/indexer/issues/indexer.go:146 +0x5e0
code.gitea.io/gitea/modules/queue.NewByteFIFOQueue.func1({0xa5643c0, 0x1, 0x14})
        /source/modules/queue/queue_bytefifo.go:70 +0x3c
code.gitea.io/gitea/modules/queue.(*WorkerPool).doWork(0x7fcbce0, {0x3fab974, 0xbdee260})
        /source/modules/queue/workerpool.go:605 +0x694
code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers.func1()
        /source/modules/queue/workerpool.go:311 +0x58
created by code.gitea.io/gitea/modules/queue.(*WorkerPool).addWorkers
        /source/modules/queue/workerpool.go:309 +0x20
gitea.service: Main process exited, code=exited, status=2/INVALIDARGUMENT

Gitea version: Gitea version 1.19.0 built with GNU Make 4.1, go1.20.2 : bindata, sqlite, sqlite_unlock_notify
(built for armv6)

This might be related to blevesearch/zapx@67addef.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants