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

[Bug]: 连续多次发送合并图片消息后主进程停止 #1563

Open
4 tasks done
RShock opened this issue Jun 29, 2022 · 14 comments
Open
4 tasks done

[Bug]: 连续多次发送合并图片消息后主进程停止 #1563

RShock opened this issue Jun 29, 2022 · 14 comments
Labels
bug? The issue author think this is a bug

Comments

@RShock
Copy link

RShock commented Jun 29, 2022

请确保您已阅读以上注意事项,并勾选下方的确认框。

  • 我已经仔细阅读上述教程和 "提问前需知"
  • 我已经使用 dev分支版本 测试过,问题依旧存在。
  • 我已经在 Issue Tracker 中找过我要提出的问题,没有找到相同问题的ISSUE。
  • 我已知晓并同意,此处仅用于汇报程序中存在的问题。若这个 Issue 是关于其他非程序本身问题,则我的 Issue 可能会被无条件自动关闭或/并锁定。(这些问题应当在 Discussion 板块提出。)

go-cqhttp 版本

v1.0.0-rc1

运行环境

Ubuntu

运行架构

x86

连接方式

WebSocket (反向)

使用协议

0 | iPad

重现步骤

短期内大量发送合并的图片消息(每个消息最多有20张图片)后,进程停止

期望的结果是什么?

正常发送

实际的结果是什么?

进程停止

简单的复现代码/链接(可选)

No response

日志记录(可选)

`
[2022-06-29 23:09:04] [INFO]: 收到群 b站一浪y游戏王md交流4(734292824) 内 THF(3156364160) 的消息: ygo 12 (-975681943)
[2022-06-29 23:09:16] [INFO]: 收到群 b站一浪y游戏王md交流4(734292824) 内 THF(3156364160) 的消息: ygo 十二 (750510940)
panic: id (1) <= evictCount (2)

goroutine 687 [running]:
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).idToIndex(0xc0006b7b00, 0xc0002079e0)
        vendor/golang.org/x/net/http2/hpack/tables.go:119 +0xd9
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).search(0xc0006b7b00, {{0xb83cc9, 0xa}, {0xc0002800cb, 0x14}, 0x0})
        vendor/golang.org/x/net/http2/hpack/tables.go:106 +0xe5
vendor/golang.org/x/net/http2/hpack.(*Encoder).searchTable(0xc0006b7b00, {{0xb83cc9, 0xa}, {0xc0002800cb, 0x14}, 0x0})
        vendor/golang.org/x/net/http2/hpack/encode.go:97 +0x88
vendor/golang.org/x/net/http2/hpack.(*Encoder).WriteField(0xc0006b7b00, {{0xb83cc9, 0xa}, {0xc0002800cb, 0x14}, 0x0})
        vendor/golang.org/x/net/http2/hpack/encode.go:62 +0x14a
net/http.(*http2ClientConn).writeHeader(0xb83cc9, {0xb83cc9, 0xc000494968}, {0xc0002800cb, 0x197})
        net/http/h2_bundle.go:8470 +0x149
net/http.(*http2ClientConn).encodeHeaders.func3({0xb83cc9, 0x0}, {0xc0002800cb, 0x18})
        net/http/h2_bundle.go:8404 +0x72
net/http.(*http2ClientConn).encodeHeaders.func1(0xc000494b78)
        net/http/h2_bundle.go:8296 +0x97
net/http.(*http2ClientConn).encodeHeaders(0xc00006ef00, 0xc000243a00, 0x1, {0x0, 0x0}, 0x0)
        net/http/h2_bundle.go:8397 +0x67e
net/http.(*http2clientStream).encodeAndWriteHeaders(0xc0005b6600, 0xc000243a00)
        net/http/h2_bundle.go:7913 +0x30e
net/http.(*http2clientStream).writeRequest(0xc0005b6600, 0xc000243a00)
        net/http/h2_bundle.go:7809 +0x4c9
net/http.(*http2clientStream).doRequest(0x906bed, 0xc000444380)
        net/http/h2_bundle.go:7727 +0x1e
created by net/http.(*http2ClientConn).RoundTrip
        net/http/h2_bundle.go:7656 +0x30f
`

补充说明(可选)

No response

@RShock RShock added the bug? The issue author think this is a bug label Jun 29, 2022
@Mrs4s
Copy link
Owner

Mrs4s commented Jul 1, 2022

看上去好像是标准库的问题 -> golang/go#43051
我们这边尽量修修

@Mrs4s
Copy link
Owner

Mrs4s commented Jul 1, 2022

请问发送的图片链接具体是什么, 有没有复现方法

@RShock
Copy link
Author

RShock commented Jul 1, 2022

请问发送的图片链接具体是什么, 有没有复现方法

我使用的是 真寻机器人游戏王卡查 插件,
插件返回配置被我设为了20

这个插件的原版在nonebot2里
通过群友高频查询类似 战士/十二/英雄 等会返回20张左右查询结果的词后gocq崩溃,可以复现崩溃

@wdvxdr1123
Copy link
Collaborator

rc1使用go1.17编译, 从issue里看,go团队在1.18开发周期中尝试过修复,请更新到rc3版本(使用go1.18编译)看看是否还有bug。

@icarus-ai
Copy link

rc1使用go1.17编译, 从issue里看,go团队在1.18开发周期中尝试过修复,请更新到rc3版本(使用go1.18编译)看看是否还有bug。

有没有可能是x/net 用的2021的某版?
golang.org/x/net v0.0.0-20220630215102-69896b714898

@wdvxdr1123
Copy link
Collaborator

@icarus-ai 标准库使用vendor后的net库,与go.mod无关

@RShock
Copy link
Author

RShock commented Jul 2, 2022

我现在遇到一个问题,在升级rc3之前,我想先自己再次复现这个BUG。
之前放在群里时,群友只需要10次左右的查询就能快速把进程搞挂(总共2次),导致我错误估计了难度。。通过加循环等方式以更快的速度发图都没有办法复现这个BUG。感觉我自己一个人没办法复现。
我现在把机器人重新丢到了游戏王群里面,希望他们能复现这个BUG,但是他们之前已经玩过这个功能了,现在没兴趣高频触发。。。所以我的验证估计还得等很久
另一次日志也被我抓出来了

panic: id (154) <= evictCount (161)

goroutine 556773 [running]:
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).idToIndex(0xc000657b80, 0xc001183bf0)
	vendor/golang.org/x/net/http2/hpack/tables.go:119 +0xd9
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).search(0xc000657b80, {{0xb83cc9, 0xa}, {0xc0006770cb, 0x14}, 0x0})
	vendor/golang.org/x/net/http2/hpack/tables.go:106 +0xe5
vendor/golang.org/x/net/http2/hpack.(*Encoder).searchTable(0xc000657b80, {{0xb83cc9, 0xa}, {0xc0006770cb, 0x14}, 0x0})
	vendor/golang.org/x/net/http2/hpack/encode.go:97 +0x88
vendor/golang.org/x/net/http2/hpack.(*Encoder).WriteField(0xc000657b80, {{0xb83cc9, 0xa}, {0xc0006770cb, 0x14}, 0x0})
	vendor/golang.org/x/net/http2/hpack/encode.go:62 +0x14a
net/http.(*http2ClientConn).writeHeader(0xb83cc9, {0xb83cc9, 0x0}, {0xc0006770cb, 0x0})
	net/http/h2_bundle.go:8470 +0x149
net/http.(*http2ClientConn).encodeHeaders.func3({0xb83cc9, 0x0}, {0xc0006770cb, 0x18})
	net/http/h2_bundle.go:8404 +0x72
net/http.(*http2ClientConn).encodeHeaders.func1(0xc000932b78)
	net/http/h2_bundle.go:8296 +0x97
net/http.(*http2ClientConn).encodeHeaders(0xc00006fb00, 0xc000123d00, 0x1, {0x0, 0x0}, 0x0)
	net/http/h2_bundle.go:8397 +0x67e
net/http.(*http2clientStream).encodeAndWriteHeaders(0xc000b4c780, 0xc000123d00)
	net/http/h2_bundle.go:7913 +0x30e
net/http.(*http2clientStream).writeRequest(0xc000b4c780, 0xc000123d00)
	net/http/h2_bundle.go:7809 +0x4c9
net/http.(*http2clientStream).doRequest(0x906bed, 0xc0009cdf88)
	net/http/h2_bundle.go:7727 +0x1e
created by net/http.(*http2ClientConn).RoundTrip
	net/http/h2_bundle.go:7656 +0x30f

@CrazyBoyM
Copy link

�[0mpanic: id (41) <= evictCount (43)

goroutine 44862 [running]:
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).idToIndex(0xc000551800, 0xc001f3a660?)
	vendor/golang.org/x/net/http2/hpack/tables.go:119 +0xce
vendor/golang.org/x/net/http2/hpack.(*headerFieldTable).search(0xc000551800, {{0xaba15c, 0xa}, {0xc00118de4b, 0x10}, 0x0})
	vendor/golang.org/x/net/http2/hpack/tables.go:106 +0xe5
vendor/golang.org/x/net/http2/hpack.(*Encoder).searchTable(0xc000551800, {{0xaba15c, 0xa}, {0xc00118de4b, 0x10}, 0x0})
	vendor/golang.org/x/net/http2/hpack/encode.go:97 +0x88
vendor/golang.org/x/net/http2/hpack.(*Encoder).WriteField(0xc000551800, {{0xaba15c, 0xa}, {0xc00118de4b, 0x10}, 0x0})
	vendor/golang.org/x/net/http2/hpack/encode.go:62 +0x14a
net/http.(*http2ClientConn).writeHeader(0xaba15c?, {0xaba15c?, 0x49?}, {0xc00118de4b?, 0x6?})
	net/http/h2_bundle.go:8650 +0x12b
net/http.(*http2ClientConn).encodeHeaders.func3({0xaba15c?, 0x0?}, {0xc00118de4b, 0x10})
	net/http/h2_bundle.go:8584 +0x72
net/http.(*http2ClientConn).encodeHeaders.func1(0xc0005d5b60)
	net/http/h2_bundle.go:8476 +0x97
net/http.(*http2ClientConn).encodeHeaders(0xc00292cd80, 0xc002413100, 0x1, {0x0, 0x0}, 0x0)
	net/http/h2_bundle.go:8577 +0x61e
net/http.(*http2clientStream).encodeAndWriteHeaders(0xc00245e180, 0xc002413100)
	net/http/h2_bundle.go:8085 +0x305
net/http.(*http2clientStream).writeRequest(0xc00245e180, 0xc002413100)
	net/http/h2_bundle.go:7981 +0x4a5
net/http.(*http2clientStream).doRequest(0x8d7caa?, 0xc0007983c0?)
	net/http/h2_bundle.go:7899 +0x1e
created by net/http.(*http2ClientConn).RoundTrip
	net/http/h2_bundle.go:7828 +0x30a

我遇到一个类似的问题,是最近加入“图片 + 消息 + 图片”这种消息内容后在大量人使用的情况下会出现,而且一个下午出现了3次以上。

@RShock
Copy link
Author

RShock commented Oct 13, 2022

我觉得你复现的概率更高。可以尝试更新版本后再看看

wdvxdr1123 added a commit that referenced this issue Oct 13, 2022
also disable http2 when downloading, may fix some issue

For #1563
@wdvxdr1123
Copy link
Collaborator

可以尝试使用: https://github.com/Mrs4s/go-cqhttp/actions/runs/3242794315

下载媒体资源时禁用了http2, 理论上修复了

@CrazyBoyM
Copy link

可以尝试使用: https://github.com/Mrs4s/go-cqhttp/actions/runs/3242794315

下载媒体资源时禁用了http2, 理论上修复了

抱歉我并不是一个go开发者,尝试自己拉取该代码构建失败233。有actions发布的文件嘛

@wdvxdr1123
Copy link
Collaborator

@CrazyBoyM 链接下方有构建好的文件

@CrazyBoyM
Copy link

@CrazyBoyM 链接下方有构建好的文件

抱歉之前网不好加载github页面总是不显示全,已经在使用新的测试版了。非常感谢!

@qiangdadi
Copy link

我也发生了类似的问题,请问不禁用http2是否可以解决?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? The issue author think this is a bug
Projects
None yet
Development

No branches or pull requests

6 participants