wdvxdr1123 / ZeroBot

一个基于onebot协议的机器人Go开发框架
GNU General Public License v3.0
326 stars 71 forks source link

编译提示报错 #74

Closed xiaoyi510 closed 1 year ago

xiaoyi510 commented 1 year ago

编译调试报错

github.com/wdvxdr1123/ZeroBot.(*eventRing).processEvent: nosplit stack over 792 byte limit
github.com/wdvxdr1123/ZeroBot.(*eventRing).processEvent<1>
    grows 232 bytes, calls runtime.typedmemmove<1>
        grows 56 bytes, calls runtime.cgoCheckMemmove<1>
            grows 80 bytes, calls runtime.cgoCheckTypedBlock<1>
                grows 176 bytes, calls runtime.cgoCheckBits<1>
                    grows 88 bytes, calls runtime.cgoIsGoPointer<1>
                        grows 72 bytes, calls runtime.inHeapOrStack<1>
                            grows 32 bytes, calls runtime.spanOf<1>
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
                grows 176 bytes, calls runtime.cgoCheckBits<1>
                    grows 88 bytes, calls runtime.cgoIsGoPointer<1>
                        grows 72 bytes, calls runtime.inHeapOrStack<1>
                            grows 32 bytes, calls runtime.spanOf<1>
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
                grows 176 bytes, calls runtime.cgoCheckBits<1>
                    grows 88 bytes, calls runtime.cgoIsGoPointer<1>
                        grows 72 bytes, calls runtime.inHeapOrStack<1>
                            grows 32 bytes, calls runtime.spanOf<1>
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
                                grows 48 bytes, calls runtime.panicIndexU<1>
                                    grows 8 bytes, calls runtime.goPanicIndexU<1>
                                        grows 8 bytes, calls runtime.morestack<0>
                                        8 bytes over limit
wdvxdr1123 commented 1 year ago

cc @fumiama

fumiama commented 1 year ago

这应该是go的一个bug,nosplit本身没什么问题,可以尝试更新go版本以及zb版本,看看问题是否解决。

xiaoyi510 commented 1 year ago

懵逼了 1.20 go 编译又提示 版本太高 WARNING: undefined behavior - version of Delve is too old for Go version 1.20.1 (maximum supported version 1.18)

1.19 又报错

1.18 也报错

github.com/RomiChan/syncx

/Users/xiaoyi510/server/golang/gopath/pkg/mod/github.com/!romi!chan/syncx@v0.0.0-20221202055724-5f842c53020e/lazy.go:13:16: undefined: atomic.Uint32 /Users/xiaoyi510/server/golang/gopath/pkg/mod/github.com/!romi!chan/syncx@v0.0.0-20221202055724-5f842c53020e/lazy.go:14:16: undefined: atomic.Uint32 /Users/xiaoyi510/server/golang/gopath/pkg/mod/github.com/!romi!chan/syncx@v0.0.0-20221202055724-5f842c53020e/map.go:44:14: undefined: atomic.Pointer note: module requires Go 1.19

xiaoyi510 commented 1 year ago

image

经测试 我只有这几个依赖包

1.19 是报错的 只有 1.20 能运行 看能否解决

xiaoyi510 commented 1 year ago

v1.6.3 使用golang v1.18 可以正常编译 v1.6.4 开始 golang 1.18 编译失败

xiaoyi510 commented 1 year ago

建议重新支持到 golang v1.18 版本 好多扩展都是用的 golang v1.18 = = 只能高版本很多兼容问题

fumiama commented 1 year ago

既然是syncx版本过高,你可以手动将syncx降级到 d7ea0ae15a4cbf29371d5fcd33e556ff43301564 版本。至于高版本有兼容问题,我觉得大部分都可以轻松解决,因为go的高版本也没什么break change。如果你执意要使用老版本,将zb停留在低版本即可。你最开始的debug错误是在v1.5.1-mid之后引入的,那么你可以将版本固定在v1.5.1-mid。