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

fix nil pointer dereference caused by nil 'cs' #2440

Merged
merged 4 commits into from
Oct 1, 2023
Merged

Conversation

1umine
Copy link
Contributor

@1umine 1umine commented Sep 19, 2023

  • fix: [Bug]: GoCQ 意外崩溃,报错 invalid memory address or nil pointer dereference #2437
  • optimize: 当仅配置一个签名服务时不进行检查可用以及切换操作(仅有一个时也没地方切换)
  • energy 出现decode 错误时打印出导致错误的具体数据内容,便于发现问题()
  • fix: 修复在因某些原因(如qsign崩溃)导致当前签名服务被标记为不可用后,可能导致刷新token时提示uin未注册或者qsign未初始化的问题

修复刷新 token 时若当前签名服务不可用而主签名服务可用会导致panic的问题。
btw, energy 出现decode error时打印出导致错误的数据内容
修复在qsign崩溃重启前请求了签名服务器导致当前签名服务器被标记为不可用(`ss.set(nil)`),
从而不会再执行sign请求(除非有其他请求签名服务器的操作)
这可能导致下一次刷新token提示uin is not registered或者提示未初始化
@1umine 1umine changed the title [Dev] fix nil pointer dereference caused by nil 'cs' fix nil pointer dereference caused by nil 'cs' Sep 20, 2023
@KomeiDiSanXian
Copy link
Contributor

panic: runtime error: slice bounds out of range [:6] with capacity 3

goroutine 1703217 [running]:
github.com/Mrs4s/go-cqhttp/cmd/gocq.signSubmit({0xc0003a4122, 0xa}, {0xc0019a0c2
0, 0x30}, 0xa1?, {0xc0018eed50, 0x3, 0x3}, {0xb07862, 0xd})
        E:/project/Go/go-cqhttp/cmd/gocq/login.go:321 +0x6de
github.com/Mrs4s/go-cqhttp/cmd/gocq.signCallback({0xc0003a4122, 0xa}, {0xc001191
540?, 0x1, 0x0?}, {0xb07862, 0xd})
        E:/project/Go/go-cqhttp/cmd/gocq/login.go:342 +0xa5
created by github.com/Mrs4s/go-cqhttp/cmd/gocq.signRefreshToken in goroutine 58
        E:/project/Go/go-cqhttp/cmd/gocq/login.go:421 +0x7eb

罕见情况下会越界,但是触发方式还没去研究(课太多了就不想看了
触发时是在请求超时的时候

@1umine
Copy link
Contributor Author

1umine commented Sep 20, 2023

不会吧,这个应该之前就修过了,理论上应该不会出这个错()。确定是这个pr编译的吗()

@KomeiDiSanXian
Copy link
Contributor

不会吧,这个应该之前就修过了,理论上应该不会出这个错()。确定是这个pr编译的吗()

犯蠢了,我用的旧版本,忙晕了看来
我的锅

@fumiama fumiama merged commit 1c34643 into Mrs4s:dev Oct 1, 2023
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants