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

在 32 位 armv7 上报错 panic: unaligned 64-bit atomic operation #1788

Closed
Eson-Jia opened this issue Mar 15, 2022 · 5 comments
Closed

在 32 位 armv7 上报错 panic: unaligned 64-bit atomic operation #1788

Eson-Jia opened this issue Mar 15, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@Eson-Jia
Copy link

Eson-Jia commented Mar 15, 2022

What happened:

2022-03-15T16:12:32.497+0800    INFO     nacos_client/nacos_client.go:79 logDir:</root/log>   cacheDir:</root/cache>
2022-03-15T16:12:32.500+0800    INFO     nacos/builder.go:138    [Nacos Client] New nacos client with config = [{Scheme: ContextPath: IpAddr:192.168.1.72 Port:8848}]
2022-03-15T16:12:32.501+0800    INFO     v3router/router_chain.go:55     [NewUniformRouterChain] Config center does not start, please check if the configuration center has been properly configured in dubbogo.yml
panic: unaligned 64-bit atomic operation

goroutine 132 [running]:
runtime/internal/atomic.panicUnaligned()
        /home/ubuntu/BMI-HI3521A/go/src/runtime/internal/atomic/unaligned.go:8 +0x24
runtime/internal/atomic.Store64(0x45720ac, 0x3b9aca00)
        /home/ubuntu/BMI-HI3521A/go/src/runtime/internal/atomic/atomic_arm.s:301 +0x14
go.uber.org/atomic.(*Int64).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/atomic@v1.9.0/int64.go:75
go.uber.org/atomic.(*Duration).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/atomic@v1.9.0/duration.go:55
github.com/apache/dubbo-getty.(*gettyConn).SetWriteTimeout(0x4572080, 0x3b9aca00)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/connection.go:161 +0x6c
github.com/apache/dubbo-getty.newSession({0x1466f7c, 0x436e1e0}, {0x1476284, 0x4572080})
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/session.go:151 +0x1b4
github.com/apache/dubbo-getty.newTCPSession({0x1469bb8, 0x43c6a08}, {0x1466f7c, 0x436e1e0})
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/session.go:159 +0x48
github.com/apache/dubbo-getty.(*client).dialTCP(0x436e1e0)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/client.go:170 +0x400
github.com/apache/dubbo-getty.(*client).dial(0x436e1e0)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/client.go:346 +0x38
github.com/apache/dubbo-getty.(*client).connect(0x436e1e0)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/client.go:384 +0x48
github.com/apache/dubbo-getty.(*client).reConnect(0x436e1e0)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/client.go:441 +0x90
github.com/apache/dubbo-getty.(*client).RunEventLoop(0x436e1e0, 0x43c69d8)
        /StreamPlugins/gopath/pkg/mod/github.com/apache/dubbo-getty@v1.4.7/client.go:419 +0x70
created by dubbo.apache.org/dubbo-go/v3/remoting/getty.newGettyRPCClientConn
        /StreamPlugins/gopath/pkg/mod/dubbo.apache.org/dubbo-go/v3@v3.0.1/remoting/getty/pool.go:79 +0x444```
**What you expected to happen**:

**How to reproduce it (as minimally and precisely as possible)**:

**Anything else we need to know?**:
go version 1.17.7  dubbo-go version 3.0.1
@LaurenceLiZhixin LaurenceLiZhixin added the bug Something isn't working label Mar 15, 2022
@LaurenceLiZhixin
Copy link
Contributor

That's a good problem.

@baerwang
Copy link
Member

@LaurenceLiZhixin
Copy link
Contributor

Any more questions? This issue will be closed @Eson-Jia

@Eson-Jia
Copy link
Author

Eson-Jia commented Apr 1, 2022

我发现如果注册中心是 nacos ,在 32 位的 armv7 上运行的 dubbo-go(v3.0.1) cilent 启动后就会崩溃。如果将注册中心改成 zookeeper,cilent 就不会崩溃。目前的解决方法是使用 zookeeper 作为注册中心。 @LaurenceLiZhixin

@binbin0325
Copy link
Member

binbin0325 commented Apr 1, 2022

看panic堆栈比较明显。这是因为在dubbo-getty connection.go的SetWriteTimeout()中使用了uber atomic.Store, 在Store中会对val转换int64,导致在32位操作系统panic.

go.uber.org/atomic.(*Int64).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/atomic@v1.9.0/int64.go:75
go.uber.org/atomic.(*Duration).Store(...)
        /StreamPlugins/gopath/pkg/mod/go.uber.org/atomic@v1.9.0/duration.go:55
github.com/apache/dubbo-getty.(*gettyConn).SetWriteTimeout(0x4572080, 0x3b9aca00)
func (x *Duration) Store(val time.Duration) {
	x.v.Store(int64(val))
}

uber-go/atomic issue:uber-go/atomic#105

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants