We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我将软件发布到arm 32位操作系统遇到了问题
打包命令如下: set GOARCH=arm set GOOS=linux set CGO_ENABLED=0 go build -o ipchub_linux
运行时显示的错误信息: panic: unaligned 64-bit atomic operation
goroutine 20 [running]: runtime/internal/atomic.panicUnaligned() E:/Program Files/Go/src/runtime/internal/atomic/unaligned.go:8 +0x24 runtime/internal/atomic.Store64(0x24881ec, 0x0) E:/Program Files/Go/src/runtime/internal/atomic/atomic_arm.s:291 +0x14 github.com/cnotch/scheduler.(*Scheduler).run(0x24881c0) C:/Users/Administrator/go/pkg/mod/github.com/cnotch/[email protected]/scheduler.go:226 +0xf0 created by github.com/cnotch/scheduler.New in goroutine 1 C:/Users/Administrator/go/pkg/mod/github.com/cnotch/[email protected]/scheduler.go:89 +0x274
The text was updated successfully, but these errors were encountered:
抱歉,很长时间没有关注这个项目了,我没有在32位系统测过。从显示的log看,是结构体对齐的问题。 可以将scheduler中的结构体中需要原子操作的count提到第一个,如下: type Scheduler struct { count int64 // 也就是这里 wg *sync.WaitGroup add chan *ManagedJob remove chan *ManagedJob snapshot chan chan []*ManagedJob panicHandler atomic.Value loc *time.Location ctx context.Context cancel context.CancelFunc terminated bool }
这样确保64位字节对齐。 希望对您有所帮助。
Sorry, something went wrong.
No branches or pull requests
我将软件发布到arm 32位操作系统遇到了问题
打包命令如下:
set GOARCH=arm
set GOOS=linux
set CGO_ENABLED=0
go build -o ipchub_linux
运行时显示的错误信息:
panic: unaligned 64-bit atomic operation
goroutine 20 [running]:
runtime/internal/atomic.panicUnaligned()
E:/Program Files/Go/src/runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Store64(0x24881ec, 0x0)
E:/Program Files/Go/src/runtime/internal/atomic/atomic_arm.s:291 +0x14
github.com/cnotch/scheduler.(*Scheduler).run(0x24881c0)
C:/Users/Administrator/go/pkg/mod/github.com/cnotch/[email protected]/scheduler.go:226 +0xf0
created by github.com/cnotch/scheduler.New in goroutine 1
C:/Users/Administrator/go/pkg/mod/github.com/cnotch/[email protected]/scheduler.go:89 +0x274
The text was updated successfully, but these errors were encountered: