-
-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Gitea crashes with "unaligned 64-bit atomic operation" #19518
Comments
Could you try to apply this patch and see if that fixes the issue? diff --git a/modules/queue/workerpool.go b/modules/queue/workerpool.go
index 2d8504598..8e0b5f532 100644
--- a/modules/queue/workerpool.go
+++ b/modules/queue/workerpool.go
@@ -22,6 +22,7 @@ import (
// they use to detect if there is a block and will grow and shrink in
// response to demand as per configuration.
type WorkerPool struct {
+ numInQueue int64
lock sync.Mutex
baseCtx context.Context
baseCtxCancel context.CancelFunc
@@ -38,7 +39,6 @@ type WorkerPool struct {
blockTimeout time.Duration
boostTimeout time.Duration
boostWorkers int
- numInQueue int64
}
var ( The problem is caused that we're trying to do 64-bit operations on 32-bit machine(Armv6), moving it to the begin of the struct should allow the atomic operation to work, this "workaround" is noted at the atomic's BUG section https://pkg.go.dev/sync/atomic#pkg-note-BUG |
Running without any issue with the suggested change. |
- Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves go-gitea#19518
- Backport go-gitea#19531 - Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves go-gitea#19518
- Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves #19518
- Backport #19531 - Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves #19518
…gitea#19532) - Backport go-gitea#19531 - Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves go-gitea#19518
- Doing 64-bit atomic operations on 32-bit machines is a bit tricky by golang, as they can only be done under certain set of conditions(https://pkg.go.dev/sync/atomic#pkg-note-BUG). - This PR fixes such case whereby the conditions weren't met, it moves the int64 to the first field of the struct, which will 64-bit operations happening on this property on 32-bit machines. - Resolves go-gitea#19518
On an i386 system gitea 1.17.3 runs perfectly.
|
please file a new issue |
Description
Gitea master version crashes on arm v6 with "unaligned 64-bit atomic operation
Gitea Version
master
Can you reproduce the bug on the Gitea demo site?
No
Log Gist
https://gist.github.com/abutre/03b3b7e833e4a5f2cc18bbb103dd335d
Screenshots
No response
Git Version
2.32.0
Operating System
Ubuntu 21.10 on arm v6
How are you running Gitea?
Self hosted
Database
SQLite
The text was updated successfully, but these errors were encountered: